On this page
- Table of Contents
- Audio-features fields and what they actually mean
- Audio-analysis structure: bars, beats, segments, and confidence
- Choosing an OAuth flow and handling tokens correctly
- Matching your use case to the right endpoint
- Batch requests and response-handling patterns
- Platform access changes you need to audit first
- How Playlist Pilot applies audio feature data to playlist fit
- What production integrations get wrong
- A ready-made alternative for artists who don't want to build
- Official docs and migration guides worth bookmarking
Spotify exposes two endpoints for audio-derived music data: compact track-level audio-features for fast filtering, and time-aligned audio-analysis for beat and segment-level work. Use audio-features for ranking, clustering, or playlist filters, and reach for audio-analysis only when you need synchronization or visualization detail. Before you build anything, audit your app's access mode, since endpoint availability now depends on Development Mode rules.
TL;DR: - Use audio-features for general ranking, clustering, and playlist filtering, but only request audio-analysis for tracks needing detailed timing or sound structure insights. - When filtering based on content, consider thresholds like instrumentality above 0.5 and speechiness above 0.66, verifying these against actual labeled data first. - Batch requests of up to 100 tracks optimize API quota, and store raw JSON responses to allow flexible recalculations or re-analyses later. - Confirm your app's access mode and endpoint availability, especially after the November 2024 API restrictions and February 2026 quota changes. - For artists wanting to avoid technical setup, Playlist Pilot offers a ready-made service that matches songs to curated playlists with personalized pitches using internal audio analysis.
Table of Contents
- Audio-features fields and what they actually mean
- Audio-analysis structure: bars, beats, segments, and confidence
- Choosing an OAuth flow and handling tokens correctly
- Matching your use case to the right endpoint
- Batch requests and response-handling patterns
- Platform access changes you need to audit first
- How Playlist Pilot applies audio feature data to playlist fit
- What production integrations get wrong
- A ready-made alternative for artists who don't want to build
- Official docs and migration guides worth bookmarking
- Sources
- FAQ
Audio-features fields and what they actually mean
The audio-features endpoint returns a flat set of descriptors for a single track, most scored between 0.0 and 1.0. These values are model outputs, not ground truth, so treat them as relative signals rather than fixed labels.
- Danceability, energy, valence: 0.0 to 1.0 scores describing rhythmic suitability for dancing, perceived intensity, and musical positivity.
- Tempo: estimated beats per minute, expressed as a float.
- Key and mode: key is a pitch class from 0 to 11 (0 = C), mode is 0 for minor or 1 for major.
- Loudness: overall track loudness in decibels, typically a negative value.
- Duration_ms: track length in milliseconds.
- Acousticness, instrumentalness, liveness, speechiness: confidence measures, each on the 0.0 to 1.0 scale.
- Time_signature: estimated beats per bar, usually 3 to 7.
Instrumentalness above 0.5 signals a likely instrumental track, and speechiness above 0.66 indicates likely spoken word content, thresholds worth building directly into your filtering logic according to Spotify's own field definitions. These heuristics work well for coarse sorting, but you should validate any threshold you rely on against labeled tracks or observed user behavior before shipping a feature that depends on it.
Audio-analysis structure: bars, beats, segments, and confidence
The audio-analysis endpoint returns a much heavier payload: time-aligned structures plus metadata describing how confident the analyzer is in its own output. The top-level meta and track objects include fields like analyzer_version, analysis_sample_rate, tempo_confidence, and key_confidence, all worth logging alongside your parsed data.
Inside the response you get several nested arrays, each suited to a different job:
- Bars and beats: rhythmic grid markers useful for beat-synchronous animations or auto-editing.
- Tatums: the smallest regular rhythmic pulse, finer than beats.
- Sections: larger structural blocks (verse, chorus) with their own tempo, key, and loudness.
- Segments: short slices of audio carrying pitch and timbre data, the building blocks for detailed sound analysis.
Each segment includes a 12-class chroma vector representing pitch content and a 12-value timbre vector describing tone color, neither of which is bounded the way audio-features values are. Preserve the confidence fields (tempo_confidence, key_confidence, and per-segment confidence) whenever you store analysis data, since low-confidence estimates should be treated differently from high-confidence ones downstream.
Choosing an OAuth flow and handling tokens correctly
Your authentication choice depends on whose data you're touching. For public catalog lookups from a server, use Client Credentials: it returns an access_token, token_type, and expires_in, and it cannot reach anything scoped to a specific user. For anything acting on a user's behalf from a browser or mobile app, use Authorization Code with PKCE, which avoids storing a client secret in an environment you don't control.
- Confirm whether your call needs user context; if not, default to Client Credentials for simplicity.
- For PKCE, generate a code verifier and an S256 code challenge, match your redirect URI exactly, and pass a state value to prevent CSRF.
- Cache every token until its expires_in value runs out instead of requesting a new one per call.
- Request only the scopes your feature actually needs.
Matching your use case to the right endpoint
Audio-features and audio-analysis solve different problems, and picking the wrong one wastes both quota and development time. Ranking, clustering, mood-based playlist filters, and recommendation scoring all run fine on audio-features alone. Beat-synchronous visualizers, DJ tooling, and segment-level editing need audio-analysis, since that's where the timing and timbre detail lives.
A pipeline that scales well follows this order:
- Resolve and validate Spotify track IDs before making any feature calls.
- Fetch audio-features in bulk and persist the raw JSON along with a retrieval timestamp.
- Request audio-analysis only for the subset of tracks that actually need time-aligned detail.
This sequencing keeps storage and quota costs down while leaving room to drill into specific tracks later, an approach Spotify's own API reference recommends directly.
Batch requests and response-handling patterns
Audio-features supports batch lookups of up to 100 track IDs per request, which matters if you're processing whole playlists or libraries. Design your iteration around that batch size rather than looping one track at a time.
- Chunk playlist track IDs into groups of 100 before calling audio-features.
- Persist each raw response as received, then compute rolling averages for signature metrics like energy, danceability, and valence across a playlist or artist catalog.
- Check every field for null values before using them in scoring logic, since some tracks return incomplete data.
- Gate any audio-analysis field behind its confidence score so a low-confidence key or tempo estimate doesn't silently corrupt a downstream calculation.
Storing raw JSON rather than just derived scores also protects you when you need to recompute a signature after changing your weighting logic, without another round trip to the API.
Platform access changes you need to audit first
Spotify tightened Web API access in a November 2024 update that restricted several endpoints, including Audio Features and Audio Analysis, for new applications, while existing extended-access apps kept working. A February 2026 update refined Development Mode further: client ID limits, quota counted per developer account rather than per app, and a clearer 429 response carrying a reason field.
Before writing a line of integration code, run through this:
- Check your app's access mode in the developer dashboard.
- Confirm whether your use case requires extended access or falls under Development Mode limits.
- Review the migration guide for renamed or replaced endpoint behavior.
How Playlist Pilot applies audio feature data to playlist fit
Playlist Pilot combines audio features, genre, and mood signals to match independent artists' songs with human-curated playlists, then generates a personalized pitch explaining the fit. The product reports an average 47% curator response rate from these AI-generated pitches, a figure documented in its own case study. Product teams building similar matching logic might reuse a comparable structure: a fit score, a plain-language match explanation, and a curator-fit rationale attached to each recommendation.
What production integrations get wrong
Validate every threshold against labeled data instead of trusting Spotify's defaults at face value, and always keep confidence fields attached to the estimates they qualify. Don't let an uncertain tempo or key estimate harden into displayed metadata, and never build a UX decision on a single feature value alone. Audit access eligibility before you write integration code, and design your app to degrade gracefully if an endpoint becomes unavailable.
— Zander
A ready-made alternative for artists who don't want to build
Building an integration around audio-features and audio-analysis takes real engineering time, and most independent artists just want their songs in front of the right curators. Playlist Pilot applies that same audio and mood analysis on your behalf, matching your tracks to real, human-curated playlists and generating a personalized pitch for each one, without charging per pitch.
If building your own pipeline isn't the goal, you can check Playlist Pilot's plans and start matching your catalog to curators today.
Official docs and migration guides worth bookmarking
Keep the audio-features reference, audio-analysis reference, and February 2026 migration guide close at hand, along with practical Spotify discovery tips for context on curator behavior.
Ready to Get Real Playlist Placements?
Join Playlist Pilot and connect with curators who'll actually listen to your music.
