Search + K

Command Palette

Search for a command to run...

Sign In

Get Track's Audio Analysis

Deprecated
GET /audio-analysis/{id}
Copy endpoint
https://api.spotify.com/v1

Get a low-level audio analysis for a track in the Spotify catalog. The audio analysis describes the track’s structure and musical content, including rhythm, pitch, and timbre.

Parameters

path Path Parameters

Name Type
id required
string

Responses

200 application/json

Audio analysis for one track

interface AudioAnalysisObject {
meta?: {
analyzer_version?: string;
platform?: string;
detailed_status?: string;
status_code?: number;
timestamp?: number;
analysis_time?: number;
input_process?: string;
}
;
track?: {
num_samples?: number;
duration?: number;
sample_md5?: string;
offset_seconds?: number;
window_seconds?: number;
analysis_sample_rate?: number;
analysis_channels?: number;
end_of_fade_in?: number;
start_of_fade_out?: number;
loudness?: Loudness

The overall loudness of a track in decibels (dB). Loudness values are averaged across the entire track and are useful for comparing relative loudness of tracks. Loudness is the quality of a sound that is the primary psychological correlate of physical strength (amplitude). Values typically range between -60 and 0 db.

type Loudness = number
;
tempo?: Tempo

The overall estimated tempo of a track in beats per minute (BPM). In musical terminology, tempo is the speed or pace of a given piece and derives directly from the average beat duration.

type Tempo = number
;
tempo_confidence?: number;
time_signature?: TimeSignature

An estimated time signature. The time signature (meter) is a notational convention to specify how many beats are in each bar (or measure). The time signature ranges from 3 to 7 indicating time signatures of "3/4", to "7/4".

type TimeSignature = number
;
time_signature_confidence?: number;
key?: Key

The key the track is in. Integers map to pitches using standard Pitch Class notation. E.g. 0 = C, 1 = C♯/D♭, 2 = D, and so on. If no key was detected, the value is -1.

type Key = number
;
key_confidence?: number;
mode?: Mode

Mode indicates the modality (major or minor) of a track, the type of scale from which its melodic content is derived. Major is represented by 1 and minor is 0.

type Mode = number
;
mode_confidence?: number;
codestring?: string;
code_version?: number;
echoprintstring?: string;
echoprint_version?: number;
synchstring?: string;
synch_version?: number;
rhythmstring?: string;
rhythm_version?: number;
}
;
bars?: TimeIntervalObject
interface TimeIntervalObject {
start?: number;
duration?: number;
confidence?: number;
}
[]
;
beats?: TimeIntervalObject
interface TimeIntervalObject {
start?: number;
duration?: number;
confidence?: number;
}
[]
;
sections?: SectionObject
interface SectionObject {
start?: number;
duration?: number;
confidence?: number;
loudness?: number;
tempo?: number;
tempo_confidence?: number;
key?: number;
key_confidence?: number;
mode?: -1 | 0 | 1;
mode_confidence?: number;
time_signature?: TimeSignature;
time_signature_confidence?: number;
}
[]
;
segments?: SegmentObject
interface SegmentObject {
start?: number;
duration?: number;
confidence?: number;
loudness_start?: number;
loudness_max?: number;
loudness_max_time?: number;
loudness_end?: number;
pitches?: number[];
timbre?: number[];
}
[]
;
tatums?: TimeIntervalObject
interface TimeIntervalObject {
start?: number;
duration?: number;
confidence?: number;
}
[]
;
}

Client Errors

401 application/json

Bad or expired token. This can happen if the user revoked a token or the access token has expired. You should re-authenticate the user.

{ error: ErrorObject
interface ErrorObject {
status: number;
message: string;
}
; }
403 application/json

Bad OAuth request (wrong consumer key, bad nonce, expired timestamp...). Unfortunately, re-authenticating the user won't help here.

{ error: ErrorObject
interface ErrorObject {
status: number;
message: string;
}
; }
429 application/json

The app has exceeded its rate limits.

{ error: ErrorObject
interface ErrorObject {
status: number;
message: string;
}
; }