Get Spotify catalog information about an artist’s top tracks by country.

Endpoint

GET https://api.spotify.com/v1/artists/{id}/top-tracks

Request Parameters

Path element
Value
id
The Spotify ID for the artist.

Query parameter
Value
country
Required. The country: an ISO 3166-1 alpha-2 country code.

Response Format

On success, the HTTP status code in the response header is 200 OK and the response body contains an object whose key is "tracks" and whose value is an array of up to 10 track objects in JSON format. On error, the header status code is an error code and the response body contains an error object.

The 10 maximum tracks are the ones displayed by the Spotify app. If you want to fetch more artist’s top tracks, an alternative way is to use Echo Nest song/search to accomplish this. It will accept a Spotify artist id for input and give you Spotify id’s in the output.

Example

curl -X "GET https://api.spotify.com/v1/artists/43ZHCT0cAZBISjO8DG9PnE/top-tracks?country=SE"
{
  "tracks": [ {
    "album": {
      "album_type": "album",
      "available_markets": [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ],
      "external_urls": {
        "spotify": "https://open.spotify.com/album/34EYk8vvJHCUlNrpGxepea"
      },
      "href": "https://api.spotify.com/v1/albums/34EYk8vvJHCUlNrpGxepea",
      "id": "34EYk8vvJHCUlNrpGxepea",
      "images": [ {
        "height": 640,
        "url": "https://i.scdn.co/image/6324fe377dcedf110025527873dafc9b7ee0bb34",
        "width": 640
      }, {
        "height": 300,
        "url": "https://i.scdn.co/image/d2e2148023e8a87b7a2f8d2abdfa936154e470b8",
        "width": 300
      }, {
        "height": 64,
        "url": "https://i.scdn.co/image/af45f7b48d8a4c7252e1b1ad9240ed8b08c06b31",
        "width": 64
      } ],
      "name": "Elvis 75 - Good Rockin' Tonight",
      "type": "album",
      "uri": "spotify:album:34EYk8vvJHCUlNrpGxepea"
    },
    "artists": [ {
      "external_urls": {
        "spotify": "https://open.spotify.com/artist/43ZHCT0cAZBISjO8DG9PnE"
      },
      "href": "https://api.spotify.com/v1/artists/43ZHCT0cAZBISjO8DG9PnE",
      "id": "43ZHCT0cAZBISjO8DG9PnE",
      "name": "Elvis Presley",
      "type": "artist",
      "uri": "spotify:artist:43ZHCT0cAZBISjO8DG9PnE"
    } ],
    "available_markets": [ "AD", "AR", "AT", "AU", "BE", "BG", "BO", "BR", "CA", "CH", "CL", "CO", "CR", "CY", "CZ", "DE", "DK", "DO", "EC", "EE", "ES", "FI", "FR", "GB", "GR", "GT", "HK", "HN", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MC", "MT", "MX", "MY", "NI", "NL", "NO", "NZ", "PA", "PE", "PH", "PL", "PT", "PY", "RO", "SE", "SG", "SI", "SK", "SV", "TR", "TW", "US", "UY" ],
    "disc_number": 3,
    "duration_ms": 260973,
    "explicit": false,
    "external_ids": {
      "isrc": "USRC16901355"
    },
    "external_urls": {
      "spotify": "https://open.spotify.com/track/6fgjU6IfBOXHI3OKtndEeE"
    },
    "href": "https://api.spotify.com/v1/tracks/6fgjU6IfBOXHI3OKtndEeE",
    "id": "6fgjU6IfBOXHI3OKtndEeE",
    "name": "Suspicious Minds",
    "popularity": 70,
    "preview_url": "https://p.scdn.co/mp3-preview/3742af306537513a4f446d7c8f9cdb1cea6e36d1",
    "track_number": 19,
    "type": "track",
    "uri": "spotify:track:6fgjU6IfBOXHI3OKtndEeE"
  }, {
...
  } ]
}

Try it in our Web API Console

track object (full)

Key
Value Type
Value Description
album
a simplified album object
The album on which the track appears. The album object includes a link in href to full information about the album.
artists
an array of simplified artist objectsThe artists who performed the track. Each artist object includes a link in href to more detailed information about the artist.
available_markets
array of strings
A list of the countries in which the track can be played, identified by their ISO 3166-1 alpha-2 code.
disc_number
integer
The disc number (usually 1 unless the album consists of more than one disc).
duration_ms
integer
The track length in milliseconds.
explicit
Boolean
Whether or not the track has explicit lyrics (true = yes it does; false = no it does not OR unknown).
external_ids
an external ID objectKnown external IDs for the track.
external_urlsan external URL objectKnown external URLs for this track.
hrefstringA link to the Web API endpoint providing full details of the track.
id
stringThe Spotify ID for the track.
is_playablebooleanPart of the response when Track Relinking is applied. If true, the track is playable in the given market. Otherwise false.
linked_froma linked track objectPart of the response when Track Relinking is applied, and the requested track has been replaced with different track. The track in the linked_from object contains information about the originally requested track.
name
string
The name of the track.
popularity
integer
The popularity of the track. The value will be between 0 and 100, with 100 being the most popular.

The popularity of a track is a value between 0 and 100, with 100 being the most popular. The popularity is calculated by algorithm and is based, in the most part, on the total number of plays the track has had and how recent those plays are.

Generally speaking, songs that are being played a lot now will have a higher popularity than songs that were played a lot in the past. Duplicate tracks (e.g. the same track from a single and an album) are rated independently. Artist and album popularity is derived mathematically from track popularity. Note that the popularity value may lag actual popularity by a few days: the value is not updated in real time.
preview_url
string
A link to a 30 second preview (MP3 format) of the track.
track_number
integer
The number of the track. If an album has several discs, the track number is the number on the specified disc.
type
stringThe object type: "track".
uristringThe Spotify URI for the track.