【发布时间】:2019-12-01 06:00:06
【问题描述】:
我有一个大学任务,使用 Spotify API 和 Python 语言获取最近播放的歌曲。 问题是我只能得到我最近播放的歌曲。任务也是得到别人的。
到目前为止这是我的代码:
import requests
response =requests.get("https://api.spotify.com/v1/me/player/recently-played",
headers={"Content-Type":"application/json",
"Authorization":"Bearer TOKEN"})
json_response = response.json()
for i in json_response['items']:
print(i["track"]['name'])
【问题讨论】:
-
你试过什么?你看过 API 文档吗?