-
Notifications
You must be signed in to change notification settings - Fork 961
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search query longer than 100 characters returns an error #845
Comments
I can confirm I'm seeing 404s for searches with queries longer than 100 characters since end of April 2022. It doesn't make any sense because many tracks+artist that long. It's also not documented in the doc. In spotipy I wonder how this should be handled, because 404 Not Found is wrong, it should be a 400 Bad Request. When
|
@stephanebruckert thanks for confirming the issue. I've upvoted the post on the Spotify API website. |
looks like spotify fixed the return code issue, they now return 400.
|
This is good but yeah, the problem is still there. Personally I'm ignoring queries that are > 100 but that's because my use case allows it. Trimming the query would be not only difficult but also opinionated, because all queries are personalised. In the case of a complex query, what to trim? a 50-char long artist, or a 80-char long track? What we could do at first is display a warning when we get a 400 and the query is > 100. This way if one day the API changes the limit from 100 to another number, spotipy won't be preventing the request. |
Describe the bug
The search method returns an error when the query string is longer than 100 characters. Is this a limitation of the Spotify web API?
Your code
Expected behavior
The search method should be able to handle queries of more than 100 characters
Output for the first search with 100-character string [OK]
Output for the second search with 101-character string [NOT OK]
Environment:
The text was updated successfully, but these errors were encountered: