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 Analysis for a Track

GET
/audio-analysis/{id}
category-tracks
Get a detailed audio analysis for a single track identified by its unique
Spotify ID.
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://api.spotify.com/audio-analysis/' \
--header 'Authorization;'
响应示例响应示例
200 - 示例 1
{
  "bars": [
    {
      "confidence": 0,
      "duration": 0,
      "start": 0
    }
  ],
  "beats": [
    {
      "confidence": 0,
      "duration": 0,
      "start": 0
    }
  ],
  "sections": [
    {
      "confidence": 0,
      "duration": 0,
      "key": 0,
      "key_confidence": 0,
      "loudness": 0,
      "mode": 0,
      "mode_confidence": 0,
      "start": 0,
      "tempo": 0,
      "tempo_confidence": 0,
      "time_signature": 0,
      "time_signature_confidence": 0
    }
  ],
  "segments": [
    {
      "confidence": 0,
      "duration": 0,
      "loudness_end": 0,
      "loudness_max": 0,
      "loudness_max_time": 0,
      "loudness_start": 0,
      "pitches": [
        0
      ],
      "start": 0,
      "timbre": [
        0
      ]
    }
  ],
  "tatums": [
    {
      "confidence": 0,
      "duration": 0,
      "start": 0
    }
  ]
}

请求参数

Path 参数
id
必需
The Spotify ID for the track.
Header 参数
Authorization
必需
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 audio analysis object in JSON format. On error, the header status code is an [error code](https://developer.spotify.com/documentation/web-api/#response-s
application/json
Body
bars
array[object (TimeIntervalObject) {3}] 
可选
The time intervals of the bars throughout the track. A bar (or measure) is a segment of time defined as a given number of beats. Bar offsets also indicate downbeats, the first beat of the measure.
confidence
number 
可选
The confidence, from 0.0 to 1.0, of the reliability of the interval.
duration
number 
可选
The duration (in seconds) of the time interval.
start
number 
可选
The starting point (in seconds) of the time interval.
beats
array[object (TimeIntervalObject) {3}] 
可选
The time intervals of beats throughout the track. A beat is the basic time unit of a piece of music; for example, each tick of a metronome. Beats are typically multiples of tatums.
confidence
number 
可选
The confidence, from 0.0 to 1.0, of the reliability of the interval.
duration
number 
可选
The duration (in seconds) of the time interval.
start
number 
可选
The starting point (in seconds) of the time interval.
sections
array[object (SectionObject) {12}] 
可选
Sections are defined by large variations in rhythm or timbre, e.g. chorus, verse, bridge, guitar solo, etc. Each section contains its own descriptions of tempo, key, mode, time_signature, and loudness.
confidence
number 
可选
The confidence, from 0.0 to 1.0, of the reliability of the section’s "designation".
duration
number 
可选
The duration (in seconds) of the section.
key
integer <int32>
可选
key_confidence
number 
可选
loudness
number 
可选
The overall loudness of the section in decibels (dB). Loudness values are useful for comparing relative loudness of sections within tracks.
mode
integer <int32>
可选
mode_confidence
number 
可选
start
number 
可选
The starting point (in seconds) of the section.
tempo
number 
可选
The overall estimated tempo of the section 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.
tempo_confidence
number 
可选
time_signature
integer <int32>
可选
time_signature_confidence
number 
可选
segments
array[object (SegmentObject) {9}] 
可选
Audio segments attempts to subdivide a song into many segments, with each segment containing a roughly consistent sound throughout its duration.
confidence
number 
可选
duration
number 
可选
loudness_end
number 
可选
loudness_max
number 
可选
loudness_max_time
number 
可选
loudness_start
number 
可选
pitches
array[number]
可选
start
number 
可选
timbre
array[number]
可选
tatums
array[object (TimeIntervalObject) {3}] 
可选
A tatum represents the lowest regular pulse train that a listener intuitively infers from the timing of perceived musical events (segments).
confidence
number 
可选
The confidence, from 0.0 to 1.0, of the reliability of the interval.
duration
number 
可选
The duration (in seconds) of the time interval.
start
number 
可选
The starting point (in seconds) of the time interval.
🔴500500
上一页
Get an Artist's Top Tracks
下一页
Get Audio Features for Several Tracks
Built with