Spotify API

Set up API access for Spotify, enabling search, playback control, playlist management, and access to music metadata.

⏱ 5 minutes music entertainment developer.spotify.com
getapi spotify

Prerequisites

  • A Spotify account (free or premium)

Credentials

Variable Description Sensitive
SPOTIFY_CLIENT_ID Client ID for your Spotify application Public
SPOTIFY_CLIENT_SECRET Client Secret for server-side authentication Secret

Setup Steps

  1. 1 Info

    We'll create a Spotify developer app and get your Client ID and Secret. These are used for the Client Credentials flow (server-to-server) or as part of the Authorization Code flow (user-facing).

  2. 2 Open URL

    Opening the Spotify developer dashboard. Sign in with your Spotify account if prompted.

    https://developer.spotify.com/dashboard
  3. 3 Info

    Click 'Create app'. Fill in the app name and description. For 'Redirect URI', enter 'http://localhost:3000/callback' (you can change this later). Check the 'Web API' checkbox under 'Which API/SDKs are you planning to use?'.

  4. 4 Confirm

    App created?

    Checkpoint — confirm before continuing
  5. 5 Info

    Click on your app, then go to 'Settings' to find your credentials.

  6. 6 Input

    Copy the 'Client ID' and paste it here:

    → SPOTIFY_CLIENT_ID
    32 characters
  7. 7 Input

    Click 'View client secret', then copy and paste it here:

    → SPOTIFY_CLIENT_SECRET
    32 characters
  8. 8 Validate

    Checking your credentials work...

    Credentials verified. Your Spotify app is ready.
    Couldn't authenticate with those credentials. Double-check them on the developer dashboard.

Things to Know

  • The Client Secret must NEVER be exposed in client-side code. Use the Authorization Code flow with PKCE for frontend apps.
  • Spotify's free tier has no hard rate limit, but aggressive usage may trigger 429 errors. Back off and retry.
  • Apps start in 'development mode' with a 25-user limit. Submit a quota extension request for production use.
  • Some endpoints (e.g. playback control) require Spotify Premium on the user's account.
  • Redirect URIs must be registered in your app settings before they can be used in the OAuth flow.