Skip to content

Spotify Track API

GET https://api.fetchproof.com/v1/spotify/track

Provide one of: id, url. Get Spotify track

Default cost: 1 credit per call 0 credits on error
Code & Payload

Quick start

Open interactive playground in Docs ↗

cURL

curl --request GET 'https://api.fetchproof.com/v1/spotify/track?url=https%3A%2F%2Fopen.spotify.com%2Ftrack%2F0VjIjW4GlUZAMYd2vXMi3b' \
  --header 'x-api-key: YOUR_API_KEY'

JavaScript

const response = await fetch("https://api.fetchproof.com/v1/spotify/track?url=https%3A%2F%2Fopen.spotify.com%2Ftrack%2F0VjIjW4GlUZAMYd2vXMi3b", {
  method: 'GET',
  headers: {
    'x-api-key': process.env.FETCHPROOF_API_KEY,
  },
});
const data = await response.json();
console.log(data);

Python

import os
import requests

response = requests.get(
    "https://api.fetchproof.com/v1/spotify/track?url=https%3A%2F%2Fopen.spotify.com%2Ftrack%2F0VjIjW4GlUZAMYd2vXMi3b",
    headers={"x-api-key": os.environ["FETCHPROOF_API_KEY"]},
)
print(response.json())

Go

package main

import (
  "fmt"
  "io"
  "net/http"
  "os"
)

func main() {
  req, _ := http.NewRequest("GET", "https://api.fetchproof.com/v1/spotify/track?url=https%3A%2F%2Fopen.spotify.com%2Ftrack%2F0VjIjW4GlUZAMYd2vXMi3b", nil)
  req.Header.Set("x-api-key", os.Getenv("FETCHPROOF_API_KEY"))
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}

PHP

