Developers searching for a SoundCloud API usually want a public artist and that artist's tracks as JSON. SocialScrape has those reads. They are not SoundCloud's developer API, and they do not give you a SoundCloud client secret. You call them with a SocialScrape key in x-api-key. The routes are in beta. See authentication.
Artist#
GET /v1/soundcloud/artist takes url or handle. One of them. url is soundcloud.com/<user>. handle is the username, with or without @. username is an alias. The description says followers, track count, bio, location, avatar, banner and the social links the artist lists.
The recorded request uses a handle.
curl -G "https://api.socialscrape.io/v1/soundcloud/artist" \
-H "x-api-key: $SOCIALSCRAPE_API_KEY" \
--data-urlencode "handle=flume"import os
import requests
params = {
"handle": "flume",
}
res = requests.get(
"https://api.socialscrape.io/v1/soundcloud/artist",
headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},
params=params,
)
body = res.json()
if body["ok"]:
print(body["data"])
else:
print(body["error"]["code"], body["error"]["message"])const url = new URL("https://api.socialscrape.io/v1/soundcloud/artist");
url.search = new URLSearchParams({
"handle": "flume"
}).toString();
const res = await fetch(url, {
headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },
});
const body = await res.json();
if (body.ok) {
console.log(body.data);
} else {
console.error(body.error.code, body.error.message);
}data is a profile. platform is soundcloud. You get id, handle, name, bio, avatar_url, banner_url, url, verified, is_private, external_url, links and location. links is where listed social URLs land. stats.followers, stats.following and stats.posts are the public counts (posts is the track count on this profile). stats.likes is present when the artist page has a like total. stats.views is null when it is not a profile field.
extra on the recorded artist includes city, country_code, playlist_count, comments_count, urn, badges, station_permalink and last_modified. Use extra.urn if you store SoundCloud's own id alongside data.id. Country is extra.country_code, and city is extra.city, which may be more specific than location.
Errors are invalid_params, unsupported_url and not_found.
Sample. The recording is shortened. Counts in it belong to the sample.
Tracks#
GET /v1/soundcloud/artist/tracks lists public tracks, newest first, up to 20 a page. The same url or handle one-of applies. Private or blocked tracks are left out, so a page can be shorter than 20. parent is the artist. Pass cursor back until it is null.
curl -G "https://api.socialscrape.io/v1/soundcloud/artist/tracks" \
-H "x-api-key: $SOCIALSCRAPE_API_KEY" \
--data-urlencode "handle=flume"import os
import requests
params = {
"handle": "flume",
}
res = requests.get(
"https://api.socialscrape.io/v1/soundcloud/artist/tracks",
headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},
params=params,
)
body = res.json()
if body["ok"]:
print(body["data"])
else:
print(body["error"]["code"], body["error"]["message"])const url = new URL("https://api.socialscrape.io/v1/soundcloud/artist/tracks");
url.search = new URLSearchParams({
"handle": "flume"
}).toString();
const res = await fetch(url, {
headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },
});
const body = await res.json();
if (body.ok) {
console.log(body.data);
} else {
console.error(body.error.code, body.error.message);
}Each item is a song, not a social post. Fields: id, url, title, artists, duration_seconds, cover_url, preview_url, released_at, isrc, explicit, stats. stats.plays is the play count. stats.likes is the like count. stats.uses is null when unused. Comment count is extra.comment_count. Genre, license, label and waveform are in extra: genre, license, label_name, waveform_url, downloadable, download_count, streamable, reposts_count, urn. downloadable is a boolean the track page exposes. It is not a file hosted by SocialScrape. If you need the bytes, this API is the wrong tool.
has_more and cursor work as on other lists. A null cursor means stop. Each page is 1 credit. See pagination.
One track#
GET /v1/soundcloud/track requires url, a soundcloud.com/<user>/<track> link. There is no handle parameter on this route. The description says title, artist, duration, play, like and comment counts, genre, license, ISRC and release date. That maps to title, artists, duration_seconds, stats.plays, stats.likes, extra.comment_count, extra.genre, extra.license, isrc and released_at.
The recorded URL is a public track. One successful call is 1 credit.
Cost#
Artist, each page of tracks, and one track are 1 credit each when they succeed. All three are cacheable for 30 days. max_age_days (0 to 30) serves a cached copy for 0 credits. Failures cost 0. The signup grant is 100 credits, once, with no card. See pricing and credits.
Limits#
Public tracks only. A short page can mean blocked or private tracks were skipped, not that the artist has few songs. Play count is stats.plays. Do not add extra.download_count into plays. preview_url may be null. This response does not include the full audio.
Search across SoundCloud by keyword is not these three routes. If you have a name and no URL, you need the handle or the artist URL from somewhere else before you call them.
not_found and unsupported_url are final. rate_limited waits on retry-after. Free credits are 30 requests a minute per team. See rate limits and errors.
The API is in early access. These routes are beta.
Next#
Artist: SoundCloud artist API, tutorial, reference. Tracks: artist tracks API and reference. One track: SoundCloud track API, tutorial, reference. The hub is the SoundCloud API.
A different music catalog, keyed by Spotify ids rather than handles, is Spotify artist and search data.