How to Use Spotify's API with Python | Write a Program to Display Artist, Tracks, and More

Поділитися
Вставка
  • Опубліковано 12 лип 2024
  • In this video, Tim from ‪@TechWithTim‬ explains how to gain access to the Spotify API to write a program. You'll learn how to get your Spotify access token and how to use that token to interact with different endpoints so that you can write your own program using data from Spotify.
    Chapters:
    0:00 Introduction
    0:45 Create Spotify Project
    5:50 How does Authorization Work?
    8:44 Obtain Access Token
    12:30 Convert Data to Python Dictionary
    13:20 Test Run of our Code
    15:00 Write Artist Search Function
    20:55 Grabbing Items in Results
    25:00 Run our Code
    25:16 Clean up the Results
    26:00 Conclusion
    New to Cloud Computing? Get started here with a $100 credit → www.linode.com/lp/youtube-vie...
    Watch this video for an introduction to APIs → • Intro to APIs | What a...
    Read the guide on choosing a Python API framework → www.linode.com/docs/guides/ho...
    Subscribe to get notified of new episodes as they come out → ua-cam.com/users/linode?sub_co...
    #Linode #Spotify #API #TechWithTim
    Product: Linode, API, Tokens; @TechWithTim ;
  • Наука та технологія

КОМЕНТАРІ • 167

  • @dirkavery4445
    @dirkavery4445 3 місяці тому +6

    Dude, your pace is spot on! Please make everyone that does tutorials adopt your style.

  • @geovaniraffaelli4508
    @geovaniraffaelli4508 Рік тому +62

    You never disappoint Tim. The official documentation was very difficult to understand, we need more videos like this.

    • @wilson_joe
      @wilson_joe 7 місяців тому

      I agree it was well put together, a+

  • @mar_ces4383
    @mar_ces4383 Рік тому +35

    Watch out guys, headers should look like this headers = {"Authorization": "Basic " (

    • @ale711
      @ale711 10 місяців тому +1

      thanks

    • @jpedros36
      @jpedros36 10 місяців тому +2

      YOU SAVED ME

    • @kojiyoshiyama5816
      @kojiyoshiyama5816 8 місяців тому +2

      I was stuck for like 45 minutes before i saw your comment this saved me

    • @kingofbingus468
      @kingofbingus468 7 місяців тому +1

      thank you very much this fixed my code even though it was giving me errors elsewhere

    • @ashwinvijayakumar4558
      @ashwinvijayakumar4558 6 місяців тому

      thank you so much i was deadass lost for so long

  • @kyleburns1752
    @kyleburns1752 Рік тому +3

    huge help. thank you👍

  • @joyburd2
    @joyburd2 Місяць тому

    This was great dude super helpful and I learned a lot

  • @FredRohn
    @FredRohn Рік тому +2

    This was fantastic, thank you!

  • @Arturoperezp
    @Arturoperezp 6 місяців тому

    thank you so much! it worked perfectly

  • @EMRAN994
    @EMRAN994 11 місяців тому

    Great video and clear explanation

  • @oyindamolavictor
    @oyindamolavictor Місяць тому

    Amazinggggg!!!... You just saved me from so much complexity...

  • @ike654
    @ike654 4 місяці тому

    Thanks god (and you) for this video, I was going crazy trying to get a token

  • @tejasshinde5722
    @tejasshinde5722 Місяць тому

    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

  • @olkhovskyrus
    @olkhovskyrus 2 місяці тому

    Thanks so much, helped a lot!

  • @loganankarberg2296
    @loganankarberg2296 7 місяців тому

    Amazing video thanks!

  • @olive3024
    @olive3024 Рік тому +2

    😂😂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.

  • @VincentVILLEREY
    @VincentVILLEREY Місяць тому

    Thank you, good job!

  • @rajsinha7402
    @rajsinha7402 5 місяців тому

    It really helped me thanks!!!

  • @MrGamefreak08
    @MrGamefreak08 Рік тому +30

    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
      @jorgemanzano7522 Рік тому +1

      thank you ! was scratching my head at this one

    • @j03_h
      @j03_h 10 місяців тому

      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
      @nicolabaldassar458 10 місяців тому

      underscore in the first and dash in the second (between grant / type)@@j03_h

    • @liquidmoon3501
      @liquidmoon3501 10 місяців тому +1

      thank you so much man i literally never would have figured that out myself

    • @kavinb3672
      @kavinb3672 8 місяців тому

      @@j03_h there is an underscore in grant type not -

  • @KidSpiegel
    @KidSpiegel 2 місяці тому

    Nicely done man

  • @lipocodes2273
    @lipocodes2273 Рік тому

    Excellent tutorial

  • @omnishambles5110
    @omnishambles5110 Місяць тому

    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
    @ruchitakulkarni1641 10 місяців тому +14

    Thank you so much for detailed video explanation Tim

    • @laurom9373
      @laurom9373 2 місяці тому

      probably a late answer but i fix that same problem by whitespacecing after word "Basic " in the headers

    • @DobbyGloving
      @DobbyGloving Місяць тому

      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 😆

  • @lumpsofcandy86
    @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

  • @hidayetozsoy
    @hidayetozsoy Рік тому +16

    thank you very much. you did the thing that should have been done by the stupid spotify developers who wrote the documentation

  • @primozuado
    @primozuado Рік тому +7

    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
    @sazer2411 8 місяців тому

    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?

  • @MrChair549
    @MrChair549 9 місяців тому

    How do you know/find out to use result.content)["tracks']. instead of ["songs"] for example

  • @jeguhem
    @jeguhem Рік тому +5

    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?

    • @Dim_sb
      @Dim_sb 5 місяців тому

      on the method get_auth_header should look like this headers = {"Authorization": "Bearer " (

    • @Lil_Hana
      @Lil_Hana 4 місяці тому

      i still cant find the sulotion. facing the same issue.

    • @Dim_sb
      @Dim_sb 4 місяці тому

      ​@@Lil_Hana still having the same error, after check the code of the method get_auth_header?

  • @joeking8822
    @joeking8822 Рік тому +2

    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
      @AkamaiDeveloper  Рік тому +1

      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

  • @gikis1
    @gikis1 5 місяців тому

    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
      @AkamaiDeveloper  4 місяці тому

      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
      @gikis1 4 місяці тому

      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 :)

  • @ezenaguchinemerem4214
    @ezenaguchinemerem4214 Місяць тому

    Great video🎉...please can someone also play songs in a website using Spotify APIs. Am having some problems doing that

  • @brendan2609
    @brendan2609 10 місяців тому

    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.

  • @dominhquanho9319
    @dominhquanho9319 Рік тому +2

    Hello, could you please explain how would we ask for the user authorization by login with their account. Thank you so much

    • @AkamaiDeveloper
      @AkamaiDeveloper  Рік тому +2

      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
      @dominhquanho9319 Рік тому

      @@AkamaiDeveloper I will do it, thank you so much

    • @greco1995
      @greco1995 Рік тому

      @@dominhquanho9319 did you find the answer?

  • @alfredoguzman597
    @alfredoguzman597 11 місяців тому +2

    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
      @andreanunez8529 10 місяців тому

      i'm having the exact same problem, were you able to solve it?

    • @oliverfragoso8515
      @oliverfragoso8515 8 місяців тому

      I'm having the same issue 😥

    • @ayomitideowolabi4439
      @ayomitideowolabi4439 3 місяці тому

      import requests and in the result = post() i wrote result = requests.post() which ran the code

  • @x0am_vr
    @x0am_vr 11 місяців тому

    is there a way to create playlists with this?

  • @jpedros36
    @jpedros36 10 місяців тому

    is it possible run a python code in mobile so it starts play spotify in my tv every morning?

  • @motheomkhwanazi9529
    @motheomkhwanazi9529 20 днів тому

    is there a way of getting the number of streams for a song ???

  • @thebjagrelli
    @thebjagrelli Рік тому

    For some reason this is nor working if I choose “type=show” in the GET request. It’s driving me nuts

  • @acloudyboy
    @acloudyboy 11 місяців тому

    i know you probly can help but when i try to sign the developer agreement it says an error occoured and does nothing

  • @MovingOutMyMoms
    @MovingOutMyMoms Рік тому +1

    You can use this to get total song count for an artist?

  • @ChristopherJohnson-st6fn
    @ChristopherJohnson-st6fn Рік тому

    Great video Tim! Are you the same Tim from Algo expert?

  • @nadeemshaik157
    @nadeemshaik157 5 місяців тому

    Can we download the songs too using this

  • @bben4507
    @bben4507 10 місяців тому +2

    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
      @louiseti4883 9 місяців тому +1

      Same prblm here, did you find a way of resolution ?
      Issue fixed : forgot "?" line 37

    • @bben4507
      @bben4507 9 місяців тому

      @@louiseti4883 No.

    • @rootytuners
      @rootytuners 8 місяців тому

      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
      @bben4507 8 місяців тому

      I am not working on this project now. But I'll have a try later. Thank you for sharing!@@rootytuners

    • @tosyyyaaa
      @tosyyyaaa 7 місяців тому +1

      Hi! Almost the same trouble here, but i get error 401, message “no token provided”. Has anyone been able to solve it yet?

  • @user-xd8vu1cv7n
    @user-xd8vu1cv7n 9 місяців тому

    I am getting status code as 400 and I am unable to find the token , anybody can help me with it?

  • @user-sh2ds6sn8g
    @user-sh2ds6sn8g 3 місяці тому +6

    when i create the app, it asks me for a website? i dont fully understand what that is.

  • @jpromero9391
    @jpromero9391 Рік тому

    Can we play any Track and if so, how many seconds do we get from each Track?

    • @AkamaiDeveloper
      @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
      @henrygalvan9333 Рік тому

      You have to do it diff cause you need more then the token, you need authorization

  • @096r.s.sreeharish8
    @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
      @AkamaiDeveloper  Рік тому +1

      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
      @096r.s.sreeharish8 Рік тому

      @@AkamaiDeveloper ok sir i will see it and ask u doubts if any

  • @user-hv9oh1zj4r
    @user-hv9oh1zj4r 5 місяців тому

    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
      @AkamaiDeveloper  4 місяці тому

      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/

  • @tokicorp1129
    @tokicorp1129 Рік тому

    how would i adapt this to look for a user's top tracks?

    • @AkamaiDeveloper
      @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.

  • @enjoyourjoint5012
    @enjoyourjoint5012 3 дні тому

    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

  • @harrisongazeley8028
    @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
      @nemoterbogt6905 Рік тому

      using authorization code flow instead of client cridential for authentication might also help

    • @AkamaiDeveloper
      @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
      @AnilSakhat Рік тому

      @@nemoterbogt6905 8

    • @gikis1
      @gikis1 4 місяці тому

      Had the same issue. Used spotipy instead.

  • @sarafattack3188
    @sarafattack3188 Рік тому +1

    Hey great video, thank you :) I keep getting an error "KeyError: 'access_token'" - pls could you advise? Many thanks 😃

    • @AkamaiDeveloper
      @AkamaiDeveloper  Рік тому +1

      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
      @sarafattack3188 Рік тому

      @@AkamaiDeveloper Got it working, thanks sm!

    • @AkamaiDeveloper
      @AkamaiDeveloper  Рік тому

      That's excellent, we're always happy to hear whenever anyone is able to successfully use our project ideas!

    • @shivajeetrai1618
      @shivajeetrai1618 Рік тому

      @linode could you please tell me what changes you made to make this work! thanks

    • @smartblackgirl
      @smartblackgirl 8 місяців тому

      @@shivajeetrai1618did you find out how? I’m struggling with this as well

  • @user-zh9pk2wo7z
    @user-zh9pk2wo7z 16 днів тому

    Nice thumbnail

  • @Calabrien
    @Calabrien 10 місяців тому +1

    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
      @WetCoffnMout 8 місяців тому +1

      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.

  • @kyleryxn
    @kyleryxn Рік тому

    Can you do one with Java?

  • @sanishthomas2858
    @sanishthomas2858 5 місяців тому

    is it open AP|I?

  • @mashiruwu9944
    @mashiruwu9944 Рік тому +1

    I love you

  • @thepaavamdude537
    @thepaavamdude537 Рік тому +6

    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")

  • @Beefire
    @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
      @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
      @Beefire Рік тому

      Thanks! I'll have a look over now 😁

  • @user-rw1ih3fv4m
    @user-rw1ih3fv4m Рік тому

    I’m stuck on trying to get the token I keep getting “{‘error’: ‘invalid_client’}” any suggestions?

    • @AkamaiDeveloper
      @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

  • @SefianeRyany
    @SefianeRyany Рік тому +1

    Hey great video, THANK YOU . I keep getting an error "KeyError: 'access_token'"
    pls could you advise?

    • @karanchhangani000
      @karanchhangani000 Рік тому +8

      "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
      @ezrahighsmith9100 Рік тому

      @@karanchhangani000 damn, that space saved the day haha, thank you!

    • @adityapatwal4157
      @adityapatwal4157 8 місяців тому

      @@karanchhangani000 bro the space got me tweakin

  • @AngirasDarbha
    @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"

  • @xufeike383
    @xufeike383 2 місяці тому

    Thank for your video! But i got {'error': {'status': 404, 'message': 'Service not found'}}。
    Who can help me plz

  • @campagnollo
    @campagnollo 6 місяців тому

    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
      @YashSharma-zg1uk 5 місяців тому

      same man, did you get the solution for that?

    • @AkamaiDeveloper
      @AkamaiDeveloper  4 місяці тому

      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

  • @eshuvgautam3186
    @eshuvgautam3186 Рік тому

    result = post(url, header=header, data=data)
    NameError: name 'post' is not defined
    I am getting this please help me on this

  • @channel-lk6xz
    @channel-lk6xz 5 місяців тому

    can i do this with jupyter notebook?

    • @AkamaiDeveloper
      @AkamaiDeveloper  4 місяці тому

      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

  • @twelvefretter7560
    @twelvefretter7560 9 місяців тому

    The code runs successfully unless I specify specific result items: artist_id = result["id"]
    TypeError: 'NoneType' object is not subscriptable

    • @twelvefretter7560
      @twelvefretter7560 9 місяців тому

      I can see the artist info in the terminal output prior to the error

    • @twelvefretter7560
      @twelvefretter7560 9 місяців тому

      Discovered that I had an underscore rather than a hyphen in top-tracks! All good!

    • @user-nd9kn5mo9u
      @user-nd9kn5mo9u 8 місяців тому

      how did you fix that

  • @nikhilkambli5050
    @nikhilkambli5050 7 місяців тому

    {
    "error": {
    "status": 401,
    "message": "No token provided"
    }
    }
    how do i correct this error

    • @AkamaiDeveloper
      @AkamaiDeveloper  4 місяці тому

      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
      @ZeeAcez 4 місяці тому

      I just mispelled "Authorization" in the get_auth_header and got that error

  • @eeffeecct
    @eeffeecct 9 місяців тому +1

    {'error': {'status': 401, 'message': 'Invalid access token'}}

    • @matthewstephens8436
      @matthewstephens8436 Місяць тому

      I'm getting the same error, did you ever get it fixed

    • @eeffeecct
      @eeffeecct Місяць тому

      @@matthewstephens8436 Yeah, I fixed it, but I don't remember how.

  • @elumalaim6857
    @elumalaim6857 Рік тому

    This is neat which the documentation fails to provide.

  • @user-zl5jb4fb6c
    @user-zl5jb4fb6c Рік тому +2

    bro in output im getting none none

  • @multiamphetaminsaft
    @multiamphetaminsaft Рік тому +20

    Well explained video for a terrible API.

  • @maybenew7293
    @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
      @AkamaiDeveloper  Рік тому +1

      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

    • @maybenew7293
      @maybenew7293 Рік тому

      @@AkamaiDeveloper ♥

  • @basedondn
    @basedondn 5 місяців тому

    why isnt pip being recognised for me?

    • @AkamaiDeveloper
      @AkamaiDeveloper  4 місяці тому

      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

  • @govindjha4457
    @govindjha4457 Рік тому

    I am getting 404 error any help please

    • @odonkhuuzolboo750
      @odonkhuuzolboo750 Рік тому

      ah same.. could you fix it ?

    • @chelseaharding4513
      @chelseaharding4513 Рік тому +2

      I was getting this too. What I did was go back and add in the "?" to the query_url and then it worked

  • @user-zl5jb4fb6c
    @user-zl5jb4fb6c Рік тому +1

    error 404 service not found error

    • @lucasgonzalezsonnenberg3204
      @lucasgonzalezsonnenberg3204 Рік тому

      I´m getting the same error.

    • @AkamaiDeveloper
      @AkamaiDeveloper  Рік тому +3

      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"
      ua-cam.com/video/WAmEZBEeNmg/v-deo.html&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
      @MaximusPrima 6 місяців тому

      Putting a "?" at the beginning helped !@@AkamaiDeveloper

  • @RamuGawer
    @RamuGawer Рік тому

    Lll

  • @twistedrobin8769
    @twistedrobin8769 Рік тому +3

    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
      @maybenew7293 Рік тому +1

      Thank you!

    • @maybenew7293
      @maybenew7293 Рік тому +1

      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
      @maybenew7293 Рік тому

      Hey did you eventually have it all running=

  • @maybenew7293
    @maybenew7293 Рік тому +2

    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
      @maybenew7293 Рік тому +2

      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))