Skip to content

Instantly share code, notes, and snippets.

@blackjack4494
Last active November 1, 2019 06:18
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blackjack4494/20491c72e89f7040ad84b42187ec57c5 to your computer and use it in GitHub Desktop.
Save blackjack4494/20491c72e89f7040ad84b42187ec57c5 to your computer and use it in GitHub Desktop.
Research about the internal Soundcloud API. Endpoints etc.

Soundcloud API-V2

Introduction

The Soundcloud API-v2 is an internal API used by Soundcloud. It is not intended to be used by third party apps. Even though it is against their ToS to use it. They stated on twitter that is usable in third party apps without being in fear of a ban.

The base url is:

api-v2.soundcloud.com/

But before you can use any of these endpoints you need to get a client_id otherwise none of your requests will actually get a response. As for now I do not know if you can use the exact same client_id as from the public/official one.

Obtain the client_id

Obtaining the client_id is pretty much simple. You can use browser built-in developer tools or external programs like Wireshark or Fiddler (I like to use the latter one). Check the network section. You may want to filter for 'api' to find it faster. When you open the page the first time you encounter the client_id is actually this one:

https://api-v2.soundcloud.com/payments/quotations/consumer-subscription?client_id=HERE&app_version=1500036064

The length of the client_id is 32. The pattern is [0-9a-zA-Z]. As for now I also do not know if this client_id is connected to your IPv4 since I have the same client_id in different browsers and computers. Also it does not matter if you are logged in into your SC Account or not. So be careful and do not share it publicly AS FOR NOW.

Endpoints

Output format is mostly JSON.

Standard Parameters

Bold ones are necessary.
Italic ones are optional.

  • client_id - [0-9a-zA-Z]{32}
  • app_version - (int){10?}

Subscriptions

Request:

payments/quotations/consumer-subscription?client_id=CID 

Parameters:

  • None in particular

Sample Response:

{
    "plans": [{
        "id": "consumer-high-tier",
        "preselected_term": "monthly",
        "use_case": "anonymous",
        "monthly": {
            "use_case": "anonymous",
            "package": {
                "urn": "soundcloud:payments:packages:121",
                "name": "Monthly Go Plus plan",
                "vendor": "v2",
                "product": "consumer-subscription",
                "tier": "high",
                "plan": "consumer-high-tier",
                "term": "monthly",
                "price": {
                    "amount": 999,
                    "currency": "EUR"
                },
                "country": "DE"
            },
            "start_date": "2017-07-16T23:48:30Z",
            "expiry_date": "2017-08-15T23:48:30Z",
            "price": {
                "amount": 999,
                "currency": "EUR"
            },
            "discount": null,
            "prorating": null
        },
        "yearly": null,
        "trial": {
            "duration_in_days": 30
        },
        "promotion": null
    }, {
        "id": "consumer-mid-tier",
        "preselected_term": "monthly",
        "use_case": "unknown",
        "monthly": {
            "use_case": "unknown",
            "package": {
                "urn": "soundcloud:payments:packages:286",
                "name": "Monthly Go plan",
                "vendor": "v2",
                "product": "consumer-subscription",
                "tier": "mid",
                "plan": "consumer-mid-tier",
                "term": "monthly",
                "price": {
                    "amount": 599,
                    "currency": "EUR"
                },
                "country": "DE"
            },
            "start_date": "2017-07-16T23:48:30Z",
            "expiry_date": "2017-08-15T23:48:30Z",
            "price": {
                "amount": 599,
                "currency": "EUR"
            },
            "discount": null,
            "prorating": null
        },
        "yearly": null,
        "trial": {
            "duration_in_days": 7
        },
        "promotion": null
    }]
}

Returns information about paid subscriptions


Charts

Request:

/charts?kind=top&genre=soundcloud:genres:all-music&high_tier_only=false&client_id=CID&limit=10&offset=0&linked_partitioning=1&app_version=1500036064