<?php
$ch = curl_init("https://api.fetchproof.com/v1/spotify/track?url=https%3A%2F%2Fopen.spotify.com%2Ftrack%2F0VjIjW4GlUZAMYd2vXMi3b");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    'x-api-key: ' . getenv('FETCHPROOF_API_KEY'),
  ],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
{
  "success": true,
  "credits_remaining": 100,
  "credits_charged": 1,
  "__typename": "Track",
  "associationsV3": {
    "audioAssociations": [],
    "videoAssociations": {
      "totalCount": 0
    }
  },
  "contentRating": {
    "label": "NONE"
  },
  "duration": {
    "totalMilliseconds": 200040
  },
  "id": "0VjIjW4GlUZAMYd2vXMi3b",
  "mediaType": "AUDIO",
  "name": "Blinding Lights",
  "playability": {
    "playable": true,
    "reason": "PLAYABLE"
  },
  "playcount": 5683378112,
  "saved": false,
  "sharingInfo": {
    "shareId": "V4YuvbTlQVeMQWZ9Y4kaQA",
    "shareUrl": "https://open.spotify.com/track/0VjIjW4GlUZAMYd2vXMi3b"
  },
  "trackNumber": 9,
  "uri": "spotify:track:0VjIjW4GlUZAMYd2vXMi3b",
  "albumOfTrack": {
    "copyright": [
      {
        "text": "© 2020 The Weeknd XO, Inc., marketed by Republic Records, a division of UMG Recordings, Inc.",
        "type": "C"
      },
      {
        "text": "℗ 2020 The Weeknd XO, Inc., marketed by Republic Records, a division of UMG Recordings, Inc.",
        "type": "P"
      }
    ],
    "courtesyLine": "",
    "id": "4yP0hdKOZPNshxUOjY0cZj",
    "date": {
      "isoString": "2020-03-20T00:00:00Z",
      "precision": "DAY",
      "year": 2020
    },
    "name": "After Hours",
    "playability": {
      "playable": true
    },
    "sharingInfo": {
      "shareId": "RQHIF8yjSH2F68a_reG7uw",
      "shareUrl": "https://open.spotify.com/album/4yP0hdKOZPNshxUOjY0cZj"
    },
    "tracks": [
      {
        "track": {
          "trackNumber": 1,
          "uri": "spotify:track:6b5P51m8xx2XA6U7sdNZ5E"
        }
      },
      {
        "track": {
          "trackNumber": 2,
          "uri": "spotify:track:2K9Ovn1o2bTGqbsABGC6m3"
        }
      },
      {
        "track": {
          "trackNumber": 3,
          "uri": "spotify:track:6kWxIqQDsKFYCJGbU4AjCX"
        }
      }
    ],
    "type": "ALBUM",
    "uri": "spotify:album:4yP0hdKOZPNshxUOjY0cZj",
    "coverArt": {
      "extractedColors": {
        "colorRaw": {
          "hex": "#701010"
        }
      },
      "sources": [
        {
          "height": 300,
          "url": "https://i.scdn.co/image/ab67616d00001e028863bc11d2aa12b54f5aeb36",
          "width": 300
        },
        {
          "height": 64,
          "url": "https://i.scdn.co/image/ab67616d000048518863bc11d2aa12b54f5aeb36",
          "width": 64
        },
        {
          "height": 640,
          "url": "https://i.scdn.co/image/ab67616d0000b2738863bc11d2aa12b54f5aeb36",
          "width": 640
        }
      ]
    }
  },
  "firstArtist": [
    {
      "discography": {
        "albums": [
          {},
          {},
          {}
        ],
        "popularReleasesAlbums": [
          {
            "date": {
              "isoString": "2020-03-20T00:00:00Z",
              "precision": "DAY",
              "year": 2020
            },
            "name": "After Hours",
            "playability": {
              "playable": true
            },
            "sharingInfo": {
              "shareId": "PPQpn045SraMgs8kTo2eGw",
              "shareUrl": "https://open.spotify.com/album/4yP0hdKOZPNshxUOjY0cZj"
            },
            "tracks": [
              {
                "track": {
                  "trackNumber": 1,
                  "uri": "spotify:track:6b5P51m8xx2XA6U7sdNZ5E"
                }
              },
              {
                "track": {
                  "trackNumber": 2,
                  "uri": "spotify:track:2K9Ovn1o2bTGqbsABGC6m3"
                }
              },
              {
                "track": {
                  "trackNumber": 3,
                  "uri": "spotify:track:6kWxIqQDsKFYCJGbU4AjCX"
                }
              }
            ],
            "type": "ALBUM",
            "uri": "spotify:album:4yP0hdKOZPNshxUOjY0cZj",
            "coverArt": {
              "extractedColors": {
                "colorRaw": {
                  "hex": "#701010"
                }
              },
              "sources": [
                {
                  "height": 300,
                  "url": "https://i.scdn.co/image/ab67616d00001e028863bc11d2aa12b54f5aeb36",
                  "width": 300
                },
                {
                  "height": 64,
                  "url": "https://i.scdn.co/image/ab67616d000048518863bc11d2aa12b54f5aeb36",
                  "width": 64
                },
                {
                  "height": 640,
                  "url": "https://i.scdn.co/image/ab67616d0000b2738863bc11d2aa12b54f5aeb36",
                  "width": 640
                }
              ]
            }
          },
          {
            "date": {
              "isoString": "2016-11-25T00:00:00Z",
              "precision": "DAY",
              "year": 2016
            },
            "name": "Starboy",
            "playability": {
              "playable": true
            },
            "sharingInfo": {
              "shareId": "kG7pWvLNTYaMCUOP9GT0hg",
              "shareUrl": "https://open.spotify.com/album/2ODvWsOgouMbaA5xf0RkJe"
            },
            "tracks": [
              {
                "track": {
                  "trackNumber": 1,
                  "uri": "spotify:track:7MXVkk9YMctZqd1Srtv4MB"
                }
              },
              {
                "track": {
                  "trackNumber": 2,
                  "uri": "spotify:track:4F7A0DXBrmUAkp32uenhZt"
                }
              },
              {
                "track": {
                  "trackNumber": 3,
                  "uri": "spotify:track:4oeaIftdpT3JuZLcCkKmVE"
                }
              }
            ],
            "type": "ALBUM",
            "uri": "spotify:album:2ODvWsOgouMbaA5xf0RkJe",
            "coverArt": {
              "extractedColors": {
                "colorRaw": {
                  "hex": "#A00030"
                }
              },
              "sources": [
                {
                  "height": 300,
                  "url": "https://i.scdn.co/image/ab67616d00001e024718e2b124f79258be7bc452",
                  "width": 300
                },
                {
                  "height": 64,
                  "url": "https://i.scdn.co/image/ab67616d000048514718e2b124f79258be7bc452",
                  "width": 64
                },
                {
                  "height": 640,
                  "url": "https://i.scdn.co/image/ab67616d0000b2734718e2b124f79258be7bc452",
                  "width": 640
                }
              ]
            }
          },
          {
            "date": {
              "isoString": "2025-01-31T00:00:00Z",
              "precision": "DAY",
              "year": 2025
            },
            "name": "Hurry Up Tomorrow",
            "playability": {
              "playable": true
            },
            "sharingInfo": {
              "shareId": "MH672_cwTgqWWTk4wqfPbg",
              "shareUrl": "https://open.spotify.com/album/3OxfaVgvTxUTy7276t7SPU"
            },
            "tracks": [
              {
                "track": {
                  "trackNumber": 1,
                  "uri": "spotify:track:5673WA8EEUSPx1ir26lhGW"
                }
              },
              {
                "track": {
                  "trackNumber": 2,
                  "uri": "spotify:track:3AWDeHLc88XogCaCnZQLVI"
                }
              },
              {
                "track": {
                  "trackNumber": 3,
                  "uri": "spotify:track:64JIAZ0bS7WoARYfWQGCoz"
                }
              }
            ],
            "type": "ALBUM",
            "uri": "spotify:album:3OxfaVgvTxUTy7276t7SPU",
            "coverArt": {
              "extractedColors": {
                "colorRaw": {
                  "hex": "#381800"
                }
              },
              "sources": [
                {
                  "height": 300,
                  "url": "https://i.scdn.co/image/ab67616d00001e02de79f330bc297af3fae736da",
                  "width": 300
                },
                {
                  "height": 64,
                  "url": "https://i.scdn.co/image/ab67616d00004851de79f330bc297af3fae736da",
                  "width": 64
                },
                {
                  "height": 640,
                  "url": "https://i.scdn.co/image/ab67616d0000b273de79f330bc297af3fae736da",
                  "width": 640
                }
              ]
            }
          }
        ],
        "singles": [
          {},
          {},
          {}
        ],
        "topTracks": [
          {
            "track": {
              "albumOfTrack": {
                "name": "The Idol Episode 4 (Music from the HBO Original Series)",
                "uri": "spotify:album:7tzVd1fwkxsorytCBjEJkU",
                "coverArt": {
                  "extractedColors": {
                    "colorRaw": {
                      "hex": "#F80800"
                    }
                  },
                  "sources": [
                    {
                      "height": 300,
                      "url": "https://i.scdn.co/image/ab67616d00001e02b0dd6a5cd1dec96c4119c262",
                      "width": 300
                    },
                    {
                      "height": 64,
                      "url": "https://i.scdn.co/image/ab67616d00004851b0dd6a5cd1dec96c4119c262",
                      "width": 64
                    },
                    {
                      "height": 640,
                      "url": "https://i.scdn.co/image/ab67616d0000b273b0dd6a5cd1dec96c4119c262",
                      "width": 640
                    }
                  ]
                }
              },
              "artists": [
                {
                  "profile": {
                    "name": "The Weeknd"
                  },
                  "uri": "spotify:artist:1Xyo4u8uXC1ZmMpatF05PJ"
                },
                {
                  "profile": {
                    "name": "JENNIE"
                  },
                  "uri": "spotify:artist:250b0Wlc5Vk0CoUsaCY84M"
                },
                {
                  "profile": {
                    "name": "Lily-Rose Depp"
                  },
                  "uri": "spotify:artist:1pBLC0qVRTB5zVMuteQ9jJ"
                }
              ],
              "associationsV3": {
                "audioAssociations": [],
                "videoAssociations": {
                  "totalCount": 1
                }
              },
              "contentRating": {
                "label": "NONE"
              },
              "duration": {
                "totalMilliseconds": 244684
              },
              "id": "7CyPwkp0oE8Ro9Dd5CUDjW",
              "name": "One Of The Girls (with JENNIE, Lily Rose Depp)",
              "playability": {
                "playable": true
              },
              "playcount": 2963283452,
              "previews": {
                "audioPreviews": [
                  {
                    "url": "https://p.scdn.co/mp3-preview/e5bb7776aff44435b938eb084b2eca23e6c7f5ed"
                  }
                ]
              },
              "uri": "spotify:track:7CyPwkp0oE8Ro9Dd5CUDjW"
            }
          },
          {
            "track": {
              "albumOfTrack": {
                "name": "Starboy",
                "uri": "spotify:album:2ODvWsOgouMbaA5xf0RkJe",
                "coverArt": {
                  "extractedColors": {
                    "colorRaw": {
                      "hex": "#A00030"
                    }
                  },
                  "sources": [
                    {
                      "height": 300,
                      "url": "https://i.scdn.co/image/ab67616d00001e024718e2b124f79258be7bc452",
                      "width": 300
                    },
                    {
                      "height": 64,
                      "url": "https://i.scdn.co/image/ab67616d000048514718e2b124f79258be7bc452",
                      "width": 64
                    },
                    {
                      "height": 640,
                      "url": "https://i.scdn.co/image/ab67616d0000b2734718e2b124f79258be7bc452",
                      "width": 640
                    }
                  ]
                }
              },
              "artists": [
                {
                  "profile": {
                    "name": "The Weeknd"
                  },
                  "uri": "spotify:artist:1Xyo4u8uXC1ZmMpatF05PJ"
                },
                {
                  "profile": {
                    "name": "Daft Punk"
                  },
                  "uri": "spotify:artist:4tZwfgrHOc3mvqYlEYSvVi"
                }
              ],
              "associationsV3": {
                "audioAssociations": [],
                "videoAssociations": {
                  "totalCount": 1
                }
              },
              "contentRating": {
                "label": "EXPLICIT"
              },
              "duration": {
                "totalMilliseconds": 230453
              },
              "id": "7MXVkk9YMctZqd1Srtv4MB",
              "name": "Starboy",
              "playability": {
                "playable": true
              },
              "playcount": 4870072058,
              "previews": {
                "audioPreviews": [
                  {
                    "url": "https://p.scdn.co/mp3-preview/57c1238d183c40da3157c2892346f58445b1377c"
                  }
                ]
              },
              "uri": "spotify:track:7MXVkk9YMctZqd1Srtv4MB"
            }
          },
          {
            "track": {
              "albumOfTrack": {
                "name": "After Hours",
                "uri": "spotify:album:4yP0hdKOZPNshxUOjY0cZj",
                "coverArt": {
                  "extractedColors": {
                    "colorRaw": {
                      "hex": "#701010"
                    }
                  },
                  "sources": [
                    {
                      "height": 300,
                      "url": "https://i.scdn.co/image/ab67616d00001e028863bc11d2aa12b54f5aeb36",
                      "width": 300
                    },
                    {
                      "height": 64,
                      "url": "https://i.scdn.co/image/ab67616d000048518863bc11d2aa12b54f5aeb36",
                      "width": 64
                    },
                    {
                      "height": 640,
                      "url": "https://i.scdn.co/image/ab67616d0000b2738863bc11d2aa12b54f5aeb36",
                      "width": 640
                    }
                  ]
                }
              },
              "artists": [
                {
                  "profile": {
                    "name": "The Weeknd"
                  },
                  "uri": "spotify:artist:1Xyo4u8uXC1ZmMpatF05PJ"
                }
              ],
              "associationsV3": {
                "audioAssociations": [],
                "videoAssociations": {
                  "totalCount": 0
                }
              },
              "contentRating": {
                "label": "NONE"
              },
              "duration": {
                "totalMilliseconds": 200040
              },
              "id": "0VjIjW4GlUZAMYd2vXMi3b",
              "name": "Blinding Lights",
              "playability": {
                "playable": true
              },
              "playcount": 5683378112,
              "previews": {
                "audioPreviews": [
                  {
                    "url": "https://p.scdn.co/mp3-preview/51c08d92815cce4ac2de94a7335a430b81234624"
                  }
                ]
              },
              "uri": "spotify:track:0VjIjW4GlUZAMYd2vXMi3b"
            }
          }
        ]
      },
      "id": "1Xyo4u8uXC1ZmMpatF05PJ",
      "profile": {
        "name": "The Weeknd"
      },
      "relatedContent": {
        "relatedArtists": [
          {
            "id": "5pKCCKE2ajJHZ9KAiaK11H",
            "profile": {
              "name": "Rihanna"
            },
            "uri": "spotify:artist:5pKCCKE2ajJHZ9KAiaK11H",
            "visuals": {
              "avatarImage": {
                "sources": [
                  {
                    "height": 640,
                    "url": "https://i.scdn.co/image/ab6761610000e5ebcb565a8e684e3be458d329ac",
                    "width": 640
                  },
                  {
                    "height": 160,
                    "url": "https://i.scdn.co/image/ab6761610000f178cb565a8e684e3be458d329ac",
                    "width": 160
                  },
                  {
                    "height": 320,
                    "url": "https://i.scdn.co/image/ab67616100005174cb565a8e684e3be458d329ac",
                    "width": 320
                  }
                ]
              }
            }
          },
          {
            "id": "1zNqQNIdeOUZHb8zbZRFMX",
            "profile": {
              "name": "Swae Lee"
            },
            "uri": "spotify:artist:1zNqQNIdeOUZHb8zbZRFMX",
            "visuals": {
              "avatarImage": {
                "sources": [
                  {
                    "height": 640,
                    "url": "https://i.scdn.co/image/ab6761610000e5ebbccdbb98ab5d54454cd0fe85",
                    "width": 640
                  },
                  {
                    "height": 160,
                    "url": "https://i.scdn.co/image/ab6761610000f178bccdbb98ab5d54454cd0fe85",
                    "width": 160
                  },
                  {
                    "height": 320,
                    "url": "https://i.scdn.co/image/ab67616100005174bccdbb98ab5d54454cd0fe85",
                    "width": 320
                  }
                ]
              }
            }
          },
          {
            "id": "5cj0lLjcoR7YOSnhnX0Po5",
            "profile": {
              "name": "Doja Cat"
            },
            "uri": "spotify:artist:5cj0lLjcoR7YOSnhnX0Po5",
            "visuals": {
              "avatarImage": {
                "sources": [
                  {
                    "height": 640,
                    "url": "https://i.scdn.co/image/ab6761610000e5eb8a0644455ebfa7d3976f5101",
                    "width": 640
                  },
                  {
                    "height": 160,
                    "url": "https://i.scdn.co/image/ab6761610000f1788a0644455ebfa7d3976f5101",
                    "width": 160
                  },
                  {
                    "height": 320,
                    "url": "https://i.scdn.co/image/ab676161000051748a0644455ebfa7d3976f5101",
                    "width": 320
                  }
                ]
              }
            }
          }
        ]
      },
      "uri": "spotify:artist:1Xyo4u8uXC1ZmMpatF05PJ",
      "visuals": {
        "avatarImage": {
          "sources": [
            {
              "height": 640,
              "url": "https://i.scdn.co/image/ab6761610000e5ebc1719ac9e6a75c1c25835018",
              "width": 640
            },
            {
              "height": 160,
              "url": "https://i.scdn.co/image/ab6761610000f178c1719ac9e6a75c1c25835018",
              "width": 160
            },
            {
              "height": 320,
              "url": "https://i.scdn.co/image/ab67616100005174c1719ac9e6a75c1c25835018",
              "width": 320
            }
          ]
        }
      }
    }
  ],
  "otherArtists": []
}
Response JSON · /v1/spotify/track

