[GH-ISSUE #517] Unable to search podcast data #310

Closed
opened 2026-02-27 23:21:56 +03:00 by kerem · 4 comments
Owner

Originally created by @ianm199 on GitHub (Jun 23, 2020).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/517

I'm trying to get podcast data and it doesn't seem to work from API.

Example code:
client_credentials_manager = SpotifyClientCredentials(client_id=cid, client_secret=secret)

sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager)
test = sp.search("A", limit=10, type='show')
print(str(test))

results = sp._get('https://api.spotify.com/v1/search?query=test&type=show')
print(str(results))

Both of these queries return nothing, when it says on their site that this is supported.
https://developer.spotify.com/documentation/web-api/reference/search/search/
https://developer.spotify.com/community/news/2020/03/20/introducing-podcasts-api/

Am I missing something? I am able to get artists/tracks/etc without an issue.

Originally created by @ianm199 on GitHub (Jun 23, 2020). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/517 I'm trying to get podcast data and it doesn't seem to work from API. Example code: client_credentials_manager = SpotifyClientCredentials(client_id=cid, client_secret=secret) ``` sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager) test = sp.search("A", limit=10, type='show') print(str(test)) results = sp._get('https://api.spotify.com/v1/search?query=test&type=show') print(str(results)) ``` Both of these queries return nothing, when it says on their site that this is supported. https://developer.spotify.com/documentation/web-api/reference/search/search/ https://developer.spotify.com/community/news/2020/03/20/introducing-podcasts-api/ Am I missing something? I am able to get artists/tracks/etc without an issue.
kerem 2026-02-27 23:21:56 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@th4t-gi commented on GitHub (Jul 17, 2020):

Hi, I'm not sure if this is apart of the same bug because you are using queries where as I'm just using the .show() and .episode() methods but on every id that i pass it returns a 404 error. I can also get song data without a problem, but podcasts that seem to be the issue.

<!-- gh-comment-id:660341013 --> @th4t-gi commented on GitHub (Jul 17, 2020): Hi, I'm not sure if this is apart of the same bug because you are using queries where as I'm just using the `.show()` and `.episode()` methods but on every id that i pass it returns a 404 error. I can also get song data without a problem, but podcasts that seem to be the issue.
Author
Owner

@stephanebruckert commented on GitHub (Aug 29, 2020):

I'm not sure either if this is related to https://github.com/plamere/spotipy/issues/552#issuecomment-669990755, but it works when specifying a market:

sp.search("A", limit=10, type='show', market='GB')

Apparently the current user country is not inferred the same way whether we request shows or tracks, which looks like a bug/inconsistency on Spotify side to me.

This works:

sp.search("A", limit=10, type='track')

but this doesn't:

sp.search("A", limit=10, type='show')

Hope this helps

<!-- gh-comment-id:683283762 --> @stephanebruckert commented on GitHub (Aug 29, 2020): I'm not sure either if this is related to https://github.com/plamere/spotipy/issues/552#issuecomment-669990755, but it works when specifying a market: sp.search("A", limit=10, type='show', market='GB') Apparently the current user country is not inferred the same way whether we request shows or tracks, which looks like a bug/inconsistency on Spotify side to me. This works: sp.search("A", limit=10, type='track') but this doesn't: sp.search("A", limit=10, type='show') Hope this helps
Author
Owner

@Peter-Schorn commented on GitHub (Oct 15, 2020):

@stephanebruckert This is actually not a bug. I missed this initially as well, but if you read the documentation carefully for endpoints that return shows and episodes, such as the /episodes/{id} endpoint, it says:

market: Optional. An ISO 3166-1 alpha-2 country code.If a country code is specified, only shows and episodes that are available in that market will be returned.If a valid user access token is specified in the request header, the country associated with the user account will take priority over this parameter.Note: If neither market or user country are provided, the content is considered unavailable for the client.

A user access token is one that was granted while using the Authorization Code Flow or the Authorization Code Flow with Proof Key for Code Exchange (and probably the implicit grant flow as well, although I've never used this).

This means that if you are using the Client Credentials Flow, you must provide a value for the market parameter. This applies for all endpoints that return shows or episodes, including the the search endpoint and the playlist endpoints, because playlists can contain episodes.

<!-- gh-comment-id:709605419 --> @Peter-Schorn commented on GitHub (Oct 15, 2020): @stephanebruckert This is actually not a bug. I missed this initially as well, but if you read the documentation carefully for endpoints that return shows and episodes, such as the [/episodes/{id}][1] endpoint, it says: > market: *Optional*. An ISO 3166-1 alpha-2 country code.If a country code is specified, only shows and episodes that are available in that market will be returned.If a valid **user** access token is specified in the request header, the country associated with the user account will take priority over this parameter.Note: **If neither market or user country are provided, the content is considered unavailable for the client.** A *user* access token is one that was granted while using the Authorization Code Flow or the Authorization Code Flow with Proof Key for Code Exchange (and probably the implicit grant flow as well, although I've never used this). This means that if you are using the Client Credentials Flow, you *must* provide a value for the market parameter. This applies for *all* endpoints that return shows or episodes, including the the search endpoint and the playlist endpoints, because playlists can contain episodes. [1]: https://developer.spotify.com/documentation/web-api/reference/episodes/get-an-episode/
Author
Owner

@stephanebruckert commented on GitHub (Oct 15, 2020):

This makes sense, I'm going to close this as solved then. Thanks @Peter-Schorn

<!-- gh-comment-id:709619754 --> @stephanebruckert commented on GitHub (Oct 15, 2020): This makes sense, I'm going to close this as solved then. Thanks @Peter-Schorn
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#310
No description provided.