Dude, your pace is spot on! Please make everyone that does tutorials adopt your style.
@geovaniraffaelli4508
Жыл бұрын
You never disappoint Tim. The official documentation was very difficult to understand, we need more videos like this.
@wilson_joe
8 ай бұрын
I agree it was well put together, a+
@mar_ces4383
Жыл бұрын
Watch out guys, headers should look like this headers = {"Authorization": "Basic " (
@ale711
Жыл бұрын
thanks
@jpedros36
11 ай бұрын
YOU SAVED ME
@kojiyoshiyama5816
10 ай бұрын
I was stuck for like 45 minutes before i saw your comment this saved me
@kingofbingus468
9 ай бұрын
thank you very much this fixed my code even though it was giving me errors elsewhere
@ashwinvijayakumar4558
8 ай бұрын
thank you so much i was deadass lost for so long
@omnishambles5110
2 ай бұрын
I've been getting a 401 error when trying to do this, even though the first day I wrote the code it actually did work. The tokens are updating and changing and I verified my secrets. Great video though, I'm glad you showed how to write the auth token part instead of just using a library.
@ruchitakulkarni1641
Жыл бұрын
Thank you so much for detailed video explanation Tim
@laurom9373
3 ай бұрын
probably a late answer but i fix that same problem by whitespacecing after word "Basic " in the headers
@DobbyGloving
2 ай бұрын
I also had the same issue.... Had a Semi colon between the concat of my auth string. Glad to see I'm not the only one who had to trouble shoot typos 😆
@tejasshinde5722
2 ай бұрын
Thank you so much this is the most simple tutorial I have seen have said so many tutorials but this is the most in simple and the best working😊 climate same what you did and it work properly thank you so much for such amazing tutorial
@MrGamefreak08
Жыл бұрын
Just an advisory for anybody running into the error "KeyError: 'access_token''", it is because it should be data = {"grant_type":"client_credentials"} not data = {"grant-type":"client_credentials"}.
@jorgemanzano7522
Жыл бұрын
thank you ! was scratching my head at this one
@j03_h
Жыл бұрын
i may have read incorrectly but i am reading them both as the same, i have this issue and i cant seem to fix it
@nicolabaldassar458
Жыл бұрын
underscore in the first and dash in the second (between grant / type)@@j03_h
@liquidmoon3501
Жыл бұрын
thank you so much man i literally never would have figured that out myself
@kavinb3672
9 ай бұрын
@@j03_h there is an underscore in grant type not -
@oyindamolavictor
2 ай бұрын
Amazinggggg!!!... You just saved me from so much complexity...
@joyburd2
3 ай бұрын
This was great dude super helpful and I learned a lot
@thepaavamdude537
Жыл бұрын
If you are getting this eauth_base64 = base64.b64encode(auth_bytes).decode("utf-8")rror: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf1 in position 0: invalid continuation byte. Try this: auth_base64 = base64.b64encode(auth_bytes).decode("utf-8")
@ArchanaChandran-wp8ps
8 ай бұрын
lifesaver!!
@alvaroalva8602
6 ай бұрын
Does anyone know what the reason behind this error is?
@elconnero
6 күн бұрын
Thank you
@ike654
5 ай бұрын
Thanks god (and you) for this video, I was going crazy trying to get a token
@samchen7062
22 күн бұрын
great tutorial
@kyleburns1752
Жыл бұрын
huge help. thank you👍
@hidayetozsoy
Жыл бұрын
thank you very much. you did the thing that should have been done by the stupid spotify developers who wrote the documentation
@olive3024
Жыл бұрын
😂😂you make me laugh, I like the careless and relaxed way and just keep having the editor telling you where you got a small typo, one by one.
@FredRohn
Жыл бұрын
This was fantastic, thank you!
@JituJha-yv4vi
Жыл бұрын
But but nm
@muhammadumairansari3435
Ай бұрын
Really nice and well explained.
@olkhovskyrus
3 ай бұрын
Thanks so much, helped a lot!
@VincentVILLEREY
2 ай бұрын
Thank you, good job!
@Arturoperezp
7 ай бұрын
thank you so much! it worked perfectly
@jeguhem
Жыл бұрын
hello thank you for the video, but I'm getting this error {'error': {'status': 400, 'message': 'Only valid bearer authentication supported'}}. please how can I resolve this?
@Dimitrios_Sanchez
6 ай бұрын
on the method get_auth_header should look like this headers = {"Authorization": "Bearer " (
@Lil_Hana
6 ай бұрын
i still cant find the sulotion. facing the same issue.
@Dimitrios_Sanchez
6 ай бұрын
@@Lil_Hana still having the same error, after check the code of the method get_auth_header?
@KidSpiegel
3 ай бұрын
Nicely done man
@loganankarberg2296
8 ай бұрын
Amazing video thanks!
@rajsinha7402
7 ай бұрын
It really helped me thanks!!!
@user-sh2ds6sn8g
5 ай бұрын
when i create the app, it asks me for a website? i dont fully understand what that is.
@amishamishra580
2 ай бұрын
same 🥲🥲
@EMRAN994
Жыл бұрын
Great video and clear explanation
@msbilgin383
Ай бұрын
Where is the info of "questionmark" of query ? if it is in the documenatation, i couldnt see :(
@lipocodes2273
Жыл бұрын
Excellent tutorial
@bryancho2346
2 күн бұрын
I believe this does not work anymore on MacOS due to the new compatabilities on Mac. I get an error saying "urllib3 v2 only supports OpenSSL 1.1.1+... module is compiled with 'LibreSSL 2.8.3'. Even after reinstalling urllib3 v2 and LibreSSL and updating, it doesn't work.
@enjoyourjoint5012
Ай бұрын
My question is very basic for someone who started playing with ETL and APIs this week...How the hell with the information I have on the spotify Web API , i would be able to understand which things we really need to have the access token?For example, I understand in the documentation we have the parameters, headers etc...but the last part of your code, the variable result it comes from the body request, which for what I understand it is basic for any API this last part, to send a request?Hope someone understood my question ahah
@joeking8822
Жыл бұрын
6:14, can you please make a video that goes over how to authenticate a user so that we can do tasks such as controlling somebody's Spotify player?
@AkamaiDeveloper
Жыл бұрын
Hi there Joe - Thanks for the suggestion! We've passed along your feedback to see if this is something that can be done in the future. In the meantime, you may want to check out Spotify's documentation about authentication or see if their Community forum can help: developer.spotify.com/documentation/web-api/concepts/authorization developer.spotify.com/community
@ezenaguchinemerem4214
3 ай бұрын
Great video🎉...please can someone also play songs in a website using Spotify APIs. Am having some problems doing that
@alfredoguzman597
Жыл бұрын
I'm getting a Response [415] error for the result = post() response. This causes the following exception: raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) Any idea as to why this might be? Perhaps something's missing with the header dictionary pointer.
@andreanunez8529
11 ай бұрын
i'm having the exact same problem, were you able to solve it?
@oliverfragoso8515
9 ай бұрын
I'm having the same issue 😥
@ayomitideowolabi4439
5 ай бұрын
import requests and in the result = post() i wrote result = requests.post() which ran the code
@motheomkhwanazi9529
2 ай бұрын
is there a way of getting the number of streams for a song ???
@BaronVonCount
Жыл бұрын
Nice and detailed explanation. Is there a way to get a song/artist popularity rank for a given time period? I.e: What was "The Weeknd- Blinding Lights" popularity rank in december 2022?
@sazer2411
9 ай бұрын
a doubt like every time i run this program new access token gets generated so what if i want to re use it ? cuz it has like 1hr life span right?
@dominhquanho9319
Жыл бұрын
Hello, could you please explain how would we ask for the user authorization by login with their account. Thank you so much
@AkamaiDeveloper
Жыл бұрын
Hey there! You may want to reach out to the Spotify Developer Community forum or on Stack Overflow to see if the folks there have any insight they can share regarding your question. community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer stackoverflow.com/questions/tagged/spotify
@dominhquanho9319
Жыл бұрын
@@AkamaiDeveloper I will do it, thank you so much
@greco1995
Жыл бұрын
@@dominhquanho9319 did you find the answer?
@lumpsofcandy86
Жыл бұрын
did you do this because pycurl wasn't working? i'm curious because i've read that pycurl is volunteer run and doesn't work with new versions of python. so this is a good workaround from using cURL
@bben4507
11 ай бұрын
Till 20:20, my codings ran smoothly from line 1 to line 42 (can print token and json_result). however after I typed in line 45 and 46, reported {'error': {'status': 404, 'message': 'Service not found'}}, I changed the artist name, still didn't work. May I ask what can be potential problems. Thx
@louiseti4883
11 ай бұрын
Same prblm here, did you find a way of resolution ? Issue fixed : forgot "?" line 37
@bben4507
11 ай бұрын
@@louiseti4883 No.
@rootytuners
9 ай бұрын
Do you have the '?' before the q (in the 'search _for_artist' function)? "?q={artist_name}&type" I didn't, and received exactly the same message. (Spotify couldn't read the URL as a result, as the '?' should come after the 'search' part of the URL.) Also, there should be a market element in the URL, so my line ended up as follows: query = f"?q={artist_name}&type=artist&limit=1"
@bben4507
9 ай бұрын
I am not working on this project now. But I'll have a try later. Thank you for sharing!@@rootytuners
@tosyyyaaa
9 ай бұрын
Hi! Almost the same trouble here, but i get error 401, message “no token provided”. Has anyone been able to solve it yet?
@user-zh9pk2wo7z
2 ай бұрын
Nice thumbnail
@MrChair549
10 ай бұрын
How do you know/find out to use result.content)["tracks']. instead of ["songs"] for example
@thebjagrelli
Жыл бұрын
For some reason this is nor working if I choose “type=show” in the GET request. It’s driving me nuts
@Calabrien
Жыл бұрын
I am getting an error: " result = get(query_url, headers=headers) NameError: name 'get' is not defined. Did you mean: 'set'?" at 20:36 mark. Someone knows how to fix it?
@WetCoffnMout
10 ай бұрын
I had this error too. At 19:32, he also imported "get" the same way he did the method "post" earlier in the vid. Once I did that, it worked for me.
@acloudyboy
Жыл бұрын
i know you probly can help but when i try to sign the developer agreement it says an error occoured and does nothing
@brendan2609
11 ай бұрын
Does anyone know how to get a list of song names and their artists from a playlist using the api? I can't seem to figure it out. Thanks.
@user-xd8vu1cv7n
11 ай бұрын
I am getting status code as 400 and I am unable to find the token , anybody can help me with it?
@gikis1
6 ай бұрын
This is great, thank you! How can one modify the scope for this authorization - i.e. if I want to pull history of my recently played songs?
@AkamaiDeveloper
6 ай бұрын
Hey there - you can check out the Spotify API documentation for all of the available scopes, including recently played tracks: developer.spotify.com/documentation/web-api/reference/get-recently-played
@gikis1
6 ай бұрын
Thank you @@AkamaiDeveloper! Unfortunately, I couldn't figure out how to modify the authorization flow to access user-level data with your example. Had to use spotipy instead. However, I would appreciate any hints or tips how can I go without it (just for my own knowledge). Thank you :)
@jpedros36
11 ай бұрын
is it possible run a python code in mobile so it starts play spotify in my tv every morning?
@nadeemshaik157
7 ай бұрын
Can we download the songs too using this
@xufeike383
4 ай бұрын
Thank for your video! But i got {'error': {'status': 404, 'message': 'Service not found'}}。 Who can help me plz
@user-hv9oh1zj4r
6 ай бұрын
I seem to have a problem with the json format of the results. I did do import json and I do get the results from the query but my json viewer says the format is invalid.. Any suggestions?
@AkamaiDeveloper
6 ай бұрын
We suggest trying to view the results in a different json viewer or reaching out to the wider Spotify Developer Community here: community.spotify.com/
I'm getting the same error, did you ever get it fixed
@eeffeecct
3 ай бұрын
@@matthewstephens8436 Yeah, I fixed it, but I don't remember how.
@sanishthomas2858
7 ай бұрын
is it open AP|I?
@AngirasDarbha
Жыл бұрын
For some reason all I get is "enter the URL you were redirected to" on the console whereas the URL I am redirected to just says "Error, something went wrong"
@campbelloverend4305
Жыл бұрын
same
@ChristopherJohnson-st6fn
Жыл бұрын
Great video Tim! Are you the same Tim from Algo expert?
@campagnollo
7 ай бұрын
This might be a recent development, but my dashboard is demanding a "Redirect URI" when creating a app. Not sure what this is.
@YashSharma-zg1uk
6 ай бұрын
same man, did you get the solution for that?
@AkamaiDeveloper
6 ай бұрын
This thread on the Spotify Developer Forum has a potential solution for the Redirect URI issue you're seeing: community.spotify.com/t5/Spotify-for-Developers/Redirect-URI-needed/m-p/5067419
@kyleryxn
Жыл бұрын
Can you do one with Java?
@096r.s.sreeharish8
Жыл бұрын
Sir I have a doubt iam developing a app for my project that should get the music playlist from the Spotify api is this possible plz help me i have searched it and I heard that only the song intro can be taken
@AkamaiDeveloper
Жыл бұрын
You can find the Spotify API documentation on working with playlists here: developer.spotify.com/documentation/general/guides/working-with-playlists/ If you're having trouble retrieving full song data, you may want to reach out to the Spotify dev community here: community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer
@096r.s.sreeharish8
Жыл бұрын
@@AkamaiDeveloper ok sir i will see it and ask u doubts if any
@jpromero9391
Жыл бұрын
Can we play any Track and if so, how many seconds do we get from each Track?
@AkamaiDeveloper
Жыл бұрын
According to this post from the Spotify Developer Forums, you are not able to play full tracks outside of Spotify using the API: community.spotify.com/t5/Spotify-for-Developers/how-do-i-get-the-full-song-link/m-p/5509958
@henrygalvan9333
Жыл бұрын
You have to do it diff cause you need more then the token, you need authorization
@user-rw1ih3fv4m
Жыл бұрын
I’m stuck on trying to get the token I keep getting “{‘error’: ‘invalid_client’}” any suggestions?
@AkamaiDeveloper
Жыл бұрын
Hey there - we suggest reviewing the Client Credentials API documentation: developer.spotify.com/documentation/web-api/tutorials/client-credentials-flow Alternatively, you can check out this post from Stack Overflow where someone responded with a potential solution: stackoverflow.com/a/67608910
@twistedrobin8769
Жыл бұрын
loving this video, but already ran into my first problem where I was getting the error: *auth_base64 = str(base64.b64decode(auth_bytes), "utf-8")* *UnicodeDecodeError: 'utf-8' codec can't decode byte 0xdb in position 0: invalid continuation byte* nothing fixed it until I changed: *auth_string = client_id + ":" + client_secret* *auth_bytes = auth_string.encode("utf-8")* *auth_base64 = str(base64.b64decode(auth_bytes), "utf-8")* To: *encoded_creds = base64.b64encode(client_id.encode() + b":" + client_secret.encode()).decode('utf-8')* hope this helps anyone getting similar issues
@maybenew7293
Жыл бұрын
Thank you!
@maybenew7293
Жыл бұрын
also did that auth_string = client_id + ":" + client_secret auth_bytes = auth_string.encode(encoding="utf-8") auth_base64 = str(base64.b64decode(auth_bytes))
@maybenew7293
Жыл бұрын
Hey did you eventually have it all running=
@twelvefretter7560
11 ай бұрын
The code runs successfully unless I specify specific result items: artist_id = result["id"] TypeError: 'NoneType' object is not subscriptable
@twelvefretter7560
11 ай бұрын
I can see the artist info in the terminal output prior to the error
@twelvefretter7560
11 ай бұрын
Discovered that I had an underscore rather than a hyphen in top-tracks! All good!
@user-nd9kn5mo9u
9 ай бұрын
how did you fix that
@tokicorp1129
Жыл бұрын
how would i adapt this to look for a user's top tracks?
@AkamaiDeveloper
Жыл бұрын
This post in the Spotify Dev Forums has the API call you use to find the top tracks and albums for a user: community.spotify.com/t5/Spotify-for-Developers/Status-Code-403-from-Spotify-API-When-Requesting-User-s-Top/m-p/5477788#M7426 If this isn't what you're looking for, we suggest reaching out there for more help.
@MovingOutMyMoms
Жыл бұрын
You can use this to get total song count for an artist?
@nikhilkambli5050
9 ай бұрын
{ "error": { "status": 401, "message": "No token provided" } } how do i correct this error
@AkamaiDeveloper
6 ай бұрын
In this thread from the Spotify Developer Forum the user was able to resolve their issue by double-checking their endpoint URL: community.spotify.com/t5/Spotify-for-Developers/401-No-token-provided/m-p/5352949 You may want to look into that site for additional resources as well.
@ZeeAcez
5 ай бұрын
I just mispelled "Authorization" in the get_auth_header and got that error
@sarafattack3188
Жыл бұрын
Hey great video, thank you :) I keep getting an error "KeyError: 'access_token'" - pls could you advise? Many thanks 😃
@AkamaiDeveloper
Жыл бұрын
This could be because your access token expired. This post from Stack Overflow has a bit more information including Spotify Authorization info: stackoverflow.com/questions/60980531/spotify-api-authorization-token-key-error-python3
@sarafattack3188
Жыл бұрын
@@AkamaiDeveloper Got it working, thanks sm!
@AkamaiDeveloper
Жыл бұрын
That's excellent, we're always happy to hear whenever anyone is able to successfully use our project ideas!
@shivajeetrai1618
Жыл бұрын
@linode could you please tell me what changes you made to make this work! thanks
@smartblackgirl
10 ай бұрын
@@shivajeetrai1618did you find out how? I’m struggling with this as well
@eshuvgautam3186
Жыл бұрын
result = post(url, header=header, data=data) NameError: name 'post' is not defined I am getting this please help me on this
@hotspicypizza
Жыл бұрын
from requests import post
@harrisongazeley8028
Жыл бұрын
Great tutorial, but I’m having trouble writing code to pull user data that can’t be accessed through client credentials? As in a users currently playing song. I want to write the code in python but I am having trouble finding a tutorial on how
@nemoterbogt6905
Жыл бұрын
using authorization code flow instead of client cridential for authentication might also help
@AkamaiDeveloper
Жыл бұрын
You may want to reach out on the Spotify Community Forums or Stack Overflow for help with this question: community.spotify.com/ stackoverflow.com/questions/tagged/spotify+python
@AnilSakhat
Жыл бұрын
@@nemoterbogt6905 8
@gikis1
6 ай бұрын
Had the same issue. Used spotipy instead.
@channel-lk6xz
6 ай бұрын
can i do this with jupyter notebook?
@AkamaiDeveloper
6 ай бұрын
Since Jupyter notebooks are a place to run your code, you should be able to create this project within a notebook. If you run into issues, you can reach out in the Jupyter Notebook Forum: discourse.jupyter.org/c/notebook/31
@Beefire
Жыл бұрын
I'm looking to make a python program that can play a song of the users choosing on the spotify application, similar to how google home can get a song from a users request and play said song, does anyone know if this is possible?
@AkamaiDeveloper
Жыл бұрын
You might be interested in checking out Spotipy which is a Python library of Spotify's API: spotipy.readthedocs.io/en/2.22.1/q
@Beefire
Жыл бұрын
Thanks! I'll have a look over now 😁
@elumalaim6857
Жыл бұрын
This is neat which the documentation fails to provide.
@basedondn
7 ай бұрын
why isnt pip being recognised for me?
@AkamaiDeveloper
6 ай бұрын
Depending on your operating system and the version of Python you have installed, you may need to specify the version of pip you'd like to use - pip or pip3. You can check out the following resources for more information: www.linode.com/docs/guides/installing-and-importing-modules-in-python-3/#install-modules-in-python-3 dev.to/softhunt/what-is-the-difference-between-pip-and-pip3-5haj
@user-zl5jb4fb6c
Жыл бұрын
error 404 service not found error
@lucasgonzalezsonnenberg3204
Жыл бұрын
I´m getting the same error.
@AkamaiDeveloper
Жыл бұрын
Some earlier commenters were also having that same issue and someone replied with this solution: "What I did was go back and add in the "?" to the query_url and then it worked" kzitem.info/news/bejne/uHejq454fpd_oJw&lc=Ugy9k6gQcXRoOOzGxQV4AaABAg.9pNsnDfyxcA9q3qkGjQhY1 You may also want to check out this post from the Spotify Community forum: community.spotify.com/t5/Spotify-for-Developers/Can-t-get-users-recently-played-after-following-the/m-p/5593392
@MaximusPrima
8 ай бұрын
Putting a "?" at the beginning helped !@@AkamaiDeveloper
@mashiruwu9944
Жыл бұрын
I love you
@maybenew7293
Жыл бұрын
Dunno... First I got the error at line 15 auth_base64 = str(base64.b64decode(auth_bytes), "utf-8") UnicodeDecodeError: 'utf-8' codec can't decode byte 0xdb in position 0: invalid continuation byte nothing fixed it until I changed: auth_string = client_id + ":" + client_secret auth_bytes = auth_string.encode("utf-8") auth_base64 = str(base64.b64decode(auth_bytes), "utf-8") To: encoded_creds = base64.b64encode(client_id.encode() + b":" + client_secret.encode()).decode('utf-8') . Now I have "KeyError: 'access_token'"
@maybenew7293
Жыл бұрын
I also solved like that, but still not the keyerror auth_string = client_id + ":" + client_secret auth_bytes = auth_string.encode(encoding="utf-8") auth_base64 = str(base64.b64decode(auth_bytes))
@govindjha4457
Жыл бұрын
I am getting 404 error any help please
@odonkhuuzolboo750
Жыл бұрын
ah same.. could you fix it ?
@chelseaharding4513
Жыл бұрын
I was getting this too. What I did was go back and add in the "?" to the query_url and then it worked
@SefianeRyany
Жыл бұрын
Hey great video, THANK YOU . I keep getting an error "KeyError: 'access_token'" pls could you advise?
@karanchhangani000
Жыл бұрын
"Authorization": "Basic " + auth_base64, # Add space after "Basic" data = {"grant_type": "client_credentials"} # Change 'grant-type' to 'grant_type' These issues fixed it for me
@ezrahighsmith9100
Жыл бұрын
@@karanchhangani000 damn, that space saved the day haha, thank you!
@adityapatwal4157
10 ай бұрын
@@karanchhangani000 bro the space got me tweakin
@maybenew7293
Жыл бұрын
Yeah no.. It's official. I have a strong issue in the decoding. What's strange is that if I put "utf-8" in line 17 i get: auth_base64 = str(base64.b64decode(auth_bytes), "utf-8") UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf7 in position 0: invalid start byte while if I remove "utf-8" meaning that utf-8 is provided anyway, I get: {'error': 'invalid_client'} Anyone knows how to fix it? Ty
@AkamaiDeveloper
Жыл бұрын
This post from Stack Overflow addresses the 'UnicodeDecodeError' and should get you pointed in the right direction: stackoverflow.com/questions/18171739/unicodedecodeerror-when-reading-csv-file-in-pandas-with-python/18172249#18172249
Пікірлер: 173