thelinmichael / spotify-web-api-node

A Node.js wrapper for Spotify's Web API.
http://thelinmichael.github.io/spotify-web-api-node/
MIT License
3.1k stars 499 forks source link

Cant get Shows/Episodes #435

Open niveKKumar opened 2 years ago

niveKKumar commented 2 years ago

I want to use the spotify api to retrieve podcasts Using const test = await spotifyApi.search("Huberman", ["show"]); console.log(🚀 ~ test, test.body.shows.items);

or

const test = await spotifyApi.searchShows("Huberman");

Seems to find results but the items are all null ?!

alexhito commented 2 years ago

@niveKKumar i found the error, apparently the "market" should be included in the query and you will receive the correct answer, but apparently this library does not support adding that parameter to the query.

I solved the issue, here is an example how i solved this:

const payload = { limit: 10, offset: 0, market: 'US', }

SpotifyApi.searchShows(query, payload)