JMPerez / spotify-web-api-js

A client-side JS wrapper for the Spotify Web API

Home Page:https://jmperezperez.com/spotify-web-api-js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

search optional JSON object error 'limit'

mlam28 opened this issue · comments

When trying to increase the limit of results received from the api, passing in an addition JSON object of {limit: 50} does not work, it still defaults to 20.

my code:
let options = JSON.stringify({limit: 50})
spotifyApi.setAccessToken(token)
spotifyApi.searchTracks(input, options)

Is there a way around this or am I missing something?

Thanks,
Michelle

Looks like this may also be similar to #138 - there is not a need to JSON.stringify. It should just be spotifyApi.searchTracks(input, {limit: 50}).

Feel free to close the issues too if you've figured it out

Closing this issue. The searchTracks function expects a JSON object as options, so removing JSON.stringify() should make it work. Thanks @kevinguebert for supporting.