cURL
curl --request GET \
--url https://api.recoupable.com/api/spotify/artist/topTracksimport requests
url = "https://api.recoupable.com/api/spotify/artist/topTracks"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.recoupable.com/api/spotify/artist/topTracks', 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://api.recoupable.com/api/spotify/artist/topTracks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.recoupable.com/api/spotify/artist/topTracks"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.recoupable.com/api/spotify/artist/topTracks")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recoupable.com/api/spotify/artist/topTracks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"tracks": [
{
"album": {
"total_tracks": 123,
"available_markets": [
"<string>"
],
"external_urls": {
"spotify": "<string>"
},
"href": "<string>",
"id": "<string>",
"images": [
{
"url": "<string>",
"height": 123,
"width": 123
}
],
"name": "<string>",
"release_date": "<string>",
"restrictions": {
"reason": "<string>"
},
"type": "album",
"uri": "<string>",
"artists": [
{
"external_urls": {
"spotify": "<string>"
},
"href": "<string>",
"id": "<string>",
"name": "<string>",
"type": "artist",
"uri": "<string>"
}
]
},
"artists": [
{
"external_urls": {
"spotify": "<string>"
},
"href": "<string>",
"id": "<string>",
"name": "<string>",
"type": "artist",
"uri": "<string>"
}
],
"available_markets": [
"<string>"
],
"disc_number": 123,
"duration_ms": 123,
"explicit": true,
"external_ids": {
"isrc": "<string>",
"ean": "<string>",
"upc": "<string>"
},
"external_urls": {
"spotify": "<string>"
},
"href": "<string>",
"id": "<string>",
"is_playable": true,
"linked_from": {},
"restrictions": {
"reason": "<string>"
},
"name": "<string>",
"popularity": 123,
"preview_url": "<string>",
"track_number": 123,
"type": "track",
"uri": "<string>",
"is_local": true
}
]
}{
"error": {
"status": 123,
"message": "<string>"
}
}Spotify
Get Artist Top Tracks
Get an artist’s top tracks by country.
GET
/
api
/
spotify
/
artist
/
topTracks
cURL
curl --request GET \
--url https://api.recoupable.com/api/spotify/artist/topTracksimport requests
url = "https://api.recoupable.com/api/spotify/artist/topTracks"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.recoupable.com/api/spotify/artist/topTracks', 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://api.recoupable.com/api/spotify/artist/topTracks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.recoupable.com/api/spotify/artist/topTracks"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.recoupable.com/api/spotify/artist/topTracks")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recoupable.com/api/spotify/artist/topTracks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"tracks": [
{
"album": {
"total_tracks": 123,
"available_markets": [
"<string>"
],
"external_urls": {
"spotify": "<string>"
},
"href": "<string>",
"id": "<string>",
"images": [
{
"url": "<string>",
"height": 123,
"width": 123
}
],
"name": "<string>",
"release_date": "<string>",
"restrictions": {
"reason": "<string>"
},
"type": "album",
"uri": "<string>",
"artists": [
{
"external_urls": {
"spotify": "<string>"
},
"href": "<string>",
"id": "<string>",
"name": "<string>",
"type": "artist",
"uri": "<string>"
}
]
},
"artists": [
{
"external_urls": {
"spotify": "<string>"
},
"href": "<string>",
"id": "<string>",
"name": "<string>",
"type": "artist",
"uri": "<string>"
}
],
"available_markets": [
"<string>"
],
"disc_number": 123,
"duration_ms": 123,
"explicit": true,
"external_ids": {
"isrc": "<string>",
"ean": "<string>",
"upc": "<string>"
},
"external_urls": {
"spotify": "<string>"
},
"href": "<string>",
"id": "<string>",
"is_playable": true,
"linked_from": {},
"restrictions": {
"reason": "<string>"
},
"name": "<string>",
"popularity": 123,
"preview_url": "<string>",
"track_number": 123,
"type": "track",
"uri": "<string>",
"is_local": true
}
]
}{
"error": {
"status": 123,
"message": "<string>"
}
}Was this page helpful?
⌘I
