Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/barenddt/soundcloud-v2-api
Promise-based Javascript Soundcloud v2 API controller.
https://github.com/barenddt/soundcloud-v2-api
soundcloud soundcloud-api soundcloud-stream soundcloud-v2
Last synced: 2 months ago
JSON representation
Promise-based Javascript Soundcloud v2 API controller.
- Host: GitHub
- URL: https://github.com/barenddt/soundcloud-v2-api
- Owner: barenddt
- Created: 2019-08-21T20:04:42.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-05T13:24:17.000Z (almost 4 years ago)
- Last Synced: 2024-09-27T12:01:34.896Z (3 months ago)
- Topics: soundcloud, soundcloud-api, soundcloud-stream, soundcloud-v2
- Language: JavaScript
- Size: 647 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Soundcloud v2 API Controller
This API controller was created for personal implementation in my project called [Soundify](https://github.com/barenddt/soundify). Soundcloud does not currently provide a method for interacting with the new v2 API effectively. The v1 API is missing a lot of endpoints the v2 api has. (/charts to name one).## Navigation
- [Installation](#install)
- Examples
- [Searching](#search)
- [Streaming](#stream)
- [References](#reference)## Installation
#### via NPM
```
npm i soundcloud-v2-api
```#### via YARN
```
yarn add soundcloud-v2-api
```## Usage
### Example (Searching Tracks)
```javascript
const SC = require('soundcloud-v2-api');SC.init({
clientId: 'YOUR_CLIENT_ID'
})SC.get('/search/tracks', {
q: 'Post',
limit: 50
}).then(result => console.log(result))
```### Example (Streaming Tracks)
```javascript
//Initialize as in previous example.SC.stream('/tracks/${track.id}/streams').then(stream => {
stream.play()
})
```
### Usage in browsers
```javascript
SC.init({
clientId: 'YOUR_CLIENT_ID',
cors: true
})
```## API Reference
Here are some of the most common endpoints available to use.
### /search/:type
|Types|Returns|
|--|--|
|tracks|List of tracks containing query|
|users|List of users containing query|
|albums|List of albums containing query|
|playlists|List of playlists containing query|### /tracks/${track.id}/:type
|Types|Returns|
|--|--|
|/|Tracks statistics and information|
|reposters|List of users that reposted the track|
|likers|List of users that liked the track|
|comments|List of comments on the track|