SoundCloud API — LLM Context
This page provides a structured overview of the SoundCloud developer documentation for use by LLM agents and AI-assisted development tools.
For copy-paste prompt templates and example instructions to use with coding assistants, see Building with AI.
API Quick Reference
- Base URL:
https://api.soundcloud.com - Auth URL:
https://secure.soundcloud.com - Authentication: OAuth 2.1 with PKCE required
- Required header:
Authorization: OAuth ACCESS_TOKEN - Token expiry: ~1 hour (use single-use refresh tokens to renew)
- Response format: JSON
- Pagination: pass
linked_partitioning=true, follownext_hrefuntil absent - Rate limits: 15,000 play-stream requests per 24h per
client_id; no global aggregate limit currently enforced - Client Credentials token limits: 50 per 12h per app, 30 per 1h per IP — cache the access token, then renew with the refresh_token grant (not a new
client_credentialsexchange) so you stay under these limits; refresh tokens are single-use (refresh flow) - Upload source formats (examples): AIFF, WAVE, FLAC, OGG, MP2, MP3, AAC, AMR, WMA — full list, prep, and tips: Upload Requirements (applies to API and in-app uploads)
- Upload limits: up to 4 GB per file, 24 hours max duration per track (same article)
- Playback: SoundCloud transcodes uploads for streaming (e.g. AAC); lossless or high-quality masters sound best (see API Guide — Uploading Tracks)
- Interactive API explorer: Open API Explorer
- OpenAPI spec (JSON, for tools & LLMs): api.json
Authentication Flows
| Flow | Use Case | User Consent Required |
|---|---|---|
| Authorization Code + PKCE | Access user resources (upload, private content, actions on behalf) | Yes |
| Client Credentials | Access public resources (search, playback, resolve) | No |
Full details: API Guide — Authentication
Documentation Map
Guides
| Page | URL | Description |
|---|---|---|
| Get an API key | /docs/api/register-app | Create an account (Artist Pro required), register an app at soundcloud.com/you/apps/new, accept terms, obtain Client ID and Client Secret. |
| Upload Requirements (Help) | Upload Requirements | Formats, 4 GB / 24 h limits, quality guidance — applies to API uploads and in-app uploads; transcoding (e.g. AAC) for playback. |
| API Guide | /docs/api/guide | Authentication flows, track upload, playback, search, pagination, comments, follows/likes, error codes. The primary integration guide. |
| Widget API | /docs/api/html5-widget | JavaScript API for controlling embedded SoundCloud players. Parameters, methods, getters, and event types. |
| oEmbed | /docs/oembed | Endpoint for retrieving embed code for any SoundCloud URL. Supports JSON and JSONP. |
| Custom Player | /docs/custom-player | jQuery-based custom player plugin using the widget JS API for audio streaming. |
API Reference
| Page | URL | Description |
|---|---|---|
| OpenAPI specification (JSON) | api.json | Machine-readable Swagger/OpenAPI document — ideal for LLM context, codegen, and offline reference. |
| API Explorer | /docs/api/explorer/open-api | Interactive Swagger UI with the same specification for all endpoints. |
| API Reference | /docs/api/reference | Links to the Open API specification and GitHub issue tracker. |
| Rate Limits | /docs/api/rate-limits | Per-client_id rate limits, play-stream quotas, 429 error response format. |
Policy & Legal
| Page | URL | Description |
|---|---|---|
| API Terms of Use | /docs/api/terms-of-use | API usage terms: content restrictions, privacy requirements, commercial use rules, attribution, branding. |
| Privacy Policy | /docs/api/privacy | Privacy policy for developers.soundcloud.com. |
| Cookies Policy | /docs/api/cookies | Cookie usage: Twitter widget, Google Analytics, opt-out. |
| Buttons & Logos | /docs/api/buttons-logos | Attribution guidelines, logo assets, Connect with SoundCloud button. |
Common API Patterns
Get an access token (Client Credentials)
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_encoded_credentials>" \
--data-urlencode "grant_type=client_credentials"
Resolve a SoundCloud URL to an API resource
curl -X GET "https://api.soundcloud.com/resolve?url=https://soundcloud.com/USERNAME/TRACK" \
-H "Authorization: OAuth ACCESS_TOKEN"
Search tracks
curl -X GET "https://api.soundcloud.com/tracks?q=QUERY&access=playable&limit=10&linked_partitioning=true" \
-H "Authorization: OAuth ACCESS_TOKEN"
Stream a track
curl -X GET "https://api.soundcloud.com/tracks/TRACK_ID/stream" \
-H "Authorization: OAuth ACCESS_TOKEN"
Upload a track (requires Authorization Code token)
curl -X POST "https://api.soundcloud.com/tracks" \
-H "Authorization: OAuth ACCESS_TOKEN" \
-H "Content-Type: multipart/form-data" \
-F "track[title]=TITLE" \
-F "track[asset_data]=@PATH_TO_FILE"
Key Constraints
- Most API requests (except for token exchange) require an Authorization: OAuth ACCESS_TOKEN header. Requests without it return 401 Unauthorized.
- Access tokens expire after ~1 hour. Refresh tokens are single-use.
- Not all tracks are streamable. Check the
accessfield:playable,preview, orblocked. - Play-stream requests are rate-limited to 15,000 per 24h per
client_id. Exceeding returns429. - Track uploads follow SoundCloud Upload Requirements (formats, 4 GB / 24 h limits, quality guidance); audio is transcoded for streaming (e.g. AAC).
- User-scoped actions (upload, follow, like, comment) require an Authorization Code token. Public-only access can use Client Credentials.
- The API supports CORS for browser-based requests.
- Pagination: default 50 items, max 200 per page. Use
linked_partitioning=trueand follownext_href.