Spotify API
Spotify Track API
Fetch a Spotify track's play count, popularity, duration, and album details by track URL or ID.
POST/v1/run/spotify.track
Requests
-
30d
Try it
Make your first request
Sample response
Free runs return only the first 3 results. Fund a key to get the full response.
{
"data": {
"durationMs": 13,
"id": "a1b2c3d4",
"name": "Example title",
"playcount": 12500,
"popularity": 42,
"shareUrl": "https://example.com/page",
"trackNumber": 42,
"uri": "example"
},
"found": true
}Response interface
interface SpotifyTrackResponse {
data: {
durationMs: number;
id: string;
name: string;
playcount: number;
popularity: number;
shareUrl: string;
trackNumber: number;
uri: string;
} | null;
found: boolean;
}Full parameter and response reference - every field, type, and example for this endpoint.
Reference
Request, response, and price
Last verified 2026-09-16 · uptime and latency measured over 30dPOST /v1/run/spotify.track
curl -X POST https://api.getanyapi.com/v1/run/spotify.track \
-H "Authorization: Bearer $ANYAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://open.spotify.com/track/4cOdK2wGLETKBW3PvgPWqT"}'| Field | Type | Example value |
|---|---|---|
| Request body | ||
| id | string | Spotify track ID (alternative to url). |
| url | string | "https://open.spotify.com/track/4cOdK2wGLETKBW3PvgPWqT"Spotify track URL (e.g. https://open.spotify.com/track/4cOdK2wGLETKBW3PvgPWqT). |
| Response | ||
| data | object | |
| data.durationMs | integer | Populated whenever the provider has data for the entity. |
| data.id | string | Populated whenever the provider has data for the entity. |
| data.name | string | Populated whenever the provider has data for the entity. |
| data.playcount | integer | |
| data.popularity | integer | |
| data.shareUrl | string | Populated whenever the provider has data for the entity. |
| data.trackNumber | integer | Populated whenever the provider has data for the entity. |
| data.uri | string | Populated whenever the provider has data for the entity. |
| found | boolean | |
| Price | ||
| Price per request | USD | $0.0012 |
| Price /1k req | USD | $1.20 |
FAQ
About the Spotify Track API
The AnyAPI Spotify Track API returns Spotify track data as normalized JSON from one POST call to /v1/run/spotify.track. Fetch a Spotify track's play count, popularity, duration, and album details by track URL or ID. AnyAPI returns one normalized schema whichever source serves it. It costs from $1.20 per 1,000 requests, in US dollars with no subscription and no monthly minimum.
It costs from $1.20 per 1,000 requests, in US dollars with no subscription and no monthly minimum. You fund one USD wallet, each call draws it down, and a failed request costs $0.
Fetch a Spotify track's play count, popularity, duration, and album details by track URL or ID. The response is normalized JSON with the same envelope every AnyAPI endpoint returns, so parsing a second endpoint is a change of URL and nothing else.