API REFERENCE
Get Artist Top Tracks
On this page
/api/spotify/artist/topTracksGet an artist's top tracks by country.
Authentication
See the authentication guide for API key and account access requirements.
Request
curl --request GET \
--url 'https://api.recoupable.dev/api/spotify/artist/topTracks?id=YOUR_ID' \
--header 'x-api-key: YOUR_API_KEY'Replace the YOUR_ placeholders with your values. Required query parameters are included; optional parameters are listed below.
Parameters
Query parameters
idstringrequiredThe Spotify ID of the artist
marketstringAn ISO 3166-1 alpha-2 country code. If provided, only tracks available in that market are returned
Responses
200Artist top tracks retrieved successfully+
application/json
tracksarray<SpotifyTrack>Array of track objects
Item properties for tracks
albumobjectThe album the track appears on
Properties for album
album_typestring · enumThe type of the album
Values: "album", "single", "compilation"
total_tracksintegerThe number of tracks in the album
available_marketsarray<string>Markets in which the album is available
Item properties for available_markets
string
external_urlsobjectProperties for external_urls
spotifystringThe Spotify URL for the object
hrefstringA link to the Web API endpoint providing full details
idstringThe Spotify ID for the album
imagesarray<SpotifyImage>The cover art for the album in various sizes
Item properties for images
urlstringThe source URL of the image
heightintegernullableThe image height in pixels
widthintegernullableThe image width in pixels
namestringThe name of the album
release_datestringThe date the album was first released
release_date_precisionstring · enumThe precision with which release_date value is known
Values: "year", "month", "day"
restrictionsobjectIncluded when a content restriction is applied
Properties for restrictions
reasonstringThe reason for the restriction
typestring · enumThe object type, always 'album'
Values: "album"
uristringThe Spotify URI for the album
artistsarray<SpotifySimplifiedArtist>The artists of the album
Item properties for artists
external_urlsobjectProperties for external_urls
spotifystringThe Spotify URL for the object
hrefstringA link to the Web API endpoint providing full details
idstringThe Spotify ID for the artist
namestringThe name of the artist
typestring · enumThe object type, always 'artist'
Values: "artist"
uristringThe Spotify URI for the artist
album_groupstring · enumThe field to distinguish albums by various groups
Values: "album", "single", "compilation", "appears_on"
artistsarray<SpotifySimplifiedArtist>Artists who performed the track
Item properties for artists
external_urlsobjectProperties for external_urls
spotifystringThe Spotify URL for the object
hrefstringA link to the Web API endpoint providing full details
idstringThe Spotify ID for the artist
namestringThe name of the artist
typestring · enumThe object type, always 'artist'
Values: "artist"
uristringThe Spotify URI for the artist
available_marketsarray<string>Markets in which the track is available
Item properties for available_markets
string
disc_numberintegerDisc number the track is on
duration_msintegerTrack length in milliseconds
explicitbooleanWhether the track has explicit lyrics
external_idsobjectKnown external IDs for the track
Properties for external_ids
isrcstringInternational Standard Recording Code
eanstringInternational Article Number
upcstringUniversal Product Code
external_urlsobjectProperties for external_urls
spotifystringThe Spotify URL for the object
hrefstringLink to the Web API endpoint with full details
idstringSpotify ID for the track
is_playablebooleanIf true, the track is playable in the given market
linked_fromobjectInformation about the originally requested track when track relinking is applied
restrictionsobjectContent restriction information
Properties for restrictions
reasonstringThe reason for the restriction
namestringTrack name
popularityintegerPopularity score (0-100)
preview_urlstringnullableURL to a 30 second preview, if available
track_numberintegerTrack number on the album
typestring · enumThe object type, always 'track'
Values: "track"
uristringThe Spotify URI for the track
is_localbooleanWhether the track is from a local file
400Bad request - missing required parameters+
application/json
errorobjectError details
Properties for error
statusintegerHTTP status code
messagestringError message
Full specification
Download the OpenAPI file for complete schemas, constraints, and examples.
Download social.jsonView operation source
{
"description": "Get an artist's top tracks by country.",
"parameters": [
{
"name": "id",
"in": "query",
"description": "The Spotify ID of the artist",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "market",
"in": "query",
"description": "An ISO 3166-1 alpha-2 country code. If provided, only tracks available in that market are returned",
"required": false,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Artist top tracks retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SpotifyArtistTopTracksResponse"
}
}
}
},
"400": {
"description": "Bad request - missing required parameters",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SpotifyErrorResponse"
}
}
}
}
}
}