搜索是否已有答案:否
\n1. 总结问题
\nSpotify 引入了获取有关播客和节目信息的功能。详细信息请参见此处。
\n我正在使用 Python“requests”包生成请求 URL,以获取 no_of_followers 等指标(我不确定它们是否可用于播客),所以我尝试获取节目的元数据。
\n我用来获取有关节目信息的端点:GET https://api.spotify.com/v1/shows/{id}
headers = {\n "Authorization": f"Bearer {access_token}"\n}\n# endpoint used "https://api.spotify.com/v1/shows/{id}"\n\nlookup_url = "https://api.spotify.com/v1/shows/3IM0lmZxpFAY7CwMuv9H4g" #"The Daily" podcast example\nprint(lookup_url)\n\nr = requests.get(lookup_url, headers=headers)\nprint(r)\nprint(r.status_code)\nprint(r.json())\nRun Code Online (Sandbox Code Playgroud)\n但是我收到以下错误响应:
\nhttps://api.spotify.com/v1/shows/3IM0lmZxpFAY7CwMuv9H4g\n<Response [404]>\n404\n{\'error\': {\'status\': 404, \'message\': \'non existing id\'}}\nRun Code Online (Sandbox Code Playgroud)\n问题在最后
\n2. 描述您\xe2\x80\x99尝试过的内容
\n我尝试使用搜索端点提取类似的信息,在那里,我确实得到了有效的响应。搜索艺术家时信息丰富且符合预期,但我搜索的展览的响应数据似乎缺失。
\n我用来搜索演出/艺术家的端点:GET https://api.spotify.com/v1/search
使用搜索端点查找有关演出/艺术家的信息:
\nheaders = {\n "Authorization": f"Bearer {access_token}"\n}\nendpoint = "https://api.spotify.com/v1/search"\ndata = urlencode({"q":"the daily","type":"show"})\n# data = urlencode({"q":"drake","type":"artist"})\n\nlookup_url = f"{endpoint}?{data}"\nprint(lookup_url)\n\nr = requests.get(lookup_url, …Run Code Online (Sandbox Code Playgroud)