艺术家信息未从Spotify api获得

问题描述 投票:1回答:1

艺术家个人资料信息未从api获取。我正在呼叫这个网址url =https://api.spotify.com/v1/artists/**** 7vxl9s3awf7hz4rr

端点:

`GET / v1 / artists / {id}

范围:

根据开发文档不是必需的。

复制步骤:验证用户-获取Oauth令牌呼叫GET / v1 / me-获取用户信息(ID,显示名称等)CALL GET / v1 / artists / {id}-获取艺术家信息。


预期的行为:如`[https://developer.spotify.com/console/get-artist/?id= {id}

所述的艺术家对象。

实际行为:响应{协议= h2,代码= 400,消息=,网址=https://api.spotify.com/v1/artists/**** 7vxl9s3awf7hz4rr *****}

响应正文-{“错误”:{“状态”:400,“消息”:“无效ID”}}

]

问题-如何从Spotify API获取艺术家信息?

spotify spotify-app
1个回答
0
投票

似乎您提供了无效的ID,请重试; 2NjfBq1NflQcKSeiDooVjYSpotify url

我的请求看起来像;

https://api.spotify.com/v1/artists/2NjfBq1NflQcKSeiDooVjY/
Authorization: Bearer BQALTehwAKhulaE2....

结果

{
  "external_urls": {
    "spotify": "https://open.spotify.com/artist/2NjfBq1NflQcKSeiDooVjY"
  },
  "followers": {
    "href": null,
    "total": 666407
  },
  "genres": [
    "australian pop"
  ],
  "href": "https://api.spotify.com/v1/artists/2NjfBq1NflQcKSeiDooVjY",
  "id": "2NjfBq1NflQcKSeiDooVjY",
  "images": [
    {
      "height": 640,
      "url": "https://i.scdn.co/image/126ef4c0fdd052674d30fe0f3610a11f63f0de21",
      "width": 640
    },
    {
      "height": 320,
      "url": "https://i.scdn.co/image/40bc22651744446f704a06fa6febdb4e3ecd5e5b",
      "width": 320
    },
    {
      "height": 160,
      "url": "https://i.scdn.co/image/638ecc16441c0e093b2672e896978f1d9f53c269",
      "width": 160
    }
  ],
  "name": "Tones and I",
  "popularity": 92,
  "type": "artist",
  "uri": "spotify:artist:2NjfBq1NflQcKSeiDooVjY"
}
© www.soinside.com 2019 - 2024. All rights reserved.