What it returns

success boolean
credits_remaining integer
credits_charged integer
popularity integer
__typename string
associationsV3 object
contentRating object
duration object
id string
mediaType string

Parameters

id string query optional

Spotify track ID. Provide id or url.

url string query optional

Spotify song URL. Provide id or url.

Use cases

Billing

Errors cost zero credits. Empty results follow this operation’s rules.

Default: 1 credit

An empty result costs 0 credits.

How charges are determined

Cost is decided per call, not per endpoint: the same operation can cost different amounts depending on what it returns.

A call that fails costs 0 credits. A result served from cache costs 0 credits.

`default` is the cost when no rule matches. Rules are evaluated in order and the first whose conditions all hold wins.

A `when` condition is one of: `param` (the request parameter is true), `outcome` (the classifier's outcome), `empty` / `nonEmpty` (a response field is empty and absent, or a non-empty array or string), `flag` (a response field is exactly true).

A cost of `{ perStartedMinute: n, of: [fields] }` is n x max(1, ceil(seconds / 60)), so even a short result bills at least one minute.

FAQ

How much does the Spotify Track API cost?

A call costs 1 credit by default. Errors cost 0 credits. New accounts get 100 free credits with no card. After that, credits come in one-time packs that never expire: 25,000 for $27 and 500,000 for $297 (plus any tax). There is no subscription.

What do I need to call it?

An API key in the x-api-key header, and one of id or url. You don't need a Spotify account or developer app.

What does it return?

Typed JSON. Top-level fields include popularity, __typename, associationsV3, contentRating, duration and id. The full schema and a real sample response are on this page and in the API reference.

Is this an official Spotify API?

No. Fetchproof is an unofficial API that returns public Spotify data only.