Spotify search API
Search the Spotify catalogue for artists, albums, tracks, playlists, podcasts and episodes in one call.
GET /v1/spotify/search1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/spotify/search?q=daft%20punk",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "artists": { "items": [ { "id": "4tZwfgrHOc3mvqYlEYSvVi", "name": "Daft Punk", "type": "artist", "uri": "spotify:artist:4tZwfgrHOc3mvqYlEYSvVi", "external_urls": { "…": "1 fields" }, "images": [ "…" ], "verified": true }, "… 9 more" ], "total": 21 }, "albums": { "items": [ { "id": "4m2880jivSbbyEGAKfITCa", "name": "Random Access Memories", "type": "album", "album_type": "album", "uri": "spotify:album:4m2880jivSbbyEGAKfITCa", "external_urls": { "…": "1 fields" }, "images": [ "…" ], "release_date": "2013", "release_date_precision": "year", "total_tracks": null, "…": "1 more fields" }, "… 9 more" ], "total": 15 }, "tracks": { "items": [ { "id": "0DiWol3AO6WpXZgp0goxAV", "name": "One More Time", "type": "track", "uri": "spotify:track:0DiWol3AO6WpXZgp0goxAV", "external_urls": { "…": "1 fields" }, "duration_ms": 320357, "explicit": false, "disc_number": null, "track_number": null, "is_playable": true, "…": "3 more fields" }, "… 9 more" ], "total": 16 }, "playlists": { "items": [ { "id": "2jTy5QwqWJ1ZUv2XeJPYbn", "name": "Daft Punk Greatest Hits", "type": "playlist", "uri": "spotify:playlist:2jTy5QwqWJ1ZUv2XeJPYbn", "external_urls": { "…": "1 fields" }, "description": "Best hits of this awesome band!", "images": [ "…" ], "owner": { "…": "1 fields" } }, "… 9 more" ], "total": 16 }, "shows": { "items": [ { "id": "7BJuiIp6JWJa8HBVIZCGua", "name": "Daft Punk", "type": "show", "uri": "spotify:show:7BJuiIp6JWJa8HBVIZCGua", "external_urls": { "…": "1 fields" }, "publisher": "Gabo Jolly", "images": [ "…" ] }, "… 9 more" ], "total": 20 }, "episodes": { "items": [ { "id": "61lFljZo00mXmbYkMt9Pmr", "name": "E1 - Daft Punk: Robots With A Human Touch", "type": "episode", "uri": "spotify:episode:61lFljZo00mXmbYkMt9Pmr", "external_urls": { "…": "1 fields" }, "description": "Our season-long dissection of Daft Punk begins now! In episode one, we trace Tho…", "html_description": null, "release_date": "2026-03-17T10:01:00Z", "release_date_precision": "minute", "duration_ms": 2061909, "…": "6 more fields" }, "… 9 more" ], "total": 15 }, "next_cursor": "eyJzIjoic2VhcmNoOmRhZnQgcHVuayIsIm8iOjEwfQ"}Parameters
| Name | Type | Description |
|---|---|---|
qquery · required | string | Search words. Example: daft punk. |
typequery | string | Comma-separated kinds to keep: artist, album, track, playlist, show, episode. Default: all. |
limitquery | integer | Results per kind (default 10). |
afterquery | string | Cursor: the previous page’s next_cursor. |
Response fields
200 with a SpotifySearchResponse, in the shape of the Spotify Web API’s own objects.
| Field | Type | Description |
|---|---|---|
artists | object | |
albums | object | |
tracks | object | |
playlists | object | |
shows | object | |
episodes | object | |
next_cursor | string | null |
Status codes
| Status | Meaning |
|---|---|
200 | Matches by kind. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | No Spotify object by that id, or it is not public. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | Spotify is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Questions
How many results?
Up to 50 per kind, with after for more.
Spotify is a trademark of Spotify AB. We are not affiliated with or endorsed by Spotify.