Parameters:

  • kind - (string)
  • genre - (string)
  • high_tier_only - (bool) paid subscription (soundcloud go)
  • client_id
  • limit - (int) how many results you will have in the output
  • offset - (int) starting point
  • linked_partition - (int) actually does nothing can be omitted
  • app_version

Sample Response:
Limit was set to 1 due to too much data.

{
    "genre": "soundcloud:genres:all-music",
    "kind": "top",
    "last_updated": "2017-07-16T06:35:39Z",
    "collection": [{
        "track": {
            "artwork_url": "https://i1.sndcdn.com/artworks-000203619008-9xvrhm-large.jpg",
            "commentable": true,
            "comment_count": 713,
            "created_at": "2015-02-16T21:18:19Z",
            "description": "LINK DE DESCARGA : http://bluenik.com/13Cm\nLINK DE DESCARGA : http://bluenik.com/13Cm\n\nRedes Sociales GRACIAS POR EL APOYO\n\nInstagram - www.instagram.com/rdurbansmusic/\n\nFacebook -www.facebook.com/RDUrbansMusic/?s…_nax_wizard=true\n\nYoutube - www.youtube.com/channel/UCjpf4LqNJGaOgE8n_MVlP4g",
            "downloadable": false,
            "download_count": 100,
            "download_url": null,
            "duration": 212708,
            "full_duration": 212708,
            "embeddable_by": "all",
            "genre": "Latin",
            "has_downloads_left": false,
            "id": 191477804,
            "kind": "track",
            "label_name": null,
            "last_modified": "2017-07-16T21:40:23Z",
            "license": "all-rights-reserved",
            "likes_count": 371467,
            "permalink": "despacito-luis-fonsi-daddy-yankee",
            "permalink_url": "https://soundcloud.com/traphousemusic1/despacito-luis-fonsi-daddy-yankee",
            "playback_count": 19645686,
            "public": true,
            "publisher_metadata": {
                "id": 191477804,
                "urn": "soundcloud:tracks:191477804"
            },
            "purchase_title": "Free Download",
            "purchase_url": "http://adf.ly/1iGWYT",
            "release_date": null,
            "reposts_count": 18862,
            "secret_token": null,
            "sharing": "public",
            "state": "finished",
            "streamable": true,
            "tag_list": "RDUrbansMusic DESPACITO - Luis Fonsi Daddy ❌ Yankee",
            "title": "DESPACITO - Luis Fonsi ❌ Daddy Yankee",
            "uri": "https://api.soundcloud.com/tracks/191477804",
            "urn": "soundcloud:tracks:191477804",
            "user_id": 67807601,
            "visuals": null,
            "waveform_url": "https://wis.sndcdn.com/dxsZzMQL3TdG_m.json",
            "display_date": "2015-02-16T21:18:19Z",
            "monetization_model": "NOT_APPLICABLE",
            "policy": "ALLOW",
            "user": {
                "avatar_url": "https://i1.sndcdn.com/avatars-000293732681-g6lqcc-large.jpg",
                "first_name": "Latin Urbans",
                "full_name": "Latin Urbans Music",
                "id": 67807601,
                "kind": "user",
                "last_modified": "2017-05-24T12:50:15Z",
                "last_name": "Music",
                "permalink": "traphousemusic1",
                "permalink_url": "https://soundcloud.com/traphousemusic1",
                "uri": "https://api.soundcloud.com/users/67807601",
                "urn": "soundcloud:users:67807601",
                "username": "Trap House Music ✅",
                "verified": false,
                "city": "CALI",
                "country_code": "CO"
            }
        },
        "score": 2967404.0
    }],
    "query_urn": "soundcloud:charts:4bcde3979a7941c391b90e6902f0cfad",
    "next_href": "https://api-v2.soundcloud.com/charts?genre=soundcloud:genres:all-music&query_urn=soundcloud:charts:4bcde3979a7941c391b90e6902f0cfad&offset=1&high_tier_only=false&kind=top&limit=1"
}

Placeholder

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