Get Track's Audio Features
Deprecated
client.audioFeatures.retrieve(stringid, RequestOptionsoptions?): AudioFeatureRetrieveResponse { id, acousticness, analysis_url, 16 more }
GET/audio-features/{id}
Get audio feature information for a single track identified by its unique Spotify ID.
Parameters
Returns
Get Track's Audio Features
import Spotted from 'spotted-ts';
const client = new Spotted({
accessToken: process.env['SPOTIFY_ACCESS_TOKEN'], // This is the default and can be omitted
});
const audioFeature = await client.audioFeatures.retrieve('11dFghVXANMlKmJXsNCbNl');
console.log(audioFeature.id);{
"id": "2takcwOaAZWiXQijPHIx7B",
"acousticness": 0.00242,
"analysis_url": "https://api.spotify.com/v1/audio-analysis/2takcwOaAZWiXQijPHIx7B\n",
"danceability": 0.585,
"duration_ms": 237040,
"energy": 0.842,
"instrumentalness": 0.00686,
"key": 9,
"liveness": 0.0866,
"loudness": -5.883,
"mode": 0,
"published": true,
"speechiness": 0.0556,
"tempo": 118.211,
"time_signature": 4,
"track_href": "https://api.spotify.com/v1/tracks/2takcwOaAZWiXQijPHIx7B\n",
"type": "audio_features",
"uri": "spotify:track:2takcwOaAZWiXQijPHIx7B",
"valence": 0.428
}Returns Examples
{
"id": "2takcwOaAZWiXQijPHIx7B",
"acousticness": 0.00242,
"analysis_url": "https://api.spotify.com/v1/audio-analysis/2takcwOaAZWiXQijPHIx7B\n",
"danceability": 0.585,
"duration_ms": 237040,
"energy": 0.842,
"instrumentalness": 0.00686,
"key": 9,
"liveness": 0.0866,
"loudness": -5.883,
"mode": 0,
"published": true,
"speechiness": 0.0556,
"tempo": 118.211,
"time_signature": 4,
"track_href": "https://api.spotify.com/v1/tracks/2takcwOaAZWiXQijPHIx7B\n",
"type": "audio_features",
"uri": "spotify:track:2takcwOaAZWiXQijPHIx7B",
"valence": 0.428
}