Type in your question below and we'll check to see what answers we can find...
Loading article...
Submitting...
If you couldn't find any answers in the previous step then we need to post your question in the community and wait for someone to respond. You'll be notified when that happens.
Simply add some detail to your question and refine the title if needed, choose the relevant category, then post.
Before we can post your question we need you to quickly make an account (or sign in if you already have one).
Don't worry - it's quick and painless! Just click below, and once you're logged in we'll bring you right back here and post your question. We'll remember what you've already typed in so you won't have to do it again.
Hi,
I'm trying to use the Search API to search for a podcast via a Spotify application.
When I try to use the Web Console, everything works fine. However, when I try to run the same logic via a Python script, the API response is different - potentially missing data. Here is the API response I receive from my script:
{'shows': {'href': 'https://api.spotify.com/v1/search?query=dear+hank+%26+john&type=show&offset=0&limit=20', 'items': [None, None], 'limit': 20, 'next': None, 'offset': 0, 'previous': None, 'total': 2}}
I'd appreciate it if someone can point me in the right direction of figuring the error out from my side.
We are seeing exactly the same problem
Simple example to lookup track by isrc:USSM11906291
Result returned by OAuth token from search console (and expected result)
curl -X "GET" "https://api.spotify.com/v1/search?query=isrc%3AUSSM11906291&type=track&offset=0&limit=1" -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer xxxx" { "tracks" : { "href" : "https://api.spotify.com/v1/search?query=isrc%3AUSSM11906291&type=track&offset=0&limit=1", "items" : [ ], "limit" : 1, "next" : null, "offset" : 0, "previous" : null, "total" : 0 } }{ "tracks" : { "href" : "https://api.spotify.com/v1/search?query=isrc%3AUSSM11906291&type=track&offset=0&limit=1", "items" : [ { "album" : { "album_type" : "single", "artists" : [ { "external_urls" : { "spotify" : "https://open.spotify.com/artist/1MXZ0hsGic96dWRDKwAwdr" }, "href" : "https://api.spotify.com/v1/artists/1MXZ0hsGic96dWRDKwAwdr", "id" : "1MXZ0hsGic96dWRDKwAwdr", "name" : "Tyla Yaweh", "type" : "artist", "uri" : "spotify:artist:1MXZ0hsGic96dWRDKwAwdr" } ], "available_markets" : [ "AE", "BH", "BY", "EG", "ID", "IN", "JO", "KR", "KW", "LB", "MY", "OM", "PH", "PS", "QA", "SA", "ZA" ], "external_urls" : { "spotify" : "https://open.spotify.com/album/5rYqahY5a5JngAtWhGsDxd" }, "href" : "https://api.spotify.com/v1/albums/5rYqahY5a5JngAtWhGsDxd", "id" : "5rYqahY5a5JngAtWhGsDxd", "images" : [ { "height" : 640, "url" : "https://i.scdn.co/image/ab67616d0000b273fed5753dfd79d9ccabd1c8ab", "width" : 640 }, { "height" : 300, "url" : "https://i.scdn.co/image/ab67616d00001e02fed5753dfd79d9ccabd1c8ab", "width" : 300 }, { "height" : 64, "url" : "https://i.scdn.co/image/ab67616d00004851fed5753dfd79d9ccabd1c8ab", "width" : 64 } ], "name" : "I Think I Luv Her (feat. YG)", "release_date" : "2019-09-27", "release_date_precision" : "day", "total_tracks" : 1, "type" : "album", "uri" : "spotify:album:5rYqahY5a5JngAtWhGsDxd" }, "artists" : [ { "external_urls" : { "spotify" : "https://open.spotify.com/artist/1MXZ0hsGic96dWRDKwAwdr" }, "href" : "https://api.spotify.com/v1/artists/1MXZ0hsGic96dWRDKwAwdr", "id" : "1MXZ0hsGic96dWRDKwAwdr", "name" : "Tyla Yaweh", "type" : "artist", "uri" : "spotify:artist:1MXZ0hsGic96dWRDKwAwdr" }, { "external_urls" : { "spotify" : "https://open.spotify.com/artist/0A0FS04o6zMoto8OKPsDwY" }, "href" : "https://api.spotify.com/v1/artists/0A0FS04o6zMoto8OKPsDwY", "id" : "0A0FS04o6zMoto8OKPsDwY", "name" : "YG", "type" : "artist", "uri" : "spotify:artist:0A0FS04o6zMoto8OKPsDwY" } ], "available_markets" : [ "AE", "BH", "BY", "EG", "ID", "IN", "JO", "KR", "KW", "LB", "MY", "OM", "PH", "PS", "QA", "SA", "ZA" ], "disc_number" : 1, "duration_ms" : 160742, "explicit" : false, "external_ids" : { "isrc" : "USSM11906291" }, "external_urls" : { "spotify" : "https://open.spotify.com/track/46jINX5I0agia69cDovyYg" }, "href" : "https://api.spotify.com/v1/tracks/46jINX5I0agia69cDovyYg", "id" : "46jINX5I0agia69cDovyYg", "is_local" : false, "name" : "I Think I Luv Her (feat. YG)", "popularity" : 1, "preview_url" : "https://p.scdn.co/mp3-preview/c09049f6f62d361c78e1d2d97318b15900a4a4fd?cid=774b29d4f13844c495f206cafdad9c86", "track_number" : 1, "type" : "track", "uri" : "spotify:track:46jINX5I0agia69cDovyYg" } ], "limit" : 1, "next" : null, "offset" : 0, "previous" : null, "total" : 1 } }
However, results returned by using token generated from client id/secret
curl -X "GET" "https://api.spotify.com/v1/search?query=isrc%3AUSSM11906291&type=track&offset=0&limit=1" -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Barer xxxx" { "tracks" : { "href" : "https://api.spotify.com/v1/search?query=isrc%3AUSSM11906291&type=track&offset=0&limit=1", "items" : [ ], "limit" : 1, "next" : null, "offset" : 0, "previous" : null, "total" : 0 }
While other ISRC seems to work fine? ex: USWB11902981
Hey there you, Yeah, you! 😁 Welcome - we're glad you joined the Spotify Community! While you here, let's have a fun game and get…