Skip to content

Instantly share code, notes, and snippets.

@JBou
Last active January 14, 2024 07:33
Show Gist options
  • Star 26 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save JBou/0538a57df21a2b3479c152ab7d4601e7 to your computer and use it in GitHub Desktop.
Save JBou/0538a57df21a2b3479c152ab7d4601e7 to your computer and use it in GitHub Desktop.
SoundCloud API Endpoints
//Authorization
{ ApiCommand.AuthorizationCodeFlow, new Uri("https://soundcloud.com/connect?scope=non-expiring&client_id={0}&response_type={1}&redirect_uri={2}") },
{ ApiCommand.UserAgentFlow, new Uri("https://soundcloud.com/connect?client_id={0}&response_type=token&redirect_uri={1}") },
{ ApiCommand.UserCredentialsFlow, new Uri("https://api.soundcloud.com/oauth2/token?client_id={0}&client_secret={1}&grant_type=password&username={2}&password={3}") },
{ ApiCommand.RefreshToken, new Uri("https://api.soundcloud.com/oauth2/token?client_id={0}&client_secret={1}&grant_type=refresh_token&refresh_token={2}") },
//Me
{ ApiCommand.Me, new Uri("https://api.soundcloud.com/me.json") },
{ ApiCommand.MeTracks, new Uri("https://api.soundcloud.com/me/tracks.json") },
{ ApiCommand.MeComments, new Uri("https://api.soundcloud.com/me/comments.json") },
{ ApiCommand.MeFollowings, new Uri("https://api.soundcloud.com/me/followings.json") },
{ ApiCommand.MeFollowingsContact, new Uri("https://api.soundcloud.com/me/followings/{0}.json") },
{ ApiCommand.MeFollowers, new Uri("https://api.soundcloud.com/me/followers.json") },
{ ApiCommand.MeFollowersContact, new Uri("https://api.soundcloud.com/me/followers/{0}.json") },
{ ApiCommand.MeFavorites, new Uri("https://api.soundcloud.com/me/favorites.json") },
{ ApiCommand.MeFavoritesTrack, new Uri("https://api.soundcloud.com/me/favorites/{0}.json") },
{ ApiCommand.MeGroups, new Uri("https://api.soundcloud.com/me/groups.json") },
{ ApiCommand.MePlaylists, new Uri("https://api.soundcloud.com/me/playlists.json") },
{ ApiCommand.MeConnections, new Uri("https://api.soundcloud.com/me/connections.json") },
//Users
{ ApiCommand.Users, new Uri("https://api.soundcloud.com/users.json") },
{ ApiCommand.User, new Uri("https://api.soundcloud.com/users/{0}.json") },
{ ApiCommand.UserTracks, new Uri("https://api.soundcloud.com/users/{0}/tracks.json") },
{ ApiCommand.UserComments, new Uri("https://api.soundcloud.com/users/{0}/comments.json") },
{ ApiCommand.UserFollowings, new Uri("https://api.soundcloud.com/users/{0}/followings.json") },
{ ApiCommand.UserFollowingsContact, new Uri("https://api.soundcloud.com/users/{0}/followings/{contact_id}.json") },
{ ApiCommand.UserFollowers, new Uri("https://api.soundcloud.com/users/{0}/followers.json") },
{ ApiCommand.UserFollowersContact, new Uri("https://api.soundcloud.com/users/{0}/followers/{1}.json?consumer_key={2}") },
{ ApiCommand.UserFavorites, new Uri("https://api.soundcloud.com/users/{0}/favorites.json?linked_partitioning=1") },
{ ApiCommand.UserFavoritesTrack, new Uri("https://api.soundcloud.com/users/{0}/favorites/{1}.json") },
{ ApiCommand.UserGroups, new Uri("https://api.soundcloud.com/users/{0}/groups.json") },
{ ApiCommand.UserPlaylists, new Uri("https://api.soundcloud.com/users/{0}/playlists.json?linked_partitioning=1") },
//Tracks
{ ApiCommand.Tracks, new Uri("https://api.soundcloud.com/tracks.json") },
{ ApiCommand.Track, new Uri("https://api.soundcloud.com/tracks/{0}.json") },
{ ApiCommand.TrackComments, new Uri("https://api.soundcloud.com/tracks/{0}/comments.json") },
{ ApiCommand.TrackPermissions, new Uri("https://api.soundcloud.com/tracks/{0}/permissions.json") },
{ ApiCommand.TrackSecretToken, new Uri("https://api.soundcloud.com/tracks/{0}/secret-token.json") },
{ ApiCommand.TrackShare, new Uri("https://api.soundcloud.com/tracks/{0}/shared-to/connections") },
//Comments
{ ApiCommand.Comment, new Uri("https://api.soundcloud.com/comments/{0}.json") },
//Groups
{ ApiCommand.Groups, new Uri("https://api.soundcloud.com/groups.json") },
{ ApiCommand.Group, new Uri("https://api.soundcloud.com/groups/{0}.json") },
{ ApiCommand.GroupUsers, new Uri("https://api.soundcloud.com/groups/{0}/users.json") },
{ ApiCommand.GroupModerators, new Uri("https://api.soundcloud.com/groups/{0}/moderators.json") },
{ ApiCommand.GroupMembers, new Uri("https://api.soundcloud.com/groups/{0}/members.json") },
{ ApiCommand.GroupContributors, new Uri("https://api.soundcloud.com/groups/{0}/contributors.json") },
{ ApiCommand.GroupTracks, new Uri("https://api.soundcloud.com/groups/{0}/tracks.json") },
//Playlists
{ ApiCommand.Playlists, new Uri("https://api.soundcloud.com/playlists.json") },
{ ApiCommand.Playlist, new Uri("https://api.soundcloud.com/playlists/{0}.json") },
//Resolver
{ ApiCommand.Resolve, new Uri("https://api.soundcloud.com/resolve.json?url={0}") },
Soundcloud API V2
====================================================
Get likes and playlists (private & public and all own and liked) without tracklist (oauth needed)
https://api-v2.soundcloud.com/users/23667548/playlists/liked_and_owned?limit=12&client_id=fDoItMDbsbZz8dY16ZzARCZmzgHBPotA&app_version=1484833232&oauth_token=
Get only playlist ids: (I think they don't include private playlists) (oauth needed)
https://api-v2.soundcloud.com/me/playlist_likes/ids?limit=5000&linked_partitioning=1&client_id=fDoItMDbsbZz8dY16ZzARCZmzgHBPotA&app_version=1484833232&oauth_token=
Get playlist by id (followed by the previous request)
https://api-v2.soundcloud.com/playlists/272857198?representation=full&client_id=fDoItMDbsbZz8dY16ZzARCZmzgHBPotA&app_version=1484833232
Get stream from homepage (oauth needed):
https://api-v2.soundcloud.com/stream?promoted_playlist=true&client_id=fDoItMDbsbZz8dY16ZzARCZmzgHBPotA&limit=10&offset=0&linked_partitioning=1&app_version=1484833232&oauth_token=
Get stream (oauth needed):
https://api.soundcloud.com/e1/me/stream?limit=10&offset=0&linked_partitioning=1&client_id=fDoItMDbsbZz8dY16ZzARCZmzgHBPotA&oauth_token=
Get play-history tracks (right side homepage):
https://api-v2.soundcloud.com/me/play-history/tracks
Get all track likes (right side homepage):
https://api-v2.soundcloud.com/users/23667548/track_likes
Get who to follow (right side homepage):
https://api-v2.soundcloud.com/me/suggested/users/who_to_follow?view=recommended-first
User total plays:
https://api-v2.soundcloud.com/users/soundcloud:users:23667548/stats/totals/plays
Comments:
https://api.soundcloud.com/app/v2/tracks/302492774/comments?filter_replies=1&limit=200&offset=0&linked_partitioning=1
Liked Playlists:
https://api.soundcloud.com/e1/users/23667548/playlist_likes
Playlists:
https://api.soundcloud.com/users/gabrielpatzleiner/playlists
Playlist:
https://api.soundcloud.com/playlists/26704712.json
Get multiple tracks by id
http://api.soundcloud.com/tracks?ids=123,234,765,456,etc
Soundcloud App.js V2 endpoints taken from https://gist.github.com/JBou/9ed3ee830e04387811bc48fbcadc04fd
===============================================================
announcement: [i, a, "announcements/:id"],
announcements: [i, a, "announcements"],
app: [i, a, "app/:id"],
appV2TrackComments: [i, a, "app/v2/tracks/:id/comments"],
audioAd: [i, l, "audio-ad"],
charts: [i, l, "charts"],
checkIdentifier: [i, u, "identifier", {
q: null
}],
collectionPlaylists: [i, l, "users/:id/playlists/liked_and_owned"],
comment: [i, l, "comments/:id"],
developerApps: [i, l, "apps"],
playlistLikesIds: [i, l, "me/playlist_likes/ids"],
playlistLikesCreate: [o, l, "users/:userId/playlist_likes/:id"],
playlistLikesDelete: [s, l, "users/:userId/playlist_likes/:id"],
playlistRepostsIds: [i, a, "e1/me/playlist_reposts/ids"],
playlistRepostsCreate: [o, a, "e1/me/playlist_reposts/:id"],
playlistRepostsDelete: [s, a, "e1/me/playlist_reposts/:id"],
soundLikesIds: [i, a, "e1/me/track_likes/ids"],
soundLikesCreate: [o, l, "users/:userId/track_likes/:id"],
soundLikesDelete: [s, l, "users/:userId/track_likes/:id"],
edgePlaylistCategory: [i, a, "e1/playlists/:id/:category"],
edgeTrackCategory: [i, a, "e1/tracks/:id/:category"],
soundReposters: [i, l, "tracks/:id/reposters"],
soundRepostsIds: [i, a, "e1/me/track_reposts/ids"],
soundRepostsCreate: [o, a, "e1/me/track_reposts/:id"],
soundRepostsDelete: [s, a, "e1/me/track_reposts/:id"],
featuredProfiles: [i, l, "users/:id/featured-profiles"],
feedPlaylistUpdate: [o, l, "feed-playlists/:id"],
feedTrackUpdate: [o, l, "feed-tracks/:urn"],
me: [i, l, "me"],
meConnections: [i, a, "me/connections"],
meRightsholders: [i, l, "me/rightsholders"],
meUpdate: [o, l, "me"],
myActivitiesTracks: [i, a, "me/activities/tracks"],
myConnection: [i, a, "me/connections/:id"],
myFollowersIds: [i, l, "me/followers/ids"],
myFollowingsIds: [i, l, "users/:userId/followings/ids"],
myFollowingsCreate: [r, l, "me/followings/:id"],
myFollowingsDelete: [s, l, "me/followings/:id"],
mySuggestedUsers: [i, l, "me/suggested/users/:category"],
newForYou: [i, l, "me/new-for-you"],
onboardingTrackRecommendations: [i, l, "onboarding/tracks/recommendations"],
oscpStatus: [i, l, "oscp/status"],
oscpUserCreate: [r, l, "oscp/user_info"],
oscpPayoutCreate: [r, l, "oscp/payout"],
oscpAvailableContract: [i, l, "oscp/contracts/available/:variant"],
oscpActiveContract: [i, l, "oscp/contracts/active/:id"],
oscpContractSign: [r, l, "oscp/contracts/sign/:variant"],
paymentCheckout: [i, l, "payments/checkout"],
paymentCheckoutItem: [i, l, "payments/checkout/:id"],
paymentOrders: [i, l, "payments/orders/:type"],
paymentQuotations: [i, l, "payments/quotations/:category"],
paymentQuotationsCode: [i, l, "payments/quotations/code/:id"],
paymentsConsumerSubscriptionsActive: [i, l, "payments/consumer-subscriptions/active"],
paymentsSubscriptionsActive: [i, l, "payments/subscriptions/active"],
personalizedTracks: [i, l, "me/personalized-tracks"],
playHistoryTracks: [i, l, "me/play-history/tracks"],
playHistoryContexts: [i, l, "me/play-history/contexts"],
playHistoryAdd: [r, l, "me/play-history"],
playHistoryClear: [s, l, "me/play-history"],
playlist: [i, l, "playlists/:id"],
playlistUpdate: [o, l, "playlists/:id"],
playlistArtworkUpdate: [o, a, "playlists/:id"],
playlistDelete: [s, a, "playlists/:id"],
playlistCategory: [i, l, "playlists/:id/:category"],
playlistCreate: [r, l, "playlists"],
playlistDiscovery: [i, l, "playlists/discovery"],
playlistsForTrack: [i, l, "tracks/:trackId/playlists"],
playlistsWithoutAlbumsForTrack: [i, l, "tracks/:trackId/playlists_without_albums"],
albumsForTrack: [i, l, "tracks/:trackId/albums"],
promotedSearch: [i, l, "promoted/search"],
promotedUploadTakeover: [i, l, "promoted/upload-takeover"],
promotedUploadText: [i, l, "promoted/upload-text"],
promotedUsers: [i, l, "promoted/users"],
recommendedStations: [i, l, "stations/:type"],
relatedSounds: [i, l, "tracks/:track_id/related"],
reportCopyrightInfringement: [r, l, "copyright_reports"],
resetPassword: [r, l, "users/password_reset", {
email: null
}],
resolve: [i, l, "resolve", {
url: ""
}],
search: [i, l, "search"],
searchQueries: [i, l, "search/queries"],
searchCategory: [i, l, "search/:category"],
searchSounds: [i, a, "search/sounds"],
searchSuggestTags: [i, a, "search/suggest/tags"],
shortcutsFollowings: [i, l, "me/shortcuts/followings"],
shortcutsTrackLikes: [i, l, "me/shortcuts/track-likes"],
signinWithFacebook: [r, u, "sign-in/facebook"],
signinWithGoogle: [r, u, "sign-in/google"],
signinWithPassword: [r, u, "sign-in/password"],
signupWithEmail: [r, u, "sign-up/email"],
signupWithEmailToken: [r, u, "sign-up/email/token"],
signupWithFacebook: [r, u, "sign-up/facebook"],
signupWithGoogle: [r, u, "sign-up/google"],
station: [i, l, "stations/:urn"],
stationBatch: [i, l, "stations", {
urns: null
}],
stationTracks: [i, l, "stations/:urn/tracks"],
likedStations: [i, l, "stations/liked"],
likedStationIds: [i, l, "stations/liked/ids"],
likeStation: [o, l, "stations/liked/:id"],
unlikeStation: [s, l, "stations/liked/:id"],
staticPage: [i, d, ":pageName.html"],
stream: [i, l, "stream"],
streamNotifications: [i, l, "stream/notifications"],
streamUserProfile: [i, l, "stream/users/:id"],
streamUserReposts: [i, l, "stream/users/:id/reposts"],
tagsSuggested: [i, l, "tags/suggested/:urn"],
tagsSuggestedCategory: [i, l, "tags/suggested/:category/:urn"],
territoriesWhichRequireExplicitRightsholder: [i, l, "tracks/explicit-rightsholder-required-in"],
timeseriesTrack: [i, l, "users/:user_id/tracks/:track_id/stats/timeseries/:metric"],
timeseriesUser: [i, l, "users/:user_id/stats/timeseries/:metric"],
track: [i, l, "tracks/:urn"],
trackAsOwner: [i, l, "tracks/:urn", {
representation: "owner"
}],
trackBatch: [i, l, "tracks"],
trackCategory: [i, l, "tracks/:id/:category"],
trackCreate: [i, l, "tracks"],
trackComments: [i, l, "tracks/:id/comments"],
trackDelete: [s, l, "tracks/:id"],
trackImageUpdate: [o, a, "tracks/:id"],
trackPatchUpdate: [o, a, "tracks/:id"],
trackPermalinkAvailability: [i, l, "track_permalink_availability", {
permalink: null
}],
trackStreams: [i, a, "i1/tracks/:id/streams"],
trackUpdate: [i, l, "tracks/:urn"],
trinityPublish: [i, a, "tpub/publish"],
trinitySubscribe: [i, a, "tsub/subscribe"],
user: [i, a, "users/:id"],
userAlbums: [i, l, "users/:id/albums"],
userAsOwner: [i, l, "users/:urn", {
representation: "owner"
}],
userComments: [i, a, "users/:id/comments"],
userDelete: [r, l, "users/:urn/deletion"],
userEmailCreate: [r, l, "users/:user_id/emails"],
userEmailDelete: [s, l, "users/:user_id/emails/:id"],
userEmailResendConfirmation: [r, l, "users/:user_id/emails/:id/confirmation"],
userEmailUpdate: [o, l, "users/:user_id/emails/:id"],
userEmails: [i, l, "users/:id/emails"],
userFollowers: [i, l, "users/:id/followers"],
userFollowersFollowedBy: [i, l, "users/:id/followers/followed_by/:followed_by"],
userFollowings: [i, l, "users/:id/followings"],
userFollowingsNotFollowedBy: [i, l, "users/:id/followings/not_followed_by/:not_followed_by"],
userImageUpdate: [o, a, "users/:id"],
userLikes: [i, l, "users/:id/likes"],
userTrackLikes: [i, l, "users/:id/track_likes"],
userNotificationsPreferences: [i, l, "users/:id/notifications/preferences"],
userPlaylists: [i, l, "users/:id/playlists"],
userPlaylistsWithoutAlbums: [i, l, "users/:id/playlists_without_albums"],
userResetPassword: [r, l, "users/:id/password_reset"],
userSettings: [i, l, "users/:id/settings"],
userSpotlight: [i, l, "users/:id/spotlight"],
userTracks: [i, l, "users/:id/tracks"],
userWebProfiles: [i, l, "users/:urn/web-profiles"],
userWebProfilesUpdate: [r, l, "users/:urn/web-profiles"],
visuals: [i, c, "visuals"],
userBlockingsIds: [i, a, "me/mutings/users/ids"],
userBlockingsDelete: [s, a, "me/mutings/users/:id"],
userBlockingsCreate: [r, a, "me/blockings", {
user_id: null,
reported: null,
remove_activities: null
}]
@shillshocked
Copy link

Any idea how to modify the playlist permalink in V2? I know the command for V1 but somehow it doesn't work for me. I'm guessing the V1 command is no longer used?

@JBou
Copy link
Author

JBou commented Apr 24, 2021

I just debugged the request using chrome's dev tools. Seems like you have to send a PUT request to the following url (replace the playlist-id and api key): https://api-v2.soundcloud.com/playlists/playlistid?client_id=123456789&app_version=1619164206&app_locale=en
with the following payload:

{
  "playlist": {
    "artwork_url": null,
    "created_at": "2016-12-27T14:26:53Z",
    "duration": 225118,
    "id": 286853773,
    "kind": "playlist",
    "last_modified": "2017-06-24T17:16:56Z",
    "likes_count": 1,
    "managed_by_feeds": false,
    "permalink": "test",
    "permalink_url": "https://soundcloud.com/gabrielpatzleiner/sets/test2",
    "public": true,
    "reposts_count": 0,
    "secret_token": "s-abcd",
    "sharing": "public",
    "title": "Test",
    "track_count": 1,
    "uri": "https://api.soundcloud.com/playlists/286853773",
    "user_id": 23667548,
    "set_type": null,
    "is_album": false,
    "published_at": "2017-06-24T17:16:56Z",
    "display_date": "2017-06-24T17:16:56Z",
    "user": {
      "avatar_url": "https://i1.sndcdn.com/avatars-000130283698-nicyf2-large.jpg",
      "first_name": "Gabriel",
      "followers_count": 44,
      "full_name": "Gabriel Patzleiner",
      "id": 23667548,
      "kind": "user",
      "last_modified": "2018-01-27T16:10:02Z",
      "last_name": "Patzleiner",
      "permalink": "gabrielpatzleiner",
      "permalink_url": "https://soundcloud.com/gabrielpatzleiner",
      "uri": "https://api.soundcloud.com/users/23667548",
      "urn": "soundcloud:users:23667548",
      "username": "Gabriel Patzleiner",
      "verified": false,
      "city": "",
      "country_code": null,
      "badges": {
        "pro": false,
        "pro_unlimited": false,
        "verified": false
      }
    },
    "description": "",
    "embeddable_by": "all",
    "genre": "",
    "label_name": "",
    "license": "all-rights-reserved",
    "purchase_title": null,
    "purchase_url": null,
    "release_date": null,
    "tag_list": "",
    "tracks": [
      301577744
    ],
    "caption": "",
    "ean": null,
    "release": null,
    "_resource_id": 286853773,
    "_resource_type": "playlist"
  }
}

As you can see, the permalink is test (new) but the permalink_url is still test2 (old). In the response the permalink is changed to test (new). The soundcloud website sends all of the information, maybe it's enough to just send the properties you want to change. Otherwise you have to request the playlist-data, change the permalink and send the whole data as PUT request to the server, it should work like this. But as I haven't used this API since 4 years, I haven't tested and don't know what has changed. Good luck 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment