mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 08:35:49 +03:00
[GH-ISSUE #290] recommendation invalid request #162
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#162
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 @Mariog75 on GitHub (May 16, 2018).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/290
when making a recommendations request such as:
recommend = sp.recommendations(target_energy = 0.5)
I get the error:
Traceback (most recent call last):
File "script.py", line 62, in
recommend = sp.recommendations(target_energy = 0.5)
File "/usr/local/lib/python2.7/dist-packages/spotipy/client.py", line 804, in recommendations
return self._get('recommendations', **params)
File "/usr/local/lib/python2.7/dist-packages/spotipy/client.py", line 146, in _get
return self._internal_call('GET', url, payload, kwargs)
File "/usr/local/lib/python2.7/dist-packages/spotipy/client.py", line 124, in _internal_call
headers=r.headers)
spotipy.client.SpotifyException: http status: 400, code:-1 - https://api.spotify.com/v1/recommendations?target_energy=0.5&limit=20:
invalid request
any particular reason why this is giving an invalid request?
@smyrbdr commented on GitHub (May 30, 2018):
Looks like you didn't get token authorization for the session. The error message says "no token provided"
@JessicaMartini212887 commented on GitHub (Jun 23, 2018):
I think that is because you have to put at least one of these parameters in the request:
Target_energy isn't sufficient.
@stephanebruckert commented on GitHub (Jan 12, 2020):
@JessicaMartini212887 is correct, we need to update the doc accordingly
@AkiMosi commented on GitHub (Apr 13, 2020):
At least one is enough? I tried just by giving the seed track. And I still got an error stating 'invalid request'. Or should we give more than one track_id?
@stephanebruckert commented on GitHub (Apr 13, 2020):
@AkiMosi can you please share the exact request being made + full stacktrace/error
And does that same request work if you try it on this web UI? https://developer.spotify.com/console/get-recommendations/
@AkiMosi commented on GitHub (Apr 13, 2020):
I found what I did wrong with the code, by going through issue #305
I did not give it as a list, I just gave the id as a string.
Thanks for your quick response, and it would be great if you add a little code snippet in the examples of the documentation.
@stephanebruckert commented on GitHub (Apr 13, 2020):
Cool! Please feel free to open a PR to add an example
Just for reference, since this is about types I'm linking this issue https://github.com/plamere/spotipy/issues/439
@mikedesu commented on GitHub (Dec 5, 2020):
When attempting to pull down recommendations, I am getting the following error:
I followed the API documentation, here is the script generating the error:
@stephanebruckert commented on GitHub (Dec 5, 2020):
@mikedesu see https://github.com/plamere/spotipy/issues/290#issuecomment-399616161
@mikedesu commented on GitHub (Dec 6, 2020):
My apologies, the issue isn't answered of in that comment, hence the post.
However, I realize the problem now. The artist list must be comprised of artist IDs, not artist names.
Thanks.