Skip to main content

getAudioData

Fetch track analyzed audio data.

Under the hood, it uses the wg://audio-attributes/v1/audio-analysis/ endpoint, which is identical to Spotify Web API's Get Track's Audio Analysis. The only difference is that it doesn't require authentication.

caution

Beware, not all tracks have audio data.

function getAudioData(uri?: string): Promise<any>;

Parameters

ParameterTypeDescription
uristring | undefinedURI of the track. If not provided, it will use the current track.

Returns

An object containing the audio data. See the Spotify Web API reference for more details.

Example

// Get audio data from current track
const audioData = await Spicetify.getAudioData();

// Get audio data from a specific track
const audioData = await Spicetify.getAudioData("spotify:track:1qDrWA6lyx8cLECdZE7TV7");