Migrate from Spotify

Spotify deprecated /v1/audio-features in November 2024 and restricted the entire Web API to apps with 250K+ monthly active users in May 2025. TuneLab's compatibility shim returns the exact same JSON schema — so your existing code keeps working with a one-line change.

!
You can't wait this one out.
Spotify won't un-deprecate these endpoints. Even if you're above the 250K MAU threshold, the features endpoint is gone. You need a real replacement.

What changes

Two things: the base URL and the Authorization header.

migration
// Before — Spotify (deprecated)
fetch('https://api.spotify.com/v1/audio-features/2WfaOiMkCvy7F5fcp2zZ8L', {
  headers: { Authorization: 'Bearer <spotify_access_token>' }
})

// After — TuneLab (drop-in)
fetch('https://api.tunelab.dev/v1/compat/spotify/audio-features/2WfaOiMkCvy7F5fcp2zZ8L', {
  headers: { Authorization: 'Bearer tl_live_xxx' }
})

What stays the same

The response JSON uses the exact Spotify schema: same field names, same value ranges, same types. Your downstream code needs zero changes.

Spotify-compatible response
{
  "id": "2WfaOiMkCvy7F5fcp2zZ8L",
  "tempo": 116.01,
  "key": 11,
  "mode": 0,
  "loudness": -9.2,
  "energy": 0.72,
  "danceability": 0.84,
  "valence": 0.78,
  "acousticness": 0.08,
  "instrumentalness": 0.02,
  "speechiness": 0.04,
  "time_signature": 4
}

Field mapping

FieldTypeRangeNotes
tempofloat60–200Float precision (Spotify also used float)
keyint0–11Pitch class: C=0, C#=1, ..., B=11
modeint0 or 10=minor, 1=major
loudnessfloat-60 to 0dBFS
energyfloat0.0–1.0Normalized
danceabilityfloat0.0–1.0Normalized
valencefloat0.0–1.0Happiness/positivity
acousticnessfloat0.0–1.0Normalized
instrumentalnessfloat0.0–1.0Normalized
speechinessfloat0.0–1.0Normalized
time_signatureint3–7Beats per bar

Gotchas

Native format recommended

The Spotify shim exists for painless migration — but if you're writing new code, use the native /v1/analyze endpoint. It returns integer 0–100 scales instead of 0.0–1.0 floats, Camelot notation alongside pitch class, and the full _meta envelope with cache status and trace IDs.