mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 00:25:54 +03:00
[GH-ISSUE #859] How to deal with HTTP Status 400, Code: -1 when searching for songs? #530
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#530
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @chaitanya-gvs on GitHub (Sep 24, 2022).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/859
So I recently started using Spotify's API through Spotipy library in Python for a school project.
I am getting a Spotify Exception with HTTP Status: 400, Code: -1, for the following line of code,
sp.search(q="track: A Rockin' Good Way (To Mess Around and Fall in Love) artist: Dinah Washington & Brook Benton year: 1960",type='track')Here, sp is the Spotify client.
I assumed this had something to do with the string quotes or the ampersand (&) but it doesn't seem to be the case because I have tried all possible combinations.
I would like to know how to deal with this.
Thank you.

@Peter-Schorn commented on GitHub (Oct 5, 2022):
See #845. Also, there shouldn't be spaces after
track:,artist:, oryear:.@stephanebruckert commented on GitHub (Oct 29, 2022):
Your query (
q=) should look like:or with
year:but as per the link shared by @Peter-Schorn, that whole
querystring must be < 100 characters. Depending on your use case you might want to ignore or trim some track names. If you have more question about that let's continue on https://github.com/plamere/spotipy/issues/845