1. Platforms
  2. Spotify Scraper API
  3. Spotify track API

Spotify track API

Title, artists, album, duration, lifetime play count and the 30 second preview URL.

GET api.socialscrape.dev/v1/spotify/track

Cost
1 credit
Cached repeats
0 creditssend max_age_days, results kept 30 days
Failed requests
0 credits

You send one of url or id.

Part of the Spotify Scraper API: 7 Spotify endpoints on one key.

Request

Send your key in the x-api-key header.

1curl -G "https://api.socialscrape.dev/v1/spotify/track" \2  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3  --data-urlencode 'id=4cOdK2wGLETKBW3PvgPWqT'

Parameters

NameTypeRequiredDescription
urlurlone ofSpotify track URL.
idstringone ofSpotify track id.

Every request also accepts trim, raw and max_age_days.

Response

Sample from a recorded response, shortened. Values are examples, not your data.

200 OKSample response
1{2  "ok": true,3  "credits_charged": 1,4  "credits_remaining": 4999,5  "cached": false,6  "cached_at": null,7  "request_id": "req_11f4ec0529df2dacd8ad851a",8  "data": {9    "object": "song",10    "platform": "spotify",11    "id": "4cOdK2wGLETKBW3PvgPWqT",12    "url": "https://open.spotify.com/track/4cOdK2wGLETKBW3PvgPWqT",13    "title": "Never Gonna Give You Up",14    "artists": [15      "Rick Astley"16    ],17    "album": "Whenever You Need Somebody",18    "duration_seconds": 213.573,19    "cover_url": "https://i.scdn.co/image/ab67616d0000b273baf89eb11ec7c657805d2da0",20    "preview_url": "https://p.scdn.co/mp3-preview/40a780b231e5ed130483bec7917b6c9a4f8a4708",21    "released_at": "1987-11-12",22    "isrc": null,23    "explicit": false,24    "is_original": null,25    "stats": {26      "plays": 1197661434,27      "uses": null,28      "likes": null29    },30    "extra": {31      "album_id": "5Z9iiGl2FcIfa3BMiv6OIw",32      "album_url": "https://open.spotify.com/album/5Z9iiGl2FcIfa3BMiv6OIw",33      "artist_ids": [34        "0gxyHStUsqpMadRV0Di1Qt"35      ],36      "media_type": "AUDIO",37      "playable": true,38      "track_number": 139    }40  },41  "cursor": null,42  "has_more": null43}

Fields

One Song in data.

A field the platform does not give is null, never made up. Extra platform details are in extra.

FieldTypeAlwaysNotes
object"song"
platformPlatformyes
idstringyes
urlstring or null
titlestring or null
artistsstring[] or null
albumstring or null
duration_secondsnumber or null
cover_urlstring or null
preview_urlstring or null
released_atstring (ISO 8601 date) or null
isrcstring or null
explicitboolean or null
is_originalboolean or nullTikTok "original sound"
Show the other 2 fields
FieldTypeAlwaysNotes
statsSongStats
extraobject or null

Full field list in the reference for this endpoint and the data models. Errors are listed under Errors.

Questions

Which errors can it return?

invalid_params (do not retry), unsupported_url (do not retry), not_found (do not retry). Account and platform errors from the errors list can also happen. A failure always costs 0 credits.

Is there an SDK call for it?

The Python client has client.spotify.track(...) and the TypeScript client client.spotify.track(). Both return the same envelope as the HTTP API. Install them from PyPI (socialscrape-sdk) or npm (socialscrape); plain HTTP works in any language.

Can an AI agent call it?

Yes. The MCP server, which you run on your own machine, reaches every built endpoint, with the same prices.