All requests must contain the following headers:
User-Agent: Your User Agent String Content-Type: application/json
All requests must contain the following parameters in the JSON body, and the user_agent must match that of the header:
client: String version: String device_name: String user_agent: String
Additionally, any request may contain the history parameter, which records play history.
history: Dictionary
Authenticated requests must also include the following header, where access_token is acquired from the OAuth2 server:
Authorization: Bearer <access_token>
If an access token is no-longer valid, the JSON API will pass authenticated: false to the response body. When this happens, you must attempt to refresh your token with the OAuth2 server, and if that fails you must reauthenticate to acquire a new token.
{
"result": false,
"authenticated": false
}
Here's what an authenticated request for a user's information would look like:
POST /status HTTP/1.1
Host: api.ibroadcast.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36
Authorization: Bearer jsuis93lamnvc0387ajdm3oll1nj39asndfq
Content-Type: application/json
{
"client": "developer-api",
"version": "1.0",
"device_name": "Developer API",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"mode": "status",
}
Similar to the Login endpoint, make a request to the "status" mode to return the user's information. This request must include the user_id and token as with all authenticated requests.
mode: status
result: Bool authenticated: Bool token: String status: Dictionary user: Dictionary settings: Dictionary
To record play history, include the history parameter in any reqest. In most cases, this will be included in a status request, but it can be provided in requests to any endpoint.
The history parameter should be in the following format:
history: Dictionary
result: Bool authenticated: Bool message: String
Gets the preferred bitrate. This will always return 128 if the user is not premium.
mode: getbitratepref
result: Bool bitrate: Int
Gets the preferred bitrate. This will always return 128 if the user is not premium.
mode: setbitratepref bitrate: Int
result: Bool message: String
Makes a playlist private and disables the public ID.
mode: revokeplaylistpublic playlist_id: Int
result: Bool message: String
Allows playlists to be shared publicly with other people. Returns the public ID of the playlist.
mode: makeplaylistpublic playlist_id: Int
result: Bool message: String public_id: Int
Reports a file as corrupt, causing it to be re-encoded
mode: badfile file_id: Int bitrate: Int problem: String
result: Bool message: String
Tags or untags tracks. If "untag" is true, tracks will be untagged.
mode: tagtracks tagid: Int tracks: [Int] untag: Bool
result: Bool message: String
Deletes tags. This does not delete tracks within tags.
mode: deletetags tags: [Int]
result: Bool message: String
Creates a new, empty tag with a supplied name. Returns the new tag's ID.
mode: createtag tagname: String
result: Bool message: String id: Int
Updates the specified tag_id
mode: updatetag tag_id: Int name: String
result: Bool message: String
Rate an artist 0-5. 0 is unrated.
mode: rateartist artist_id: Int rating: Int
result: Bool message: String
Rate an album 0-5. 0 is unrated.
mode: ratealbum album_id: Int rating: Int
result: Bool message: String
Rate an track: 0: No thumb 1: Thumbs down 5: Thumbs up
mode: ratetrack track_id: Int rating: Int
result: Bool message: String
Reorders playlists to the order in the provided array. The playlist field is an array of playlist IDs.
mode: playlistorder playlist: [Int]
result: Bool message: String
Deletes a playlist with the provided ID.
mode: deleteplaylist playlist: Int
result: Bool message: String
Creates a playlist based on provided tracks, mood, or seed track ID.
To generate the tracks based on a mood, provide one of the following moods: happy, party, dance, relaxed, workout, chill
mode: createplaylist name: String description: String make_public: Bool Provide one of the following: seed: Int mood: String tracks: [Int]
result: Bool message: String tracks: [Int] playlist_id: Int public_id: Int
Appends tracks to the end of a playlist
mode: appendplaylist playlist: Int tracks: [Int]
result: Bool message: String tracks: [Int] playlist_id: Int
Updates an existing playlist with new information if provided
mode: updateplaylist name: String description: String artwork_id: Int tracks: [Int] playlist: Int
result: Bool message: String tracks: [Int] playlist: Int
Gets the user's entire library.
This request must be sent to the library server and NOT the api server:
Host: library.ibroadcast.com
result: Bool message: String library: Dictionary
Get random, non-repeating tracks from a user's library.
mode: random_tracks
result: Bool message: String tracks: [Int]