Get track detail
curl --request GET \
--url https://spotify-api31.p.rapidapi.com/api/v1/tracks/detail \
--header 'x-rapidapi-key: <api-key>'import requests
url = "https://spotify-api31.p.rapidapi.com/api/v1/tracks/detail"
headers = {"x-rapidapi-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-rapidapi-key': '<api-key>'}};
fetch('https://spotify-api31.p.rapidapi.com/api/v1/tracks/detail', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://spotify-api31.p.rapidapi.com/api/v1/tracks/detail",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-rapidapi-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://spotify-api31.p.rapidapi.com/api/v1/tracks/detail"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-rapidapi-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://spotify-api31.p.rapidapi.com/api/v1/tracks/detail")
.header("x-rapidapi-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://spotify-api31.p.rapidapi.com/api/v1/tracks/detail")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-rapidapi-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "Success",
"statusCode": 200,
"pagination": {
"total": 100,
"hasMore": true,
"continuation": "CDsQ8FsiEwje95_F1pmRAxXlsykDHUX"
},
"data": {
"id": "4WNcduiCmDNfmTEz7JvmLv",
"name": "In Control (feat. Selin)",
"uri": "spotify:track:4WNcduiCmDNfmTEz7JvmLv",
"trackNumber": 1,
"duration": {
"totalMilliseconds": 179232
},
"playability": {
"playable": true,
"reason": "PLAYABLE"
},
"playcount": "17997692",
"saved": false,
"sharingInfo": {
"shareId": "lrcoeILvR_2AEDoc5PlckA",
"shareUrl": "https://open.spotify.com/track/4WNcduiCmDNfmTEz7JvmLv?si=lrcoeILvR_2AEDoc5PlckA"
},
"contentRating": {
"label": "NONE"
},
"mediaType": "AUDIO",
"album": {
"id": "1B68g8b4wpedNDvvQLAoCe",
"name": "In Control (feat. Selin)",
"uri": "spotify:album:1B68g8b4wpedNDvvQLAoCe",
"type": "SINGLE",
"date": {
"isoString": "2020-10-30T00:00:00Z",
"precision": "DAY",
"year": 2020
},
"coverArts": [
{
"url": "https://i.scdn.co/image/ab67616d00001e02fa258529452f4ed34cc961b1",
"width": 300,
"height": 300
}
],
"playability": {
"playable": true
},
"sharingInfo": {
"shareId": "Blp9BsNdRKCnEHttGzyOGw",
"shareUrl": "https://open.spotify.com/album/1B68g8b4wpedNDvvQLAoCe?si=Blp9BsNdRKCnEHttGzyOGw"
},
"tracks": {
"totalCount": 1
}
},
"artists": [
{
"id": "3t8WiyalpvnB9AObcMufiE",
"name": "Mahmut Orhan",
"uri": "spotify:artist:3t8WiyalpvnB9AObcMufiE"
}
]
}
}{
"message": "Bad request"
}{
"message": "Invalid API key"
}{
"message": "You are not subscribed to this API, please subscribe before using"
}{
"success": false,
"message": "Internal Server Error",
"status_code": 500,
"cost": 0,
"explain": "Internal Server Error"
}Tracks
Get track detail
Get detailed information about a specific track
GET
/
api
/
v1
/
tracks
/
detail
Get track detail
curl --request GET \
--url https://spotify-api31.p.rapidapi.com/api/v1/tracks/detail \
--header 'x-rapidapi-key: <api-key>'import requests
url = "https://spotify-api31.p.rapidapi.com/api/v1/tracks/detail"
headers = {"x-rapidapi-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-rapidapi-key': '<api-key>'}};
fetch('https://spotify-api31.p.rapidapi.com/api/v1/tracks/detail', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://spotify-api31.p.rapidapi.com/api/v1/tracks/detail",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-rapidapi-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://spotify-api31.p.rapidapi.com/api/v1/tracks/detail"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-rapidapi-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://spotify-api31.p.rapidapi.com/api/v1/tracks/detail")
.header("x-rapidapi-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://spotify-api31.p.rapidapi.com/api/v1/tracks/detail")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-rapidapi-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "Success",
"statusCode": 200,
"pagination": {
"total": 100,
"hasMore": true,
"continuation": "CDsQ8FsiEwje95_F1pmRAxXlsykDHUX"
},
"data": {
"id": "4WNcduiCmDNfmTEz7JvmLv",
"name": "In Control (feat. Selin)",
"uri": "spotify:track:4WNcduiCmDNfmTEz7JvmLv",
"trackNumber": 1,
"duration": {
"totalMilliseconds": 179232
},
"playability": {
"playable": true,
"reason": "PLAYABLE"
},
"playcount": "17997692",
"saved": false,
"sharingInfo": {
"shareId": "lrcoeILvR_2AEDoc5PlckA",
"shareUrl": "https://open.spotify.com/track/4WNcduiCmDNfmTEz7JvmLv?si=lrcoeILvR_2AEDoc5PlckA"
},
"contentRating": {
"label": "NONE"
},
"mediaType": "AUDIO",
"album": {
"id": "1B68g8b4wpedNDvvQLAoCe",
"name": "In Control (feat. Selin)",
"uri": "spotify:album:1B68g8b4wpedNDvvQLAoCe",
"type": "SINGLE",
"date": {
"isoString": "2020-10-30T00:00:00Z",
"precision": "DAY",
"year": 2020
},
"coverArts": [
{
"url": "https://i.scdn.co/image/ab67616d00001e02fa258529452f4ed34cc961b1",
"width": 300,
"height": 300
}
],
"playability": {
"playable": true
},
"sharingInfo": {
"shareId": "Blp9BsNdRKCnEHttGzyOGw",
"shareUrl": "https://open.spotify.com/album/1B68g8b4wpedNDvvQLAoCe?si=Blp9BsNdRKCnEHttGzyOGw"
},
"tracks": {
"totalCount": 1
}
},
"artists": [
{
"id": "3t8WiyalpvnB9AObcMufiE",
"name": "Mahmut Orhan",
"uri": "spotify:artist:3t8WiyalpvnB9AObcMufiE"
}
]
}
}{
"message": "Bad request"
}{
"message": "Invalid API key"
}{
"message": "You are not subscribed to this API, please subscribe before using"
}{
"success": false,
"message": "Internal Server Error",
"status_code": 500,
"cost": 0,
"explain": "Internal Server Error"
}Authorizations
API Key
Query Parameters
Spotify track URI to get track details
Pattern:
^spotify:track:[a-zA-Z0-9]+$Example:
"spotify:track:4WNcduiCmDNfmTEz7JvmLv"
Was this page helpful?
⌘I

