【问题标题】:Get list of related tracks HTTP API SoundCloud获取相关曲目列表 HTTP API SoundCloud
【发布时间】:2016-02-07 09:00:33
【问题描述】:

我在 HTTP API 文档中找不到任何合适的内容。
据我所知,当前曲目完成后,SC小部件中会弹出一些曲目,因此SC本身有一些相关的曲目功能,但我们可以通过API访问它吗?
即获取与给定曲目 ID 相关的曲目列表。

【问题讨论】:

    标签: soundcloud


    【解决方案1】:

    免责声明:这是一个未记录的端点,SoundCloud 可能随时更改。

    有一个未记录的端点允许您访问曲目的相关声音:

    HTTP GET: https://api.soundcloud.com/tracks/[TRACK_ID]/related?client_id=[YOUR_CLIENT_ID]
    

    您没有指定语言,所以我将简要介绍如何使用端点。

    首先,获取您的曲目 URL。我以这个为例:https://soundcloud.com/msmrsounds/ms-mr-hurricane-chvrches-remix

    然后点击resolve端点获取track_id。

    HTTP GET: https://api.soundcloud.com/resolve.json?url=https%3A%2F%2Fsoundcloud.com%2Fmsmrsounds%2Fms-mr-hurricane-chvrches-remix&client_id=[YOUR_CLIENT_ID]
    

    回复:

    {
      "status": "302 - Found",
      "location": "https://api.soundcloud.com/tracks/90787841.json?client_id=[YOUR_CLIENT_ID]"
    }
    

    接下来,使用您的track_id 访问related 端点。

    HTTP GET: https://api.soundcloud.com/tracks/90787841/related?client_id=[YOUR_ClIENT_ID]
    

    完整的回复将为您提供多达 50 条相关曲目。响应太大,无法发布,但它只是一组曲目。

    [
      {
        "kind": "track",
        "id": 112741336,
        "created_at": "2013/09/27 09:40:29 +0000",
        "user_id": 59817646,
        "duration": 215896,
        "commentable": true,
        "state": "finished",
        "original_content_size": 38068298,
        "last_modified": "2015/04/04 20:17:24 +0000",
        "sharing": "public",
        "tag_list": "CHVRCHES Whitney Houston Zane Lowe",
        "permalink": "chvrches-its-not-right-but-its",
        "streamable": true,
        "embeddable_by": "all",
        "downloadable": false,
        "purchase_url": null,
        "label_id": null,
        "purchase_title": null,
        "genre": "Electronic",
        "title": "CHVRCHES - It's Not Right But It's Okay (Whitney Houston Cover)",
        "description": "CHVRCHES - It's Not Right But It's OK (Whitney Houston Cover) from Zane's Live Sessions",
        "label_name": "",
        "release": "",
        "track_type": "recording",
        "key_signature": "",
        "isrc": "",
        "video_url": null,
        "bpm": null,
        "release_year": null,
        "release_month": null,
        "release_day": null,
        "original_format": "wav",
        "license": "all-rights-reserved",
        "uri": "https://api.soundcloud.com/tracks/112741336",
        "user": {
          "id": 59817646,
          "kind": "user",
          "permalink": "uknewmusic",
          "username": "UKNewMusic",
          "last_modified": "2013/09/27 09:38:04 +0000",
          "uri": "https://api.soundcloud.com/users/59817646",
          "permalink_url": "http://soundcloud.com/uknewmusic",
          "avatar_url": "https://a1.sndcdn.com/images/default_avatar_large.png"
        },
        "permalink_url": "http://soundcloud.com/uknewmusic/chvrches-its-not-right-but-its",
        "artwork_url": "https://i1.sndcdn.com/artworks-000058757165-6tnuep-large.jpg",
        "waveform_url": "https://w1.sndcdn.com/XkEffI5hwjZ7_m.png",
        "stream_url": "https://api.soundcloud.com/tracks/112741336/stream",
        "playback_count": 680326,
        "download_count": 0,
        "favoritings_count": 9241,
        "comment_count": 199,
        "attachments_uri": "https://api.soundcloud.com/tracks/112741336/attachments",
        "policy": "ALLOW"
      },
      { ...
      }
    ]
    

    【讨论】:

    • 我没有指定语言,因为我真诚地期待快速而懒惰的答案(这很好)。语言是 JavaScript,我已经在我的代码中使用了路由 url->resolve->其他东西,因此,知道这个端点,休息对我来说一定很容易。谢谢。我想知道为什么它没有记录,你不知道吗?
    • @MaxYari 不确定为什么不公开,可能有很多原因只有 SoundCloud 的内部人员知道。
    • 是的,再次感谢,尚未对此进行测试,但我看不出它为什么不起作用,标记
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多