Skip to content

How to get a public Spotify playlist's tracks as JSON

By Hayden Barnett · · 6 min read

A public Spotify playlist is the list behind a share link. As of 26 Nov 2026, Get Playlist Items says that call is only for a playlist the current user owns or collaborates on, and that anyone else gets HTTP 403. The February 2026 migration guide applies that rule to Development Mode. Extended Quota Mode is outside it. For a Development Mode app, one GET still returns a page of that public playlist as JSON:

export FETCHPROOF_API_KEY=fp_live_xxx

curl -s "https://api.fetchproof.com/v1/spotify/playlist?url=https%3A%2F%2Fopen.spotify.com%2Fplaylist%2F37i9dQZF1DXcBWIGoYBM5M" \
  --header "x-api-key: $FETCHPROOF_API_KEY"

The URL is the published example on the playlist endpoint. Pass url or id, one of them. id is the bare playlist id, or a spotify:playlist: URI. A share link belongs in url, including a link that ends in ?si=..., an /embed/ link, or an /intl-.../ link. The id is the path segment after playlist.

curl -s "https://api.fetchproof.com/v1/spotify/playlist?id=37i9dQZF1DXcBWIGoYBM5M" \
  --header "x-api-key: $FETCHPROOF_API_KEY"

There is no Spotify app, no user login, and no OAuth token. The credential is the Fetchproof key in x-api-key.

Why Development Mode stops at metadata

The February 2026 changelog removes GET /playlists/{id}/tracks and points callers at GET /playlists/{id}/items. A playlist response includes the item list for a playlist the user owns. Other playlists return metadata, and the items are absent. The migration guide says the same thing for collaborators: Development Mode can read items when the user owns the playlist or collaborates on it. It also requires Premium on the app owner’s Spotify account, and it caps a new app at five authorized users. New Development Mode apps picked up the rules on 11 Feb 2026.

Existing apps were not all flipped that day. The 6 Feb 2026 announcement postponed the endpoint-access change for integrations that already existed, on 9 March 2026. The Premium requirement and the five-user cap still applied. A script that worked in 2025 can 403 on a playlist it does not own, while GET /playlists/{id} still returns 200 and no track list.

Reading the public embed page is the other workaround in circulation. Those readers stop after a fixed chunk. The spotify-url-info package documents that its track list is the first 100, and it has no cursor to send back. A playlist longer than that chunk is a partial copy, with no field that says the page was the last one.

What comes back

Field names below match the published schema for playlist. Names and counts are placeholders, so the sample does not claim what any playlist contains today. The id is the one from the example above.

{
  "success": true,
  "credits_remaining": 99,
  "credits_charged": 1,
  "id": "37i9dQZF1DXcBWIGoYBM5M",
  "uri": "spotify:playlist:37i9dQZF1DXcBWIGoYBM5M",
  "name": "<playlist name>",
  "description": "<description>",
  "followers": 1000,
  "images": [
    {
      "sources": [
        {
          "url": "https://i.scdn.co/image/<image>",
          "height": null,
          "width": null
        }
      ]
    }
  ],
  "ownerV2": {
    "__typename": "User",
    "name": "<owner name>",
    "uri": "spotify:user:<username>",
    "username": "<username>"
  },
  "tracks": [
    {
      "id": "<track id>",
      "uri": "spotify:track:<track id>",
      "name": "<track name>",
      "albumOfTrack": {
        "name": "<album name>",
        "uri": "spotify:album:<album id>"
      },
      "artists": [
        {
          "profile": { "name": "<artist name>" },
          "uri": "spotify:artist:<artist id>"
        }
      ],
      "duration": { "totalMilliseconds": 200000 },
      "playcount": 1000
    }
  ],
  "cursor": "20",
  "totalCount": 50
}

tracks is one page. Each call asks for 20 playlist rows. totalCount is the playlist’s own count, and cursor is the offset of the next page. Send that value back unchanged, with the same url or id:

curl -s "https://api.fetchproof.com/v1/spotify/playlist?id=37i9dQZF1DXcBWIGoYBM5M&cursor=20" \
  --header "x-api-key: $FETCHPROOF_API_KEY"

Use the cursor from the response you just received. The 20 above is the second page when the first page started at offset 0. cursor is null on the last page. A value that does not parse as a number starts again at the first page, so a typo looks like a repeat of page one rather than an error.

ownerV2 is the playlist owner: name, username, and uri. images[].sources[].url is a cover image. height and width are null when Spotify does not send them. On a track, albumOfTrack is the album name and URI, artists[].profile.name is the credit, duration.totalMilliseconds is the length, and playcount is the play count Spotify shows for that track.

A row that is not a track is left out of tracks. Local files and episodes in the same playlist are that case. The page can therefore hold fewer than 20 objects while cursor is still set, and the tracks you collect can add up to less than totalCount. Follow cursor until it is null. Do not stop because a page looks short.

A call with neither id nor url, or with a value that is not a playlist id or a Spotify URL, is HTTP 400. The body has success: false, error: "bad_request", and message: "You must provide an id or url". A playlist Spotify does not have is HTTP 404, with success: true, error: "not_found", and message: "Not found".

Python

The standard library is enough. Keep the key in the environment. The samples on this page use the placeholder fp_live_xxx.

