Spotify · Guide

How to run a Spotify search

TL;DR
To run a Spotify search, sign up for a free Captapi key, then send one GET request to /v1/spotify/search with your input. You get clean JSON back in seconds for ~23 credits (1.15/result) per call — no OAuth, scraping or platform SDKs. Search Spotify programmatically and get structured, ranked results.

How to run a Spotify search (step by step)

  1. 1

    Get a free API key

    Create a free Captapi account (100 credits, no card) and generate an API key from the dashboard.

  2. 2

    Call the Spotify Search API

    Send an authenticated GET request to /v1/spotify/search with your input. No OAuth, no scraping setup.

  3. 3

    Read the JSON response

    Parse the clean JSON response. Pass cache=true for a free 24h cache hit; default is always fresh.

Code example

curl "https://api.captapi.com/v1/spotify/search?q=lofi%20beats" \
  -H "Authorization: Bearer capt_live_..."
# or: -H "x-api-key: capt_live_..."

What the response looks like

{
  "success": true,
  "data": {
    "platform": "spotify",
    "query": "lofi beats",
    "type": "tracks",
    "totalReturned": 5,
    "results": [
      {
        "platform": "spotify",
        "type": "track",
        "uri": "1S7FNazOUQc21EaQyh5nJT",
        "url": "https://open.spotify.com/track/1S7FNazOUQc21EaQyh5nJT",
        "name": "Nightmote - Lofi Remix",
        "description": null,
        "artists": [
          "Yoylecake Michael",
          "111robloxdude"
        ],
        "album": "Nightmote (Lofi Remix)",
        "durationMs": 207620,
        "playCount": null,
        "followers": null,
        "monthlyListeners": null,
        "releaseYear": null,
        "image": "https://i.scdn.co/image/ab67616d0000b2735d372fc451453e8b83900014",
        "totalTracks": null,
        "totalEpisodes": null,
        "raw": {
          "type": "track",
          "id": "1S7FNazOUQc21EaQyh5nJT",
          "name": "Nightmote - Lofi Remix",
          "artists": "Yoylecake Michael, 111robloxdude",
          "albumName": "Nightmote (Lofi Remix)",
          "albumArt": "https://i.scdn.co/image/ab67616d0000b2735d372fc451453e8b83900014",
          "releaseDate": null,
          "duration": 207620,
          "durationFormatted": "3:27",
          "playCount": null,
          "isExplicit": false,
          "isPlayable": true,
          "audioPreviewUrl": null,
          "url": "https://open.spotify.com/track/1S7FNazOUQc21EaQyh5nJT",
          "scrapedAt": "2026-07-18T11:28:01.801Z",
          "searchTerm": "lofi beats"
        }
      },
      {
        "platform": "spotify",
        "type": "track",
        "uri": "6AOXQYGPpd7KIIBxCCZzUx",
        "url": "https://open.spotify.com/track/6AOXQYGPpd7KIIBxCCZzUx",
        "name": "Lofi Beats",
        "description": null,
        "artists": [
          "Lofi Sleep Chill & Study"
        ],
        "album": "Wave Heart: Chill Lofi Music",
        "durationMs": 120000,
        "playCount": null,
        "followers": null,
        "monthlyListeners": null,
        "releaseYear": null,
        "image": "https://i.scdn.co/image/ab67616d0000b27391027e42977d144b3db3f705",
        "totalTracks": null,
        "totalEpisodes": null,
        "raw": {
          "type": "track",
          "id": "6AOXQYGPpd7KIIBxCCZzUx",
          "name": "Lofi Beats",
          "artists": "Lofi Sleep Chill & Study",
          "albumName": "Wave Heart: Chill Lofi Music",
          "albumArt": "https://i.scdn.co/image/ab67616d0000b27391027e42977d144b3db3f705",
          "releaseDate": null,
          "duration": 120000,
          "durationFormatted": "2:00",
          "playCount": null,
          "isExplicit": false,
          "isPlayable": true,
          "audioPreviewUrl": null,
          "url": "https://open.spotify.com/track/6AOXQYGPpd7KIIBxCCZzUx",
          "scrapedAt": "2026-07-18T11:28:01.901Z",
          "searchTerm": "lofi beats"
        }
      },
      {
        "platform": "spotify",
        "type": "track",
        "uri": "5yw15MbdXGw2ngbqmd7E3m",
        "url": "https://open.spotify.com/track/5yw15MbdXGw2ngbqmd7E3m",
        "name": "Lofi Beats",
        "description": null,
        "artists": [
          "Lo Fi Hip Hop"
        ],
        "album": "Lofi Dreams: Soft Lofi Beats",
        "durationMs": 120000,
        "playCount": null,
        "followers": null,
        "monthlyListeners": null,
        "releaseYear": null,
        "image": "https://i.scdn.co/image/ab67616d0000b2730cea6601096d5b32c8b28f71",
        "totalTracks": null,
        "totalEpisodes": null,
        "raw": {
          "type": "track",
          "id": "5yw15MbdXGw2ngbqmd7E3m",
          "name": "Lofi Beats",
          "artists": "Lo Fi Hip Hop",
          "albumName": "Lofi Dreams: Soft Lofi Beats",
          "albumArt": "https://i.scdn.co/image/ab67616d0000b2730cea6601096d5b32c8b28f71",
          "releaseDate": null,
          "duration": 120000,
          "durationFormatted": "2:00",
          "playCount": null,
          "isExplicit": false,
          "isPlayable": true,
          "audioPreviewUrl": null,
          "url": "https://open.spotify.com/track/5yw15MbdXGw2ngbqmd7E3m",
          "scrapedAt": "2026-07-18T11:28:01.961Z",
          "searchTerm": "lofi beats"
        }
      },
      {
        "platform": "spotify",
        "type": "track",
        "uri": "7zGzS7L6LnI5qQqMm8wTPB",
        "url": "https://open.spotify.com/track/7zGzS7L6LnI5qQqMm8wTPB",
        "name": "New Look - Wii U Mii Maker Lofi Mix",
        "description": null,
        "artists": [
          "Secret Potion",
          "Lofi Beats To Chill Study Sleep",
          "Nostalgiacore"
        ],
        "album": "Frutiger Aero Remixes",
        "durationMs": 162897,
        "playCount": null,
        "followers": null,
        "monthlyListeners": null,
        "releaseYear": null,
        "image": "https://i.scdn.co/image/ab67616d0000b27365bc1eef471caed82cd5c3d9",
        "totalTracks": null,
        "totalEpisodes": null,
        "raw": {
          "type": "track",
          "id": "7zGzS7L6LnI5qQqMm8wTPB",
          "name": "New Look - Wii U Mii Maker Lofi Mix",
          "artists": "Secret Potion, Lofi Beats To Chill Study Sleep, Nostalgiacore",
          "albumName": "Frutiger Aero Remixes",
          "albumArt": "https://i.scdn.co/image/ab67616d0000b27365bc1eef471caed82cd5c3d9",
          "releaseDate": null,
          "duration": 162897,
          "durationFormatted": "2:42",
          "playCount": null,
          "isExplicit": false,
          "isPlayable": true,
          "audioPreviewUrl": null,
          "url": "https://open.spotify.com/track/7zGzS7L6LnI5qQqMm8wTPB",
          "scrapedAt": "2026-07-18T11:28:02.011Z",
          "searchTerm": "lofi beats"
        }
      },
      {
        "platform": "spotify",
        "type": "track",
        "uri": "4LQ0TjIFk38xXNJVNoonSW",
        "url": "https://open.spotify.com/track/4LQ0TjIFk38xXNJVNoonSW",
        "name": "slow river",
        "description": null,
        "artists": [
          "ourchase"
        ],
        "album": "slow river",
        "durationMs": 103317,
        "playCount": null,
        "followers": null,
        "monthlyListeners": null,
        "releaseYear": null,
        "image": "https://i.scdn.co/image/ab67616d0000b273396a89f358a81646ed6259b8",
        "totalTracks": null,
        "totalEpisodes": null,
        "raw": {
          "type": "track",
          "id": "4LQ0TjIFk38xXNJVNoonSW",
          "name": "slow river",
          "artists": "ourchase",
          "albumName": "slow river",
          "albumArt": "https://i.scdn.co/image/ab67616d0000b273396a89f358a81646ed6259b8",
          "releaseDate": null,
          "duration": 103317,
          "durationFormatted": "1:43",
          "playCount": null,
          "isExplicit": false,
          "isPlayable": true,
          "audioPreviewUrl": null,
          "url": "https://open.spotify.com/track/4LQ0TjIFk38xXNJVNoonSW",
          "scrapedAt": "2026-07-18T11:28:02.289Z",
          "searchTerm": "lofi beats"
        }
      }
    ]
  }
}

