Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: about 1 month ago
JSON representation

Promise-based Javascript Soundcloud v2 API controller.

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|