import json
import os
import urllib.parse
import urllib.request

playlist = "https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M"
cursor = None
tracks = []
total = None

while True:
    params = {"url": playlist}
    if cursor is not None:
        params["cursor"] = cursor
    request = urllib.request.Request(
        "https://api.fetchproof.com/v1/spotify/playlist?" + urllib.parse.urlencode(params),
        headers={"x-api-key": os.environ["FETCHPROOF_API_KEY"]},
    )
    with urllib.request.urlopen(request, timeout=60) as response:
        body = json.load(response)
    tracks.extend(body["tracks"])
    total = body["totalCount"]
    cursor = body["cursor"]
    if cursor is None:
        break

print(len(tracks), "tracks collected;", total, "reported on the playlist")
for track in tracks:
    artists = ", ".join(artist["profile"]["name"] for artist in track["artists"])
    print(f"{track['name']}  {artists}")

urlopen raises when the status is not successful, which covers the 400 and the 404 above. An empty playlist is HTTP 200 with tracks set to [] and cursor set to null. That does not raise. Read credits_charged before you treat an empty list as a failed fetch.

Node

Node 18 and later include fetch:

const playlist = "https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M";
const tracks = [];
let cursor = null;
let total = null;

do {
  const endpoint = new URL("https://api.fetchproof.com/v1/spotify/playlist");
  endpoint.searchParams.set("url", playlist);
  if (cursor != null) endpoint.searchParams.set("cursor", String(cursor));
  const response = await fetch(endpoint, {
    headers: { "x-api-key": process.env.FETCHPROOF_API_KEY },
  });
  if (!response.ok) {
    throw new Error(`Spotify playlist failed: HTTP ${response.status}`);
  }
  const body = await response.json();
  tracks.push(...body.tracks);
  total = body.totalCount;
  cursor = body.cursor;
} while (cursor != null);

console.log(tracks.length, "tracks collected;", total, "reported on the playlist");

The same x-api-key header is what the n8n HTTP Request post configures once. Point that node at /v1/spotify/playlist and send url as a query parameter. From an MCP client, the tool name is spotify_playlist. Setup for the server is in the MCP docs.

One track, when the row is not enough

A playlist row has the title, the artists, the album, the length, and the play count. It does not include playability or the content rating. Those are on the track endpoint. Pass the track uri, or the open.spotify.com URL. The call below uses that endpoint’s published example:

curl -s "https://api.fetchproof.com/v1/spotify/track?url=https%3A%2F%2Fopen.spotify.com%2Ftrack%2F0VjIjW4GlUZAMYd2vXMi3b" \
  --header "x-api-key: $FETCHPROOF_API_KEY"

The object includes name, duration.totalMilliseconds, playcount, albumOfTrack, playability (playable and reason), and contentRating.label. The endpoint page has the full field list. Every Spotify route sits on the Spotify API page.

What a call costs

Each playlist page costs 1 credit by default, and so does the track call. A playlist whose totalCount is 50, with every row a track, is three playlist calls: offsets 0, 20, and 40. Errors, blocked or timed-out requests, invalid requests and cache hits cost nothing. A not-found or empty result is charged only where that operation’s published cost says so.

These operations publish that default and no separate empty or not-found price. A missing playlist is the HTTP 404 above, and credits_charged on that body is 0. An empty tracks array with HTTP 200 is a successful read of an empty playlist, so the error rule does not apply to it. Read credits_charged on the body. The playlist page and the track page each state the published cost. The HTTP 400 for a missing id and url is an invalid request, and invalid requests cost nothing.

New accounts get 100 free credits, with no card. Pack sizes and prices are on the pricing page. Freelance is $27 for 25,000 credits. Business is $297 for 500,000 credits. How a prepaid pack compares with a monthly quota that resets is in prepaid credits vs monthly subscriptions.

FAQ

Can the official Web API list tracks on a public playlist I do not own?

Extended Quota Mode is outside the February 2026 Development Mode change, so an approved app can still differ. Development Mode follows Get Playlist Items: 403 unless the current user owns the playlist or collaborates on it. The metadata call can still return 200 with no item list. This endpoint reads the public playlist from its URL or id, and you do not send a Spotify token.

How do I know the page is the last one?

cursor is null on the last page. Until then it is the next offset. Send it back as the cursor query parameter with the same playlist. A page with fewer than 20 tracks can still have a cursor, because local files and episodes are omitted from tracks while they still count toward totalCount.

What if the playlist does not exist, or I omit the id?

A playlist Spotify does not have is HTTP 404 with error set to not_found and credits_charged set to 0. urlopen, and a fetch check on response.ok, both treat that status as a failure. Omitting id and url, or sending a string that is neither a playlist id nor a Spotify URL, is HTTP 400 with error set to bad_request. That invalid request costs nothing.

Does this search Spotify?

This operation has no search parameter. You pass a playlist URL or id you already have. It also has no Spotify user token, so it reads the playlist the public page shows. Podcasts are a separate pair of calls, podcast and podcast episodes, and they are not rows in tracks.

Try it with 100 free credits

Sign up with an email address, no card. Credits never expire. Errors, invalid requests and cache hits cost 0 credits, and each endpoint page lists exactly what it charges.