指南
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 次請求,無須信用卡。