`Get Artist` API endpoint responds with result in inconsistent format
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all, I've found the following inconsistency in API endpoint response format:
when I request the endpoint Get Track, I get the response formatted pretty and all integer values are presented like the should be (without any floating points):
$ curl -s --request GET \
--url "https://api.spotify.com/v1/tracks/11dFghVXANMlKmJXsNCbNl" \
--header "Authorization: Bearer $TOKEN"
{
"album" : {
"album_type" : "single",
"artists" : [ {
"external_urls" : {
"spotify" : "https://open.spotify.com/artist/6sFIWsNpZYqfjUpaCgueju"
},
"href" : "https://api.spotify.com/v1/artists/6sFIWsNpZYqfjUpaCgueju",
"id" : "6sFIWsNpZYqfjUpaCgueju",
"name" : "Carly Rae Jepsen",
"type" : "artist",
"uri" : "spotify:artist:6sFIWsNpZYqfjUpaCgueju"
} ],
"available_markets" : [ ],
"external_urls" : {
"spotify" : "https://open.spotify.com/album/0tGPJ0bkWOUmH7MEOR77qc"
},
"href" : "https://api.spotify.com/v1/albums/0tGPJ0bkWOUmH7MEOR77qc",
"id" : "0tGPJ0bkWOUmH7MEOR77qc",
"images" : [ {
"height" : 640,
"url" : "https://i.scdn.co/image/ab67616d0000b2737359994525d219f64872d3b1",
"width" : 640
}, {
"height" : 300,
"url" : "https://i.scdn.co/image/ab67616d00001e027359994525d219f64872d3b1",
"width" : 300
}, {
"height" : 64,
"url" : "https://i.scdn.co/image/ab67616d000048517359994525d219f64872d3b1",
"width" : 64
} ],
"name" : "Cut To The Feeling",
"release_date" : "2017-05-26",
"release_date_precision" : "day",
"total_tracks" : 1,
"type" : "album",
"uri" : "spotify:album:0tGPJ0bkWOUmH7MEOR77qc"
},
"artists" : [ {
"external_urls" : {
"spotify" : "https://open.spotify.com/artist/6sFIWsNpZYqfjUpaCgueju"
},
"href" : "https://api.spotify.com/v1/artists/6sFIWsNpZYqfjUpaCgueju",
"id" : "6sFIWsNpZYqfjUpaCgueju",
"name" : "Carly Rae Jepsen",
"type" : "artist",
"uri" : "spotify:artist:6sFIWsNpZYqfjUpaCgueju"
} ],
"available_markets" : [ ],
"disc_number" : 1,
"duration_ms" : 207959,
"explicit" : false,
"external_ids" : {
"isrc" : "USUM71703861"
},
"external_urls" : {
"spotify" : "https://open.spotify.com/track/11dFghVXANMlKmJXsNCbNl"
},
"href" : "https://api.spotify.com/v1/tracks/11dFghVXANMlKmJXsNCbNl",
"id" : "11dFghVXANMlKmJXsNCbNl",
"is_local" : false,
"name" : "Cut To The Feeling",
"popularity" : 0,
"preview_url" : null,
"track_number" : 1,
"type" : "track",
"uri" : "spotify:track:11dFghVXANMlKmJXsNCbNl"
}%
Same with the other API endpoints and this is OK.
But when I request Get Artist endpoint, then I get the response in a kind of raw form (not formatted with new line characters and extra spaces) where integer values are presented like float point numbers:
$ curl -s --request GET \
--url "https://api.spotify.com/v1/artists?ids=5K4W6rqBFWDnAN6FQUkS6x" \
--header "Authorization: Bearer $TOKEN"
{"artists":[{"external_urls":{"spotify":"https://open.spotify.com/artist/5K4W6rqBFWDnAN6FQUkS6x"},"followers":{"href":null,"total":2.3015237E7},"genres":["chicago rap","hip hop","rap"],"href":"https://api.spotify.com/v1/artists/5K4W6rqBFWDnAN6FQUkS6x","id":"5K4W6rqBFWDnAN6FQUkS6x","images":[{"url":"https://i.scdn.co/image/ab6761610000e5eb867008a971fae0f4d913f63a","height":640.0,"width":640.0},{"url":"https://i.scdn.co/image/ab67616100005174867008a971fae0f4d913f63a","height":320.0,"width":320.0},{"url":"https://i.scdn.co/image/ab6761610000f178867008a971fae0f4d913f63a","height":160.0,"width":160.0}],"name":"Kanye West","popularity":91.0,"type":"artist","uri":"spotify:artist:5K4W6rqBFWDnAN6FQUkS6x"}]}%
This is probably an inconsistency in the API endpoints behaviour - please pay some attention.
Plan
Premium
Country
Poland
Labels:
- Labels:
-
api
-
endpoint
-
Possible Bug
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page