Skip to content
Scrappa Get API key
Spotify API 1 credit/request

Spotify Artist Top Tracks

GET https://scrappa.co/api/spotify/artist/top-tracks

Get an artist's most popular tracks. This reads the artist overview response and costs no additional lookup.

Spotify Artist Top Tracks 1 credit/request

Endpoint

Request preview
GET
https://scrappa.co/api/spotify/artist/top-tracks
Auth header
x-api-key
Cost
1 credit/request
id = 1234567890
Response preview
200 OK
{
    "artist": {
        "id": "4tZwfgrHOc3mvqYlEYSvVi",
        "name": "Daft Punk"
    },
    "top_tracks": {
        "items": [
            {
                "uid": "5d99bb101e828b296cc3",
                "track": {
                    "id": "0DiWol3AO6WpXZgp0goxAV",
                    "uri": "spotify:track:0DiWol3AO6WpXZgp0goxAV",
                    "name": "One More Time",
                    "artists": {
...

Parameters

Start with the required fields, then add optional filters only when your use case needs them.

Runnable path

1 required parameter needed before sending a request.

id string Required

Spotify artist id or full spotify:artist: URI.

Example value 1234567890

Response Schema

Example response fields are illustrative; inspect the JSON before integrating.

Example response fields

Scan these fields before integrating.

artist top_tracks search_parameters
JSON Response
200 OK
{
    "artist": {
        "id": "4tZwfgrHOc3mvqYlEYSvVi",
        "name": "Daft Punk"
    },
    "top_tracks": {
        "items": [
            {
                "uid": "5d99bb101e828b296cc3",
                "track": {
                    "id": "0DiWol3AO6WpXZgp0goxAV",
                    "uri": "spotify:track:0DiWol3AO6WpXZgp0goxAV",
                    "name": "One More Time",
                    "artists": {
                        "items": [
                            {
                                "uri": "spotify:artist:4tZwfgrHOc3mvqYlEYSvVi",
                                "profile": {
                                    "name": "Daft Punk"
                                }
                            }
                        ]
                    },
                    "duration": {
                        "totalMilliseconds": 320357
                    },
                    "playcount": "981812332",
                    "discNumber": 1,
                    "playability": {
                        "reason": "PLAYABLE",
                        "playable": true
                    },
                    "albumOfTrack": {
                        "uri": "spotify:album:2noRn2Aes5aoNVsU6iWThc",
                        "coverArt": {
                            "sources": [
                                {
                                    "url": "https://i.scdn.co/image/ab67616d00001e021e81bff9807a9e629fce5ade"
                                },
                                {
                                    "url": "https://i.scdn.co/image/ab67616d000048511e81bff9807a9e629fce5ade"
                                },
                                {
                                    "url": "https://i.scdn.co/image/ab67616d0000b2731e81bff9807a9e629fce5ade"
                                }
                            ]
                        }
                    },
                    "contentRating": {
                        "label": "NONE"
                    },
                    "associationsV3": {
                        "videoAssociations": {
                            "totalCount": 0
                        }
                    }
                }
            },
            {
                "uid": "7e2bde934c60abb38dd2",
                "track": {
                    "id": "2Foc5Q5nqNiosCNqttzHof",
                    "uri": "spotify:track:2Foc5Q5nqNiosCNqttzHof",
                    "name": "Get Lucky (Radio Edit) [feat. Pharrell Williams and Nile Rodgers]",
                    "artists": {
                        "items": [
                            {
                                "uri": "spotify:artist:4tZwfgrHOc3mvqYlEYSvVi",
                                "profile": {
                                    "name": "Daft Punk"
                                }
                            },
                            {
                                "uri": "spotify:artist:2RdwBSPQiwcmiDo9kixcl8",
                                "profile": {
                                    "name": "Pharrell Williams"
                                }
                            },
                            {
                                "uri": "spotify:artist:3yDIp0kaq9EFKe07X1X2rz",
                                "profile": {
                                    "name": "Nile Rodgers"
                                }
                            }
                        ]
                    },
                    "duration": {
                        "totalMilliseconds": 247632
                    },
                    "playcount": "1453948438",
                    "discNumber": 1,
                    "playability": {
                        "reason": "PLAYABLE",
                        "playable": true
                    },
                    "albumOfTrack": {
                        "uri": "spotify:album:2ePFIvZKMe8zefATp9ofFA",
                        "coverArt": {
                            "sources": [
                                {
                                    "url": "https://i.scdn.co/image/ab67616d00001e0219a88dd5c7118e87d7b1619e"
                                },
                                {
                                    "url": "https://i.scdn.co/image/ab67616d0000485119a88dd5c7118e87d7b1619e"
                                },
                                {
                                    "url": "https://i.scdn.co/image/ab67616d0000b27319a88dd5c7118e87d7b1619e"
                                }
                            ]
                        }
                    },
                    "contentRating": {
                        "label": "NONE"
                    },
                    "associationsV3": {
                        "videoAssociations": {
                            "totalCount": 0
                        }
                    }
                }
            }
        ]
    },
    "search_parameters": {
        "id": "4tZwfgrHOc3mvqYlEYSvVi",
        "engine": "spotify_artist_top_tracks"
    }
}

Errors

Handle these documented responses before retrying or showing customer-facing failures.

404

Not Found

No Spotify data exists for the requested id or chart key. Failed requests are never charged.

422

Validation Error

A required parameter is missing or invalid. See the errors object for the offending field.

503

Upstream Unavailable

Spotify could not be reached or returned an unusable response. This is a failed request and is never charged; it is safe to retry.

Generate Code with AI

Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.

Try It Live

Test this endpoint in our interactive playground with real data.