Billing metadata (credits charged, cache hit/miss) is returned in the X-Captapi-Credits and X-Captapi-Cache response headers.

Request parameters

NameTypeRequiredDescription
qstring YesSearch query or keywords (min 2 characters).
typestringNotracks, albums, artists, podcasts, or episodes. Default tracks.
limitintegerNoMax items to return (default 20, max 50). Billed per result.
cachebooleanNoSet true to serve from the 24h response cache. Default false — always fetch fresh data.

Frequently asked questions

What does the Spotify Search API do?

The Spotify Search API lets you search and return matching results from a public Spotify query using one GET request to /v1/spotify/search. It returns clean JSON — no OAuth or infrastructure setup required.

How many credits does the Spotify Search API cost?

At the default limit this endpoint costs 23 credits (1.15 per result). Billing scales with how many results you request. Pass cache=true to serve from the 24h shared cache (0 credits on hit); default is always fresh. Failed or empty results are never charged.

Do I need a Spotify API key or OAuth?

No. A single Captapi key works across every platform Captapi supports — YouTube, TikTok, Instagram, Facebook, Twitter/X, Reddit, Threads, Bluesky, Pinterest, LinkedIn, Rumble, Spotify, Kwai, and more. We handle proxies, rate limits, retries, and authentication for you.

Is the Spotify Search API suitable for production use?

Yes. It is a stable REST endpoint with predictable JSON and automatic retries. Pass cache=true to serve from the 24h shared cache (0 credits on hit); default is always fresh. Use it for analytics, monitoring, and content automation.

Ready to run a Spotify search?

Start free with 100 credits — no credit card required.

Get your free API key