Spotify Web API
  1. category-tracks
Spotify Web API
  • category-albums
    • Get Multiple Albums
      GET
    • Get an Album
      GET
    • Get an Album's Tracks
      GET
  • category-artists
    • Get Multiple Artists
      GET
    • Get an Artist
      GET
    • Get an Artist's Albums
      GET
    • Get an Artist's Related Artists
      GET
    • Get an Artist's Top Tracks
      GET
  • category-tracks
    • Get Audio Analysis for a Track
      GET
    • Get Audio Features for Several Tracks
      GET
    • Get Audio Features for a Track
      GET
    • Get Several Tracks
      GET
    • Get a Track
      GET
  • category-browse
    • Get All Categories
      GET
    • Get a Category
      GET
    • Get a Category's Playlists
      GET
    • Get All Featured Playlists
      GET
    • Get All New Releases
      GET
    • Get Recommendations
      GET
    • Get Recommendation Genres
      GET
  • category-episodes
    • Get Multiple Episodes
      GET
    • Get an Episode
      GET
  • category-markets
    • Get Available Markets
      GET
  • category-users-profile
    • Get Current User's Profile
    • Get a User's Profile
  • category-library
    • Remove Albums for Current User
    • Get User's Saved Albums
    • Save Albums for Current User
    • Check User's Saved Albums
    • Remove User's Saved Episodes
    • Get User's Saved Episodes
    • Save Episodes for User
    • Check User's Saved Episodes
    • Remove User's Saved Shows
    • Get User's Saved Shows
    • Save Shows for Current User
    • Check User's Saved Shows
    • Remove User's Saved Tracks
    • Get User's Saved Tracks
    • Save Tracks for User
    • Check User's Saved Tracks
  • category-follow
    • Unfollow Artists or Users
    • Get User's Followed Artists
    • Follow Artists or Users
    • Get Following State for Artists/Users
    • Unfollow Playlist
    • Follow a Playlist
    • Check if Users Follow a Playlist
  • category-player
    • Get Information About The User's Current Playback
    • Transfer a User's Playback
    • Get the User's Currently Playing Track
    • Get a User's Available Devices
    • Skip User’s Playback To Next Track
    • Pause a User's Playback
    • Start/Resume a User's Playback
    • Skip User’s Playback To Previous Track
    • Add an item to queue
    • Get Current User's Recently Played Tracks
    • Set Repeat Mode On User’s Playback
    • Seek To Position In Currently Playing Track
    • Toggle Shuffle For User’s Playback
    • Set Volume For User's Playback
  • category-playlists
    • Get a List of Current User's Playlists
    • Get a Playlist
    • Change a Playlist's Details
    • Get a Playlist Cover Image
    • Upload a Custom Playlist Cover Image
    • Remove Items from a Playlist
    • Get a Playlist's Items
    • Add Items to a Playlist
    • Reorder or Replace a Playlist's Items
    • Get a List of a User's Playlists
    • Create a Playlist
  • category-personalization
    • Get a User's Top Artists and Tracks
  • category-search
    • Search for an Item
  • category-shows
    • Get Multiple Shows
    • Get a Show
    • Get a Show's Episodes
  1. category-tracks

Get Audio Features for Several Tracks

GET
/audio-features
category-tracks
Get audio features for multiple tracks based on their Spotify IDs.
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://api.spotify.com/audio-features?ids=' \
--header 'Authorization;'
响应示例响应示例
200 - 示例 1
{
  "audio_features": [
    {
      "acousticness": 0,
      "analysis_url": "string",
      "danceability": 0,
      "duration_ms": 0,
      "energy": 0,
      "id": "string",
      "instrumentalness": 0,
      "key": 0,
      "liveness": 0,
      "loudness": 0,
      "mode": 0,
      "speechiness": 0,
      "tempo": 0,
      "time_signature": 0,
      "track_href": "string",
      "type": "string",
      "uri": "string",
      "valence": 0
    }
  ]
}

请求参数

Query 参数
ids
必需
A comma-separated list of the Spotify IDs for the tracks. Maximum: 100 IDs.
Header 参数
Authorization
必需
A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.

返回响应

🟢200On success, the HTTP status code in the response header is `200 OK` and the response body contains an object whose key is `"audio_features"` and whose value is an array of audio features objects in JSON format. Objects are returned in the order requested
application/json
Body
audio_features
array[object (AudioFeaturesObject) {18}] 
可选
acousticness
number 
可选
A confidence measure from 0.0 to 1.0 of whether the track is acoustic. 1.0 represents high confidence the track is acoustic.
analysis_url
string 
可选
An HTTP URL to access the full audio analysis of this track. An access token is required to access this data.
danceability
number 
可选
Danceability describes how suitable a track is for dancing based on a combination of musical elements including tempo, rhythm stability, beat strength, and overall regularity. A value of 0.0 is least danceable and 1.0 is most danceable.
duration_ms
integer <int32>
可选
The duration of the track in milliseconds.
energy
number 
可选
Energy is a measure from 0.0 to 1.0 and represents a perceptual measure of intensity and activity. Typically, energetic tracks feel fast, loud, and noisy. For example, death metal has high energy, while a Bach prelude scores low on the scale. Perceptual features contributing to this attribute include dynamic range, perceived loudness, timbre, onset rate, and general entropy.
id
string 
可选
The Spotify ID for the track.
instrumentalness
number 
可选
Predicts whether a track contains no vocals. "Ooh" and "aah" sounds are treated as instrumental in this context. Rap or spoken word tracks are clearly "vocal". The closer the instrumentalness value is to 1.0, the greater likelihood the track contains no vocal content. Values above 0.5 are intended to represent instrumental tracks, but confidence is higher as the value approaches 1.0.
key
integer <int32>
可选
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.
liveness
number 
可选
Detects the presence of an audience in the recording. Higher liveness values represent an increased probability that the track was performed live. A value above 0.8 provides strong likelihood that the track is live.
loudness
number 
可选
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 typical range between -60 and 0 db.
mode
integer <int32>
可选
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.
speechiness
number 
可选
Speechiness detects the presence of spoken words in a track. The more exclusively speech-like the recording (e.g. talk show, audio book, poetry), the closer to 1.0 the attribute value. Values above 0.66 describe tracks that are probably made entirely of spoken words. Values between 0.33 and 0.66 describe tracks that may contain both music and speech, either in sections or layered, including such cases as rap music. Values below 0.33 most likely represent music and other non-speech-like tracks.
tempo
number 
可选
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.
time_signature
integer <int32>
可选
An estimated overall time signature of a track. The time signature (meter) is a notational convention to specify how many beats are in each bar (or measure).
track_href
string 
可选
A link to the Web API endpoint providing full details of the track.
type
string 
可选
The object type: "audio_features"
uri
string 
可选
The Spotify URI for the track.
valence
number 
可选
A measure from 0.0 to 1.0 describing the musical positiveness conveyed by a track. Tracks with high valence sound more positive (e.g. happy, cheerful, euphoric), while tracks with low valence sound more negative (e.g. sad, depressed, angry).
🔴500500
上一页
Get Audio Analysis for a Track
下一页
Get Audio Features for a Track
Built with