### GET /tracks/{track_urn}/preview Source: https://developers.soundcloud.com/docs/api/explorer/api.json Starts playback of a preview for a specific track. ```APIDOC ## GET /tracks/{track_urn}/preview ### Description Starts playback of a preview of the track. ### Method GET ### Endpoint /tracks/{track_urn}/preview ### Path Parameters - **track_urn** (string) - Required - The URN of the track. ### Query Parameters - **secret_token** (string) - Optional - A secret token for accessing private tracks. ### Response #### Success Response (302) - **Found** (object) - Redirects to the preview stream. #### Error Response - **401** - Unauthorized - **404** - Not Found ``` -------------------------------- ### GET /me Source: https://developers.soundcloud.com/docs/api/explorer/open-api Returns the authenticated user’s information. ```APIDOC ## GET /me ### Description Returns the authenticated user’s information. ### Method GET ### Endpoint /me ``` -------------------------------- ### GET /me/followings Source: https://developers.soundcloud.com/docs/api/explorer/api.json Retrieves a list of users that the authenticated user is following. ```APIDOC ## GET /me/followings ### Description Returns a list of users who are followed by the authenticated user. ### Method GET ### Endpoint /me/followings ### Parameters #### Query Parameters - **limit** (integer) - Optional - Maximum number of results to return - **offset** (integer) - Optional - The offset of the first result to return ### Responses #### Success Response (200) - **Users** (object) - Users object #### Error Response (401) - **Unauthorized** (object) - Authentication error ``` -------------------------------- ### GET /playlists/{playlist_urn} Source: https://developers.soundcloud.com/docs/api/explorer/api.json Retrieves a specific playlist by its URN. ```APIDOC ## GET /playlists/{playlist_urn} ### Description Returns a playlist. ### Method GET ### Endpoint /playlists/{playlist_urn} ### Path Parameters - **playlist_urn** (string) - Required - The URN of the playlist. ### Query Parameters - **secret_token** (string) - Optional - A secret token for accessing private playlists. - **access** (string) - Optional - Access level for the playlist. - **show_tracks** (boolean) - Optional - Whether to include tracks in the playlist response. ### Response #### Success Response (200) - **Playlist** (object) - Details of the requested playlist. #### Error Response - **400** - Bad Request - **401** - Unauthorized ``` -------------------------------- ### GET /resolve Source: https://developers.soundcloud.com/docs/api/explorer/api.json Resolves SoundCloud URLs to Resource URLs usable with the API. ```APIDOC ## GET /resolve ### Description Resolves soundcloud.com and on.soundcloud.com URLs to Resource URLs to use with the API. ### Method GET ### Endpoint /resolve ### Parameters #### Query Parameters - **url** (string) - Required - The SoundCloud URL to resolve. ### Response #### Success Response (302) - **Found** (object) - Indicates a successful redirection to the resource URL. #### Error Responses - **404** - Not Found ``` -------------------------------- ### Client Credentials Example Encoding Source: https://developers.soundcloud.com/docs/api/guide Illustrates how to construct the Basic Authentication header for the Client Credentials flow by Base64 encoding your client ID and secret. ```bash # If your client_id is "my_client_id" and client_secret is "my_client_secret" # The concatenated string would be "my_client_id:my_client_secret" # The Base64 encoded string of "my_client_id:my_client_secret" is "bXlfY2xpZW50X2lkOm15X2NsaWVudF9zZWNyZXQ=" ``` -------------------------------- ### Search for Playable Tracks Source: https://developers.soundcloud.com/docs/api/guide Search for tracks using keywords, genres, and IDs. This example specifically filters for playable tracks and sets a limit. ```bash # search pnly for playable tracks $ curl -X GET "https://api.soundcloud.com/tracks?q=hello&ids=1,2,3&genres=Pop,House&access=playable&limit=3&linked_partitioning=true" \ -H "accept: application/json; charset=utf-8" \ -H "Authorization: OAuth ACCESS_TOKEN" ``` -------------------------------- ### Get Authenticated User Information Source: https://developers.soundcloud.com/docs/api/guide Retrieve details about the currently authenticated user by making a GET request to the /me endpoint. This requires an 'Authorization' header with your OAuth access token. ```bash $ curl "https://api.soundcloud.com/me" \ -H "accept: application/json; charset=utf-8" \ -H "Authorization: OAuth ACCESS_TOKEN" ``` -------------------------------- ### GET /users/{user_urn}/likes/playlists Source: https://developers.soundcloud.com/docs/api/explorer/api.json Retrieves a list of playlists that a user has liked. ```APIDOC ## GET /users/{user_urn}/likes/playlists ### Description Returns a list of user's liked playlists. ### Method GET ### Endpoint /users/{user_urn}/likes/playlists ### Parameters #### Path Parameters - **user_urn** (string) - Required - The unique identifier for the user. #### Query Parameters - **limit** (integer) - Optional - The maximum number of liked playlists to return. - **linked_partitioning** (boolean) - Optional - Enables linked partitioning for pagination. ### Response #### Success Response (200) - **Playlists** (object) - Contains the list of liked playlists. #### Error Responses - **400** - Bad Request - **401** - Unauthorized - **404** - Not Found ``` -------------------------------- ### Fetch Non-Existing User with Curl and Error Response Source: https://developers.soundcloud.com/docs/api/guide This example shows how to attempt to fetch a non-existent user using `curl`. The expected response is a 404 Not Found error, including a JSON body detailing the error code, message, and status. ```bash # try fetching a non-existing user $ curl -X GET "https://api.soundcloud.com/users/INVALID_ID" \ -H "accept: application/json; charset=utf-8" \ -H "Authorization: OAuth ACCESS_TOKEN" # response 404 Error: Not Found { "code": 404, "message": "404 - Not Found", "link": "https://developers.soundcloud.com/docs/api/explorer/open-api", "status": "404 - Not Found", "errors": [ { "error_message": "404 - Not Found" } ], "error": null } ``` -------------------------------- ### GET /me/activities Source: https://developers.soundcloud.com/docs/api/explorer/api.json Retrieves the authenticated user's activities, including reposts and new playlists. ```APIDOC ## GET /me/activities ### Description Retrieves the authenticated user's activities, including reposts and new playlists. ### Method GET ### Endpoint /me/activities ### Query Parameters - **limit** (integer) - Optional - The number of activities to retrieve per page. - **cursor** (string) - Optional - A cursor for fetching the next page of activities. ### Response #### Success Response (200) - **collection** (array) - A list of activities. - **type** (string) - The type of activity (e.g., "track:repost", "playlist"). - **created_at** (string) - The timestamp when the activity occurred. - **origin** (object) - The origin of the activity (e.g., a track or playlist object). - **next_href** (string) - URL for the next page of activities. - **future_href** (string) - URL for future activities. ### Response Example ```json { "collection": [ { "type": "track:repost", "created_at": "2020/10/12 12:02:44 +0000", "origin": { "allOf": [ { "$ref": "#/components/examples/Track/value" } ] } }, { "type": "playlist", "created_at": "2020/10/12 12:02:44 +0000", "origin": { "allOf": [ { "$ref": "#/components/examples/Playlist/value" } ] } } ], "next_href": "https://api.soundcloud.com/me/activities?limit=10&cursor=00000", "future_href": "https://api.soundcloud.com/me/activities?limit=10&cursor=000001" } ``` ``` -------------------------------- ### GET /users/{user_urn}/likes/tracks Source: https://developers.soundcloud.com/docs/api/explorer/api.json Retrieves a list of tracks that a user has liked. ```APIDOC ## GET /users/{user_urn}/likes/tracks ### Description Returns a list of user's liked tracks. ### Method GET ### Endpoint /users/{user_urn}/likes/tracks ### Parameters #### Path Parameters - **user_urn** (string) - Required - The unique identifier for the user. #### Query Parameters - **access** (string) - Optional - Specifies the access level for the request. - **limit** (integer) - Optional - The maximum number of liked tracks to return. - **linked_partitioning** (boolean) - Optional - Enables linked partitioning for pagination. ### Response #### Success Response (200) - **Tracks** (object) - Contains the list of liked tracks. #### Error Responses - **400** - Bad Request - **401** - Unauthorized - **404** - Not Found ``` -------------------------------- ### GET /users/{user_urn}/followings/{following_urn} Source: https://developers.soundcloud.com/docs/api/explorer/api.json Retrieves details about a specific user being followed by another user. Note: Use /users/{user_urn} instead. ```APIDOC ## GET /users/{user_urn}/followings/{following_urn} ### Description Returns a user's following. (use /users/{user_urn} instead, to fetch the user details) ### Method GET ### Endpoint /users/{user_urn}/followings/{following_urn} ### Parameters #### Path Parameters - **user_urn** (string) - Required - The unique identifier for the user. - **following_urn** (string) - Required - The unique identifier for the user being followed. ### Response #### Success Response (200) - **User** (object) - The details of the followed user. #### Error Responses - **401** - Unauthorized ``` -------------------------------- ### GET /users/{user_urn}/followings Source: https://developers.soundcloud.com/docs/api/explorer/api.json Retrieves a list of users that a specific user is following. ```APIDOC ## GET /users/{user_urn}/followings ### Description Returns a list of user’s followings. ### Method GET ### Endpoint /users/{user_urn}/followings ### Parameters #### Path Parameters - **user_urn** (string) - Required - The unique identifier for the user. #### Query Parameters - **limit** (integer) - Optional - The maximum number of results to return. ### Response #### Success Response (200) - **Users** (object) - A collection of users. #### Error Responses - **401** - Unauthorized ``` -------------------------------- ### GET /authorize Source: https://developers.soundcloud.com/docs Redirects the user to the SoundCloud authorization page to initiate the Authorization Code flow. ```APIDOC ## GET /authorize ### Description Redirects the user's browser to the SoundCloud authorization URL to obtain an authorization code. ### Method GET ### Endpoint https://secure.soundcloud.com/authorize ### Parameters #### Query Parameters - **client_id** (string) - Required - The client ID obtained during application registration. - **redirect_uri** (string) - Required - The URI to redirect to after authentication. - **response_type** (string) - Required - Must be set to 'code'. - **code_challenge** (string) - Required - A PKCE code challenge. - **code_challenge_method** (string) - Required - Must be set to 'S256'. - **state** (string) - Required - A random string to protect against CSRF attacks. ``` -------------------------------- ### Request SoundCloud oEmbed Data Source: https://developers.soundcloud.com/docs/oembed Example request using curl to fetch embed information for a specific track URL. ```bash $ curl "https://soundcloud.com/oembed" \ -d 'format=json' \ -d 'url=https://soundcloud.com/forss/flickermood' ``` -------------------------------- ### Get Authenticated User Information Source: https://developers.soundcloud.com/docs Retrieves profile information for the user associated with the provided access token. ```bash $ curl "https://api.soundcloud.com/me" \ -H "accept: application/json; charset=utf-8" \ -H "Authorization: OAuth ACCESS_TOKEN" ``` -------------------------------- ### GET /me/activities/all/own Source: https://developers.soundcloud.com/docs/api/explorer/api.json Retrieves the authenticated user's own activities feed. This endpoint is deprecated. ```APIDOC ## GET /me/activities/all/own ### Description Returns the authenticated user's feed ### Method GET ### Endpoint /me/activities/all/own ### Parameters #### Query Parameters - **access** (string) - Required - Access token - **limit** (integer) - Optional - Maximum number of results to return ### Responses #### Success Response (200) - **Activities** (object) - Activities feed object #### Error Response (401) - **Unauthorized** (object) - Authentication error ``` -------------------------------- ### GET /users/{user_urn}/web-profiles Source: https://developers.soundcloud.com/docs/api/explorer/api.json Retrieves a list of web profiles (e.g., website, social media links) associated with a user. ```APIDOC ## GET /users/{user_urn}/web-profiles ### Description Returns list of user's links added to their profile (website, facebook, instagram). ### Method GET ### Endpoint /users/{user_urn}/web-profiles ### Parameters #### Path Parameters - **user_urn** (string) - Required - The unique identifier for the user. #### Query Parameters - **limit** (integer) - Optional - The maximum number of web profiles to return. ### Response #### Success Response (200) - **WebProfiles** (object) - Contains the list of web profiles. #### Error Responses - **401** - Unauthorized ``` -------------------------------- ### GET /users Source: https://developers.soundcloud.com/docs/api/explorer/api.json Performs a user search based on a query and returns a list of users. ```APIDOC ## GET /users ### Description Performs a user search based on a query. ### Method GET ### Endpoint /users ### Query Parameters - **q** (string) - Required - The search query. - **urns** (string) - Optional - Comma-separated list of URNs to filter by. - **limit** (integer) - Optional - The maximum number of results to return. - **offset** (integer) - Optional - The number of results to skip. - **linked_partitioning** (boolean) - Optional - Whether to include linked partitioning in the response. ### Response #### Success Response (200) - **Users** (object) - A list of users matching the search criteria. #### Error Response - **400** - Bad Request - **401** - Unauthorized ``` -------------------------------- ### GET /me/followings/tracks Source: https://developers.soundcloud.com/docs/api/explorer/api.json Retrieves a list of recent tracks from users that the authenticated user is following. ```APIDOC ## GET /me/followings/tracks ### Description Returns a list of recent tracks from users followed by the authenticated user. ### Method GET ### Endpoint /me/followings/tracks ### Parameters #### Query Parameters - **access** (string) - Required - Access token - **limit** (integer) - Optional - Maximum number of results to return - **offset** (integer) - Optional - The offset of the first result to return ### Responses #### Success Response (200) - **TracksList** (object) - Tracks list object #### Error Response (401) - **Unauthorized** (object) - Authentication error ``` -------------------------------- ### Get Comments for a Track Source: https://developers.soundcloud.com/docs/api/guide Retrieve a list of comments for a specific track. You can control the number of results with the `limit` parameter. ```bash $ curl -X GET "https://api.soundcloud.com/tracks/YOUR_TRACK_ID/comments?limit=3&linked_partitioning=true" \ -H "accept: application/json; charset=utf-8" \ -H "Authorization: OAuth ACCESS_TOKEN" ``` -------------------------------- ### Fetch Paginated Playlists with Curl Source: https://developers.soundcloud.com/docs/api/guide Use this command to fetch a limited number of playlists for the authenticated user. The `linked_partitioning=true` parameter is crucial for enabling pagination, and the response will include a `next_href` if more results are available. ```bash # fetch first 25 user's playlists $ curl -X GET "https://api.soundcloud.com/me/playlists?show_tracks=false&linked_partitioning=true&limit=25" \ -H "accept: application/json; charset=utf-8" \ -H "Authorization: OAuth ACCESS_TOKEN" # response contains 'next_href': "https://api.soundcloud.com/playlists?show_tracks=false&page_size=25&cursor=1234567" ``` -------------------------------- ### GET /users/{user_urn} Source: https://developers.soundcloud.com/docs/api/explorer/open-api Retrieves details for a specific user. ```APIDOC ## GET /users/{user_urn} ### Description Returns a user. ### Method GET ### Endpoint /users/{user_urn} ### Parameters #### Path Parameters - **user_urn** (string) - Required - The unique identifier of the user. ``` -------------------------------- ### GET /tracks/{id}/comments Source: https://developers.soundcloud.com/docs/api/explorer/api.json Retrieves comments for a specific track. ```APIDOC ## GET /tracks/{id}/comments ### Description Retrieves comments for a specific track. ### Method GET ### Endpoint /tracks/{id}/comments ### Path Parameters - **id** (integer) - Required - The unique identifier of the track. ### Query Parameters - **limit** (integer) - Optional - The number of comments to retrieve per page. - **cursor** (string) - Optional - A cursor for fetching the next page of comments. ### Response #### Success Response (200) - **collection** (array) - A list of comments. - **body** (string) - The content of the comment. - **created_at** (string) - Timestamp of comment creation. - **urn** (string) - URN of the comment. - **kind** (string) - Type of the resource (e.g., "comment"). - **timestamp** (integer) - Timestamp within the track when the comment was made. - **track_urn** (string) - URN of the track the comment belongs to. - **uri** (string) - API URI for the comment. - **user** (object) - Information about the user who posted the comment. - **user_urn** (string) - URN of the user. - **next_href** (string) - URL for the next page of comments. ### Response Example ```json { "collection": [ { "body": "comment body", "created_at": "2007/09/11 15:40:24 +0000", "urn": "soundcloud:comments:1234", "kind": "comment", "timestamp": 4960, "track_urn": "soundcloud:tracks:123456", "uri": "https://api.soundcloud.com/comments/1234", "user": { "urn": "souncloud:users:12345", "kind": "user", "permalink": "permalink", "username": "user name", "last_modified": "2017/04/10 14:48:03 +0000", "uri": "https://api.soundcloud.com/users/12345", "permalink_url": "https://soundcloud.com/permalink", "avatar_url": "https://i1.sndcdn.com/avatars-large.jpg", "followers_count": 138, "followings_count": 172, "public_favorites_count": 5, "reposts_count": 0 }, "user_urn": "soundcloud:users:12345" } ], "next_href": "https://api.soundcloud.com/collection?page_size=10&cursor=1234567" } ``` ``` -------------------------------- ### POST /playlists Source: https://developers.soundcloud.com/docs/api/explorer/open-api Creates a new playlist for the authenticated user. ```APIDOC ## POST /playlists ### Description Creates a playlist. ### Method POST ### Endpoint /playlists ``` -------------------------------- ### GET /tracks/{id} Source: https://developers.soundcloud.com/docs/api/explorer/api.json Retrieves details for a specific track by its ID. ```APIDOC ## GET /tracks/{id} ### Description Retrieves details for a specific track by its ID. ### Method GET ### Endpoint /tracks/{id} ### Path Parameters - **id** (integer) - Required - The unique identifier of the track. ### Response #### Success Response (200) - **urn** (string) - URN of the track. - **title** (string) - Title of the track. - **description** (string) - Description of the track. - **genre** (string) - Genre of the track. - **permalink_url** (string) - URL to the track's page. - **artwork_url** (string) - URL of the track's artwork. - **duration** (integer) - Duration of the track in milliseconds. - **comment_count** (integer) - Number of comments on the track. - **playback_count** (integer) - Number of times the track has been played. - **favoritings_count** (integer) - Number of times the track has been favorited. - **reposts_count** (integer) - Number of reposts for the track. - **streamable** (boolean) - Whether the track is streamable. - **downloadable** (boolean) - Whether the track is downloadable. - **user** (object) - Information about the track's uploader. ### Response Example ```json { "urn": "soundcloud:tracks:123456", "title": "Example Track", "description": "This is an example track.", "genre": "Electronic", "permalink_url": "https://soundcloud.com/user/example-track", "artwork_url": "https://example.com/artwork.jpg", "duration": 240000, "comment_count": 10, "playback_count": 10000, "favoritings_count": 500, "reposts_count": 50, "streamable": true, "downloadable": false, "user": { "urn": "soundcloud:users:12345", "username": "Example User", "permalink_url": "https://soundcloud.com/user" } } ``` ``` -------------------------------- ### Follow a User Source: https://developers.soundcloud.com/docs/api/guide Use this endpoint to follow another user. This action allows users to customize their experience by seeing content from followed users in their activity feed. ```bash $ curl -X PUT "https://api.soundcloud.com/me/followings/USER_ID" \ -H "accept: application/json; charset=utf-8" \ -H "Authorization: OAuth ACCESS_TOKEN" ``` -------------------------------- ### POST /playlists Source: https://developers.soundcloud.com/docs/api/explorer/api.json Creates a new playlist or updates an existing one. ```APIDOC ## POST /playlists ### Description Creates a new playlist or updates an existing one. This endpoint supports both JSON and form data for request bodies. ### Method POST ### Endpoint /playlists ### Request Body #### JSON Request Body - **playlist** (object) - Required - Playlist details. - **title** (string) - Required - The title of the playlist. - **description** (string) - Optional - The description of the playlist. - **sharing** (string) - Required - The sharing status of the playlist (e.g., "private", "public"). - **tracks** (array) - Required - An array of track URNs to include in the playlist. - **urn** (string) - The URN of the track. #### Form Data Request Body - **playlist[title]** (string) - Required - The title of the playlist. - **playlist[sharing]** (string) - Required - The sharing status of the playlist. - **playlist[description]** (string) - Optional - The description of the playlist. - **playlist[tracks][]** (string) - Optional - URNs of tracks to include. ### Request Example (JSON) ```json { "playlist": { "title": "Test Auto-created Playlist", "description": "Playlist for test purposes", "sharing": "private", "tracks": [ { "urn": "soundcloud:tracks:219787221" }, { "urn": "soundcloud:tracks:783019264" }, { "urn": "soundcloud:tracks:870073492" } ] } } ``` ### Request Example (Form Data) ``` playlist[title]=Test drum sample playlist[sharing]=private playlist[description]=Public-api test sample upload ``` ### Response #### Success Response (200) - **artwork_url** (string) - URL of the playlist's artwork. - **created_at** (string) - Timestamp of playlist creation. - **description** (string) - Description of the playlist. - **downloadable** (boolean) - Whether the playlist is downloadable. - **duration** (integer) - Duration of the playlist in milliseconds. - **ean** (string) - EAN of the playlist. - **embeddable_by** (string) - Who can embed the playlist. - **genre** (string) - Genre of the playlist. - **urn** (string) - URN of the playlist. - **kind** (string) - Type of the resource (e.g., "playlist"). - **label** (string) - Label of the playlist. - **label_id** (string) - ID of the label. - **label_name** (string) - Name of the label. - **last_modified** (string) - Timestamp of last modification. ### Response Example ```json { "artwork_url": "", "created_at": "2020/07/16 16:09:54 +0000", "description": null, "downloadable": true, "duration": 11000, "ean": null, "embeddable_by": "all", "genre": "", "urn": "soundcloud:playlists:12345", "kind": "playlist", "label": null, "label_id": null, "label_name": null, "last_modified": "2020/09/0" } ``` ``` -------------------------------- ### GET /tracks/{track_urn} Source: https://developers.soundcloud.com/docs/api/explorer/api.json Retrieves details for a specific track by its URN. ```APIDOC ## GET /tracks/{track_urn} ### Description Returns a track. ### Method GET ### Endpoint /tracks/{track_urn} ### Path Parameters - **track_urn** (string) - Required - The URN of the track. ### Query Parameters - **secret_token** (string) - Optional - A secret token for accessing private tracks. ### Response #### Success Response (200) - **Track** (object) - Details of the requested track. #### Error Response - **401** - Unauthorized - **404** - Not Found ``` -------------------------------- ### POST /tracks Source: https://developers.soundcloud.com/docs Uploads a new audio track to the user's account. ```APIDOC ## POST https://api.soundcloud.com/tracks ### Description Uploads an audio file to the user's SoundCloud account. Max size 500MB. ### Method POST ### Endpoint https://api.soundcloud.com/tracks ### Request Body - **track[title]** (string) - Required - Title of the track - **track[asset_data]** (file) - Required - The audio file to upload ``` -------------------------------- ### GET /me/feed Source: https://developers.soundcloud.com/docs/api/explorer/api.json Retrieves the authenticated user's activity feed. ```APIDOC ## GET /me/feed ### Description Returns the authenticated user's feed. ### Method GET ### Endpoint /me/feed ### Parameters #### Query Parameters - **access** (string) - Required - Access token - **limit** (integer) - Optional - Maximum number of results to return ### Responses #### Success Response (200) - **Activities** (object) - Activities feed object #### Error Response (401) - **Unauthorized** (object) - Authentication error ``` -------------------------------- ### Create a Playlist using Curl Source: https://developers.soundcloud.com/docs/api/guide Use this endpoint to create a new playlist. Provide playlist details and a list of track IDs in the request body. The playlist can be set to public or private. ```curl $ curl -X POST "https://api.soundcloud.com/playlists" \ -H "accept: application/json; charset=utf-8" \ -H "Content-Type: application/json" \ -H "Authorization: OAuth ACCESS_TOKEN" \ -d "{'playlist': {'title':'YOUR_TITLE', 'description':YOUR_DESCRIPTION, 'sharing':'public', 'tracks':[{'id':1},{'id':2},{'id':3}]}}" ``` -------------------------------- ### GET /users/{user_urn}/reposts/playlists Source: https://developers.soundcloud.com/docs/api/explorer/api.json Retrieves a list of playlists that a user has reposted. ```APIDOC ## GET /users/{user_urn}/reposts/playlists ### Description Returns a list of user's playlist reposts. ### Method GET ### Endpoint /users/{user_urn}/reposts/playlists ### Parameters #### Path Parameters - **user_urn** (string) - Required - The unique identifier for the user. #### Query Parameters - **limit** (integer) - Optional - The maximum number of reposted playlists to return. - **linked_partitioning** (boolean) - Optional - Enables linked partitioning for pagination. ### Response #### Success Response (200) - **Playlists** (object) - Contains the list of reposted playlists. #### Error Responses - **400** - Bad Request - **401** - Unauthorized - **404** - Not Found ``` -------------------------------- ### Redirect User to Authorization URL Source: https://developers.soundcloud.com/docs/api/guide Construct the authorization URL to initiate the OAuth 2.1 flow. This step requires user interaction and must be performed on the front-end. ```bash # authenticate your app through SC Connect # open in the browser $ https://secure.soundcloud.com/authorize \ ?client_id=YOUR_CLIENT_ID \ &redirect_uri=YOUR_REDIRECT_URI \ &response_type=code \ &code_challenge=CODE_CHALLENGE \ &code_challenge_method=S256 \ &state=STATE ``` -------------------------------- ### GET /users/{user_urn}/reposts/tracks Source: https://developers.soundcloud.com/docs/api/explorer/api.json Retrieves a list of tracks that a user has reposted. ```APIDOC ## GET /users/{user_urn}/reposts/tracks ### Description Returns a list of user's track reposts. ### Method GET ### Endpoint /users/{user_urn}/reposts/tracks ### Parameters #### Path Parameters - **user_urn** (string) - Required - The unique identifier for the user. #### Query Parameters - **access** (string) - Optional - Specifies the access level for the request. - **limit** (integer) - Optional - The maximum number of reposted tracks to return. - **linked_partitioning** (boolean) - Optional - Enables linked partitioning for pagination. ### Response #### Success Response (200) - **Tracks** (object) - Contains the list of reposted tracks. #### Error Responses - **400** - Bad Request - **401** - Unauthorized - **404** - Not Found ``` -------------------------------- ### Upload Audio File Source: https://developers.soundcloud.com/docs Uploads a track using multipart/form-data. The file size limit is 500MB. ```bash $ curl -X POST "https://api.soundcloud.com/tracks" \ -H "accept: application/json; charset=utf-8" \ -H "Authorization: OAuth ACCESS_TOKEN" \ -H "Content-Type: multipart/form-data" \ -F "track[title]=YOUR_TITLE" \ -F "track[asset_data]=@PATH_TO_A_FILE" ``` -------------------------------- ### POST /playlists Source: https://developers.soundcloud.com/docs/api/explorer/api.json Creates a new playlist. Supports JSON and multipart/form-data requests. ```APIDOC ## POST /playlists ### Description Creates a playlist. ### Method POST ### Endpoint /playlists ### Request Body - **playlist[title]** (string) - Required - The title of the playlist. ### Request Example ```json { "playlist": { "title": "My Awesome Playlist" } } ``` ### Response #### Success Response (201) - **Playlist** (object) - Details of the created playlist. #### Error Response - **401** - Unauthorized - **404** - Not Found ``` -------------------------------- ### GET /tracks/{track_urn}/comments Source: https://developers.soundcloud.com/docs/api/explorer/api.json Retrieves comments posted on a specific track. ```APIDOC ## GET /tracks/{track_urn}/comments ### Description Returns the comments posted on the track. ### Method GET ### Endpoint /tracks/{track_urn}/comments ### Parameters #### Path Parameters - **track_urn** (string) - Required - The unique identifier for the track. #### Query Parameters - **limit** (integer) - Optional - The maximum number of results to return. - **offset** (integer) - Optional - The number of results to skip. - **linked_partitioning** (boolean) - Optional - Whether to include pagination information in the response. ### Response #### Success Response (200) - **Comments** (object) - A collection of comments. #### Error Responses - **401** - Unauthorized - **404** - Not Found ``` -------------------------------- ### Initialize SoundCloud Widget API Source: https://developers.soundcloud.com/docs/api/html5-widget Access the SoundCloud Widget object by passing an iframe element or its ID to the SC.Widget function. ```javascript var iframeElement = document.querySelector('iframe'); var iframeElementID = iframeElement.id; var widget1 = SC.Widget(iframeElement); var widget2 = SC.Widget(iframeElementID); // widget1 === widget2 ``` -------------------------------- ### Obtain Access Token via Client Credentials Source: https://developers.soundcloud.com/docs/api/guide Use this cURL command for server-to-server authentication when your application needs access to SoundCloud API resources without user interaction. Authentication is done via a Basic header. ```bash # obtain the access token $ curl -X POST "https://secure.soundcloud.com/oauth/token" \ -H "accept: application/json; charset=utf-8" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "Authorization: Basic Base64(client_id:client_secret)" \ --data-urlencode "grant_type=client_credentials" ``` -------------------------------- ### GET /playlists/{playlist_urn}/tracks Source: https://developers.soundcloud.com/docs/api/explorer/api.json Retrieves all tracks associated with a specific playlist. ```APIDOC ## GET /playlists/{playlist_urn}/tracks ### Description Returns tracks under a playlist. ### Method GET ### Endpoint /playlists/{playlist_urn}/tracks ### Path Parameters - **playlist_urn** (string) - Required - The URN of the playlist. ### Query Parameters - **secret_token** (string) - Optional - A secret token for accessing private playlists. - **access** (string) - Optional - Access level for the playlist. - **linked_partitioning** (boolean) - Optional - Whether to include linked partitioning in the response. ### Response #### Success Response (200) - **Tracks** (object) - A list of tracks in the playlist. #### Error Response - **400** - Bad Request - **401** - Unauthorized ``` -------------------------------- ### GET /me/likes/playlists Source: https://developers.soundcloud.com/docs/api/explorer/api.json Retrieves a list of playlists that the authenticated user has favorited or liked. ```APIDOC ## GET /me/likes/playlists ### Description Returns a list of favorited or liked playlists of the authenticated user. ### Method GET ### Endpoint /me/likes/playlists ### Parameters #### Query Parameters - **limit** (integer) - Optional - Maximum number of results to return - **linked_partitioning** (boolean) - Optional - Whether to include linked partitioning ### Responses #### Success Response (200) - **Playlists** (object) - Playlists object #### Error Response (401) - **Unauthorized** (object) - Authentication error ``` -------------------------------- ### GET /me/likes/tracks Source: https://developers.soundcloud.com/docs/api/explorer/api.json Retrieves a list of tracks that the authenticated user has favorited or liked. ```APIDOC ## GET /me/likes/tracks ### Description Returns a list of favorited or liked tracks of the authenticated user. ### Method GET ### Endpoint /me/likes/tracks ### Parameters #### Query Parameters - **limit** (integer) - Optional - Maximum number of results to return - **access_explicit** (string) - Required - Access token - **linked_partitioning** (boolean) - Optional - Whether to include linked partitioning ### Responses #### Success Response (200) - **Tracks** (object) - Tracks object #### Error Response (401) - **Unauthorized** (object) - Authentication error ``` -------------------------------- ### GET /me/feed/tracks Source: https://developers.soundcloud.com/docs/api/explorer/api.json Retrieves the authenticated user's recent track-related feed. ```APIDOC ## GET /me/feed/tracks ### Description Returns the authenticated user's recent track related feed. ### Method GET ### Endpoint /me/feed/tracks ### Parameters #### Query Parameters - **access** (string) - Required - Access token - **limit** (integer) - Optional - Maximum number of results to return ### Responses #### Success Response (200) - **Activities** (object) - Activities feed object #### Error Response (401) - **Unauthorized** (object) - Authentication error ``` -------------------------------- ### POST /tracks Source: https://developers.soundcloud.com/docs/api/explorer/api.json Uploads a new track to SoundCloud. ```APIDOC ## POST /tracks ### Description Uploads a new track to SoundCloud. This endpoint accepts multipart/form-data for track uploads. ### Method POST ### Endpoint /tracks ### Request Body - **track[title]** (string) - Required - The title of the track. - **track[asset_data]** (binary) - Required - The audio file data. - **track[permalink]** (string) - Optional - A custom permalink for the track. - **track[sharing]** (string) - Required - The sharing status of the track (e.g., "private", "public"). - **track[embeddable_by]** (string) - Optional - Who can embed the track (e.g., "me", "all"). - **track[purchase_url]** (string) - Optional - URL for purchasing the track. - **track[description]** (string) - Optional - Description of the track. - **track[genre]** (string) - Optional - Genre of the track. - **track[tag_list]** (string) - Optional - Comma-separated list of tags. - **track[label_name]** (string) - Optional - Name of the record label. - **track[release]** (string) - Optional - Release date of the track. - **track[release_date]** (string) - Optional - Release date in ISO 8601 format. - **track[streamable]** (boolean) - Optional - Whether the track is streamable. - **track[downloadable]** (boolean) - Optional - Whether the track is downloadable. - **track[license]** (string) - Optional - License for the track (e.g., "no-rights-reserved"). - **track[commentable]** (boolean) - Optional - Whether comments are enabled for the track. - **track[isrc]** (string) - Optional - International Standard Recording Code. - **track[artwork_data]** (binary) - Optional - Artwork image file data. ### Request Example ``` track[title]=Test drum sample track[asset_data]= track[permalink]=test-drum-sample track[sharing]=private track[embeddable_by]=me track[purchase_url]=null track[description]=Public-api test sample upload track[genre]=Pop track[tag_list]=null track[label_name]=null track[release]=null track[release_date]=2021-02-18T00:00:00.000Z track[streamable]=true track[downloadable]=false track[license]=no-rights-reserved track[commentable]=true track[isrc]=null track[artwork_data]=null ``` ### Response #### Success Response (200) - **urn** (string) - URN of the uploaded track. - **title** (string) - Title of the track. - **asset_data** (binary) - The audio file data. - **permalink** (string) - Permalink for the track. - **sharing** (string) - Sharing status of the track. - **embeddable_by** (string) - Who can embed the track. - **purchase_url** (string) - URL for purchasing the track. - **description** (string) - Description of the track. - **genre** (string) - Genre of the track. - **tag_list** (string) - Comma-separated list of tags. - **label_name** (string) - Name of the record label. - **release** (string) - Release date of the track. - **release_date** (string) - Release date in ISO 8601 format. - **streamable** (boolean) - Whether the track is streamable. - **downloadable** (boolean) - Whether the track is downloadable. - **license** (string) - License for the track. - **commentable** (boolean) - Whether comments are enabled for the track. - **isrc** (string) - International Standard Recording Code. - **artwork_data** (binary) - Artwork image file data. ### Response Example ```json { "track[title]": "Test drum sample", "track[asset_data]": "", "track[permalink]": "test-drum-sample", "track[sharing]" : "private", "track[embeddable_by]" : "me", "track[purchase_url]" : null, "track[description]" : "Public-api test sample upload", "track[genre]" : "Pop", "track[tag_list]" : null, "track[label_name]" : null, "track[release]" : null, "track[release_date]" : "2021-02-18T00:00:00.000Z", "track[streamable]" : true, "track[downloadable]" : false, "track[license]" : "no-rights-reserved", "track[commentable]" : true, "track[isrc]" : null, "track[artwork_data]" : null } ``` ``` -------------------------------- ### GET /users/{user_urn}/tracks Source: https://developers.soundcloud.com/docs/api/explorer/api.json Retrieves a list of tracks uploaded by a specific user. ```APIDOC ## GET /users/{user_urn}/tracks ### Description Returns a list of user's tracks. ### Method GET ### Endpoint /users/{user_urn}/tracks ### Parameters #### Path Parameters - **user_urn** (string) - Required - The unique identifier for the user. #### Query Parameters - **access** (string) - Optional - Specifies the access level for the request. - **limit** (integer) - Optional - The maximum number of tracks to return. - **linked_partitioning** (boolean) - Optional - Enables linked partitioning for pagination. ### Response #### Success Response (200) - **Tracks** (object) - Contains the list of tracks. #### Error Responses - **401** - Unauthorized ``` -------------------------------- ### Obtain Access Token via Authorization Code Source: https://developers.soundcloud.com/docs/api/guide Use this cURL command to exchange an authorization code for an access token after a user has approved your app. Ensure all parameters, especially redirect_uri, match your app registration. ```bash # obtain the access token $ curl -X POST "https://secure.soundcloud.com/oauth/token" \ -H "accept: application/json; charset=utf-8" \ -H "Content-Type: application/x-www-form-urlencoded" \ --data-urlencode "grant_type=authorization_code" \ --data-urlencode "client_id=YOUR_CLIENT_ID" \ --data-urlencode "client_secret=YOUR_CLIENT_SECRET" \ --data-urlencode "redirect_uri=YOUR_REDIRECT_URI" \ --data-urlencode "code_verifier=YOUR_PKCE_GENERATED_CODE_VERIFIER" \ --data-urlencode "code=YOUR_CODE" ``` -------------------------------- ### GET /users/{user_urn}/playlists Source: https://developers.soundcloud.com/docs/api/explorer/api.json Retrieves a list of playlists associated with a specific user. ```APIDOC ## GET /users/{user_urn}/playlists ### Description Returns a list of user's playlists. ### Method GET ### Endpoint /users/{user_urn}/playlists ### Parameters #### Path Parameters - **user_urn** (string) - Required - The unique identifier for the user. #### Query Parameters - **access** (string) - Optional - Specifies the access level for the request. - **show_tracks** (boolean) - Optional - Indicates whether to include track information in the response. - **limit** (integer) - Optional - The maximum number of playlists to return. - **linked_partitioning** (boolean) - Optional - Enables linked partitioning for pagination. ### Response #### Success Response (200) - **Playlists** (object) - Contains the list of playlists. #### Error Responses - **401** - Unauthorized ```