指南
Spotify 播放次数 API:按 ID 或 ISRC 获取任意歌曲的累计播放次数
Spotify 的 Web API 从不说明一首歌曲被播放过多少次。最接近的是 popularity,一个 0–100 的分数,其官方参考文档称它主要基于总播放次数,并将其标记为已弃用。这些端点直接返回播放次数本身:按 Spotify ID 或 ISRC 查询一首歌曲,或一次调用最多查询 50 首歌曲。
作者:Eduardo Airaudo,API 维护者 · 更新于 2026年10月22日
官方歌曲对象缺了什么
Spotify Web API 的 GET /v1/tracks/{id} 返回专辑、艺人、duration_ms、explicit、external_ids、名称、popularity 以及其他一些字段。其中没有一个统计播放次数。最接近的是 popularity:Spotify 的参考文档将它定义为 0 到 100 的值,主要根据歌曲的播放次数及播放的新近程度计算,并标记为已弃用。Spotify 2026 年 2 月的变更,已对 2026 年 2 月 11 日起创建的开发模式应用移除了它。
分数做不到播放次数能做的事。它是相对值,因此无法在专辑或曲库层面累加,而且偏向近期播放——同一份参考文档说,现在被大量播放的歌曲得分高于过去被大量播放的歌曲——所以它无法说明一首歌曲总共被播放过多少次。
按规范的原话,本 API 的 Partner 分组是“Spotify's internal (pathfinder) data, including play counts”。 /partner/track/count 返回一首歌曲的累计播放次数,/partner/tracks/count 一次最多返回 50 首歌曲的播放次数,/partner/track 则把它包含在完整的歌曲记录里。
返回什么
逐个字段说明,依据规范中的响应模式。单曲调用把播放次数命名为 streams;批量调用命名为 playcount。
单首歌曲
GET /partner/track/count
- streams
- 累计播放次数,整数(int64)。规范中可为空,不足 1,000 次播放的歌曲为 0。
- spotify_track_id
- 歌曲的 Spotify ID。
- isrc
- 歌曲的 ISRC。规范中可为空。
- result
success或error,旁边附有简短的message。
批量
GET /partner/tracks/count
- tracks[]
- 每个请求的 ID 对应一项,按请求顺序排列。
- tracks[].playcount
- 累计播放次数(int64,可为空);不足 1,000 次的歌曲为 0。
- tracks[].status
ok、not_found或error;状态为error时附有error文本。- tracks[].name
- 歌曲名称;未找到时为
null。 - tracks[].artists[]
- 每位艺人的
id和name。 - tracks[].releaseDate
- 歌曲所属专辑的发行日期:YYYY-MM-DD,或精度较粗的格式。
- missing[]
- 状态不是
ok的请求 ID。
0 表示不足 1,000,而不是从未播放。 规范指出,Spotify 对播放次数不足 1,000 的歌曲报告 0,所以请把 0 存为“低于 1,000”,而不是当作一个计数。
录制样本 · 采集于 2026-10-22
GET /partner/track/count
| { |
| "result": "success", |
| "message": "Data Retrieved.", |
| "spotify_track_id": "7qiZfU4dY1lWllzX7mPBI3", |
| "streams": 5152826895 |
| } |
共 6 行,即完整的录制响应体。
录制样本 · 采集于 2026-10-22
GET /partner/tracks/count
| { |
| "tracks": [ |
| { |
| "id": "7qiZfU4dY1lWllzX7mPBI3", |
| "name": "Shape of You", |
| "artists": [ |
| { |
| "id": "6eUKZXaKkcviH0Ku9w2n3V", |
| "name": "Ed Sheeran" |
| } |
| ], |
| "playcount": 5152826895, |
| "releaseDate": "2017-03-03", |
| "status": "ok" |
| } |
| ], |
| "missing": [] |
| } |
共 18 行,即完整的录制响应体。
一首歌曲,或每次调用 50 首
- GET /partner/track/countTrack play count
Lifetime play count of one track, by Spotify id (
spotify_track_id, or its aliasid) or byisrc. Spotify reports 0 for tracks with fewer than 1,000 plays. Play counts are cached for 1 hour; for many tracks use/partner/tracks/count.参数
spotify_track_id, id, isrc, cache - GET /partner/tracks/countTrack play counts (batch)
Lifetime play counts for up to 50 tracks in one call. Entries come back in request order with
statusok,not_foundorerror; ids without a play count are also listed inmissing. Each id is cached for 1 hour.参数
ids, cache - GET /partner/trackPartner track data
Track with its play count (
data.trackUnion.playcount), album, artists and content ratings. Addslim=1to keep only{id, uri, profile.name, visuals.avatarImage}of each artist (the full payload embeds the first artist's discography and is ~100 KB).参数
id, slim, cache
/partner/tracks/count 最多接受 50 个以逗号分隔的 ID,并按发送的顺序返回结果,所以 50 首歌曲只算一次请求,而不是 50 次。
获取播放次数
按 Spotify ID 查询一首歌曲
| curl -X GET \ |
| "https://spotify-proxy.checkleaked.cc/spotify-data/partner/track/count?id=0VjIjW4GlUZAMYd2vXMi3b" \ |
| -H "x-rapidapi-key: $SPOTIFY_API_KEY" |
ID 是任意 Spotify URL 中 /track/ 之后的 22 个字符。若要按 ISRC 查询歌曲,请用 isrc= 代替 id= 发送。
一次调用最多查询 50 首歌曲
| curl -X GET \ |
| "https://spotify-proxy.checkleaked.cc/spotify-data/partner/tracks/count?ids=0VjIjW4GlUZAMYd2vXMi3b%2C7qiZfU4dY1lWllzX7mPBI3" \ |
| -H "x-rapidapi-key: $SPOTIFY_API_KEY" |
请先看每一项的 status,再看它的播放次数。结果按 ID 的顺序返回;没有播放次数的项会被标记为 not_found 或 error,并再次列在 missing 中。
无需写代码获取播放次数
如果这些播放次数是用于电子表格,而不是自己的代码,同一位维护者的两个 Apify Actor 会把它们作为数据集返回。运行只需要 Apify 账号,不需要 API 密钥:粘贴链接,下载 JSON 或 CSV。
- Spotify Play Count Scraper (在新标签页中打开)eduair94/spotify-play-count-scraper
粘贴歌曲、专辑、艺人或播放列表的链接、URI 或 ID;每首歌曲返回一行及其播放次数——可以是艺人的热门歌曲或全部作品、专辑或播放列表中的每首歌曲——如有需要,还会返回一行艺人的每月听众数。
- Spotify Scraper (在新标签页中打开)eduair94/spotify-scraper
通用 Actor:共 61 个类别,其中 5 个是播放次数类别(
track_play_count,album_play_counts,artist_play_counts,artist_discography_play_counts,playlist_play_counts),另有isrc,可按 ISRC 找到歌曲及其播放次数。
两者都按结果计费,价格以 列出的为准:Apify 免费方案每行 $0.001,Gold 及以上低至 $0.0006。一次运行什么时候比密钥划算、什么时候不划算,见爬虫指南。
已有历史记录: spotify-most-streamed-songs (opens in a new tab) on GitHub has daily play counts and daily streams for 1,000 of the most-streamed songs, as CSV and JSON history.
在 AI 助手中使用(MCP):向 Claude、Cursor 或 VS Code 询问一首歌曲的播放次数,Spotify MCP 服务器的 get_track_play_count 工具就会从本 API 返回累计播放次数。设置 MCP 服务器。
常见问题
Spotify Web API 会返回播放次数吗?
不会。Web API 参考文档中的歌曲对象没有播放次数字段。与之最接近的 popularity 是 Spotify 主要根据总播放次数及播放新近程度计算的 0–100 分数;参考文档将其标记为已弃用,Spotify 2026 年 2 月的变更已对 2026 年 2 月 11 日起创建的开发模式应用移除了它。
为什么有的歌曲显示 0 次播放?
因为播放次数不足 1,000。规范指出 Spotify 对播放次数不足 1,000 的歌曲报告 0,所以 0 表示低于 1,000,而不是从未播放。
可以一次获取多首歌曲的播放次数吗?
可以。GET /partner/tracks/count 最多接受 50 个以逗号分隔的歌曲 ID,并按请求顺序返回,每一项的状态为 ok、not_found 或 error;没有播放次数的 ID 也会列在 missing 中。50 首歌曲只算一次请求,而不是 50 次。
可以按 ISRC 查询歌曲吗?
可以。GET /partner/track/count 接受用 isrc 代替 Spotify ID,所以以 ISRC 为键的曲库无需先做 ID 查询。
这个数字有多新?
播放次数缓存一小时,因此数字通常最多是一小时前的。X-Cache 的值若以 STALE 或 FALLBACK 开头,表示因为实时获取过慢或失败,返回的是较旧的副本;X-Cache-Stale-Age 给出其存在的秒数。加上 cache=false 可获取最新的数字。本站的“运行”按钮也要经过演示站自己的缓存,所以那里的数字可能更旧。
不写代码能获取播放次数吗?
可以,在 Apify 上:运行只需要 Apify 账号,不需要 API 密钥。Spotify Play Count Scraper(eduair94/spotify-play-count-scraper)接受歌曲、专辑、艺人或播放列表链接,每首歌曲返回一行及其播放次数;Spotify Scraper(eduair94/spotify-scraper)在其 61 个类别中有 5 个播放次数类别。两者都按结果计费。
需要哪个套餐?
任意一个。两个播放次数端点在每个套餐上都有,RapidAPI 和直购门户都一样,套餐只在每月用量上有区别。每个 RapidAPI 套餐都允许每秒 5 次请求,每个直购密钥包含每秒 10 次。RapidAPI 的免费套餐每月允许 1,000 次请求。
来源
- Get Track:Spotify Web API 参考文档 — 官方歌曲对象:没有播放次数,popularity 已标记为弃用。
- 2026 年 2 月变更:Spotify for Developers 参考文档 — 被移除的字段中包括歌曲的 popularity。
- 2026 年 2 月迁移指南:Spotify for Developers — 移除影响的对象:开发模式应用,即 2026 年 2 月 11 日起新建的应用;扩展配额应用不受影响。
- 本站的 GET /partner/track/count — 其参数、错误状态和“运行”按钮。
- 本站的 GET /partner/tracks/count — 批量调用,同样如此。
- Apify 上的 Spotify Play Count Scraper — 无需写代码的方式:其输入,以及目前公布的每行价格。
More guides
- Spotify Web API alternativeEndpoint-by-endpoint mapping from the official API, including everything Spotify removed on 27 November 2024.
- Spotify API without OAuthOne header instead of the client-credentials flow — and the things a key genuinely cannot do.
- Spotify lyrics APIWhy the Web API has no lyrics endpoint, and how to get line-synced lyrics as JSON, LRC or SRT.
- Spotify charts APIDaily Top 200 and viral charts as JSON: rank movement, stream counts, credits, and how to backfill.
- Spotify monthly listeners APIMonthly listeners, follower counts, world rank and top cities per artist — numbers the Web API never returned.
- Spotify audio features API after the 2024 deprecationTempo, energy, danceability, recommendations and related artists after Spotify removed them for new apps.
- Spotify API rate limitsThe official 30-second rolling window, what each plan here allows per second and per month, and how to stay under it.
- Spotify scraper on ApifyPlay counts, charts, lyrics and credits as a scheduled run with no API key — and when an API key is the better tool.
- Spotify MCP serverPlay counts, monthly listeners and charts inside Claude, Cursor or VS Code: an open-source MCP server that runs with your own key.
What changed in the API and on these pages, and when: What's new.
获取密钥,拉取第一个播放次数
两个播放次数端点在每个套餐上都有,RapidAPI 和直购门户都一样;在 Apify 上,上述两个 Actor 以数据集行的形式返回同样的播放次数,按结果计费。RapidAPI 的免费额度为每月 1,000 次请求:每次调用最多 50 首歌曲,最多可得 50,000 个播放次数。
还没想好购买?获取免费试用密钥:7 天内 500 次请求,无需银行卡。