Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gillesdemey/soundcloud-v2
Client for SoundCloud's API v2
https://github.com/gillesdemey/soundcloud-v2
Last synced: 3 days ago
JSON representation
Client for SoundCloud's API v2
- Host: GitHub
- URL: https://github.com/gillesdemey/soundcloud-v2
- Owner: gillesdemey
- License: mit
- Created: 2015-09-06T00:16:17.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-06T17:02:15.000Z (about 9 years ago)
- Last Synced: 2024-04-14T16:13:15.617Z (7 months ago)
- Language: JavaScript
- Size: 141 KB
- Stars: 12
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SoundCloud v2 API
Client for SoundCloud's API v2
## Usage
Create a new SoundCloud client.
```javascript
var client = new SoundCloud({
access_token: 'oauth-token',
client_id: 'client-id',
app_version: 'v1.0.0' // optional
})
```Call the libraries API, followed by an HTTP method. Supported methods are `get`, `post`, `put` and `delete`.
You can chain multiple functions if they're nested resources.
After calling an HTTP method, you are returned a Promise object.
```javascript
client
.tracks({ id: 222053868 })
.related({ limit: 1 })
.get()
// working with a Promise object here
.then(function (res) {
console.log(res.body.collection[0].title)
})
.catch(function (err) {
console.error(err)
})
```### API
#### Me
```javascript
client
.me()
```#### Activities
```javascript
client
.activities()
```#### Stream
```javascript
client
.stream({ limit: 5 })
```#### Tracks
```javascript
client
.tracks({ id: 222053868 })
```##### Related
```javascript
client
.tracks({ id: 222053868 })
.related({ limit: 1 })
```