Use studio code (https://code.visualstudio.com/) Make two python files secrets.py & main.py Go to Spotify developer page and register (https://developer.spotify.com/dashboard/login) Click create an app Give it a suitable name and description (e.g., spotify_tutorial, test app) Non-commercial, accept all the blurb. Submit and you will get a client ID and a client secret. Mine were (client_id = 34096a28d81b4c4ba02c4501bd6a1ae5) (client_secret = 76efb8cb163e4604bcdcbdf54ef3a8e6) Edit settings and enter a redirect uri. This can be anything I used...... https://daftjoe.github.io/ Copy the client ID, client secret and redirect uri into secrets.py Now you have to issue a GET request for authorisation using the data from above. BUT….. It’s not that simple!!! “GET https://accounts.spotify.com/authorize” (that is the basic command with the following parameters client_id = your client_id (34096a28d81b4c4ba02c4501bd6a1ae5) response_type = code redirect_uri = This has to be a URL encoded version of what you supplied in building the app (https://daftjoe.github.io/) To get this go to https://www.urlencoder.org/. Ensure the “Encode” option is selected and paste your URI into the space provided. Click “Encode” and the encoded URL will appear in the space below. Thus: https%3A%2F%2Fdaftjoe.github.io%2F scope = playlist-modify-public AND playlist-modify-private (this may be different depending on what you want the app to do! See scopes in the developer documentation for more). That’s it! So the actual GET request is as follows. All on one line with no spaces….. GET https://accounts.spotify.com/authorize?client_id=34096a28d81b4c4ba02c4501bd6a1ae5&response_type=code&redirect_uri=https%3A%2F%2Fdaftjoe.github.io%2F&scope=playlist-modify-public%20playlist-modify-private So this will give an access token that lasts for 1 hour (This can be renewed. See later)… The GET request has a partner POST request so that the app and Spotify can work together. There is an example of the “curl” command used on this page https://developer.spotify.com/documentation/general/guides/authorization-guide/ curl -H "Authorization: Basic ZjM...zE=" -d grant_type=authorization_code -d code=MQCbtKe...44KN -d redirect_uri=https%3A%2F%2Fwww.foo.com%2Fauth https://accounts.spotify.com/api/token This command can be modified as follows for our needs To check curl is installed start a cmd prompt and type curl If “curl: try 'curl --help' for more information” is returned then all is well. If not then “https://develop.zendesk.com/hc/en-us/articles/360001068567-Installing-and-using-cURL” is one site to find it. To modify the curl command do the following "Authorization: Basic ZjM...zE=" This is a combination of client_id and client_secret but 64 bit encoded to get this put the client_id and client_secret together, joined with a colon thus Client_id : client_secret 34096a28d81b4c4ba02c4501bd6a1ae5:76efb8cb163e4604bcdcbdf54ef3a8e6 Open this page https://www.base64encode.org/ Ensure the “Encode” option is selected and paste the whole thing into the space provided. Click “Encode” and the result will appear in the space below. Thus: MzQwOTZhMjhkODFiNGM0YmEwMmM0NTAxYmQ2YTFhZTU6NzZlZmI4Y2IxNjNlNDYwNGJjZGNiZGY1NGVmM2E4ZTY= This replaces the ZjM…zE= part of the command -d grant_type=authorization_code stays exactly the same -d code= From the GET command. To get this simply enter the https://accounts.spotify.com/authorize?client_id=34096a28d81b4c4ba02c4501bd6a1ae5&response_type=code&redirect_uri=https%3A%2F%2Fdaftjoe.github.io%2F&scope=playlist-modify-public%20playlist-modify-private into a web browser and hit enter. The resulting webpage may or may not work (mine doesn’t) but the code that is returned in the browser address bar is all that is required. Copy this code in its entirety (it is very long) and paste this into the curl command after the second -d code= thus -d code= AQC83kG40o81oaJIV--Yjbk3AKGnoT66sm2jV9wB3uRzo68yxFeO-j59Cc20OppPRJqQ61fMf3Nrz3QxfIv6EhcZ68nGeuJIbJcNwwciecY2tX7IfppCQ9CeFrnjj8TSSjb0mnBiQBkK__obVKsECqxQfGbgJC2b0CiFcX_yQVWRGwgvbDPBgGIetTnroPujKra_Pmu7tmopQChGE0oUXhVB1UJCOr7f6vaRoDOhuQ -d redirect_uri= The encoded uri from above https%3A%2F%2Fdaftjoe.github.io%2F Then a space followed by https://accounts.spotify.com/api/token So that makes the final curl command curl -H "Authorization: Basic MzQwOTZhMjhkODFiNGM0YmEwMmM0NTAxYmQ2YTFhZTU6NzZlZmI4Y2IxNjNlNDYwNGJjZGNiZGY1NGVmM2E4ZTY=" -d grant_type=authorization_code -d code=AQC83kG40o81oaJIV--Yjbk3AKGnoT66sm2jV9wB3uRzo68yxFeO-j59Cc20OppPRJqQ61fMf3Nrz3QxfIv6EhcZ68nGeuJIbJcNwwciecY2tX7IfppCQ9CeFrnjj8TSSjb0mnBiQBkK__obVKsECqxQfGbgJC2b0CiFcX_yQVWRGwgvbDPBgGIetTnroPujKra_Pmu7tmopQChGE0oUXhVB1UJCOr7f6vaRoDOhuQ -d redirect_uri=https%3A%2F%2Fdaftjoe.github.io%2F https://accounts.spotify.com/api/token The code in red will expire after one hour unless it is refreshed The response you get from curl should be something like:- {"access_token":"BQAun84rQCsx0Gvio32AgGZCQ4LbSUmNf5mheTY4IML4UbkBbyRfNg97ZlF6szvth6YLg35wJzVEI-cyhiXweb1pKg7UWUxKasrKRn4kxvnxT8qlP6_e3ZE2vVWWpE3R4iTac76AHuZRSQ7FNQDaktF6SvybW8jxMeMlttqbl65fznuGBM5qWybZmimQuo_K7gpN3P2uLE4","token_type":"Bearer","expires_in":3600,"refresh_token":"AQAKdDn2MU3AQrazxRite3jPTD88K5qHGSvaLXaQaU7fpxKwhxDnSArZPWyNoteAmTKXnGTt1hSOuqymYKmFdLnJO4ZU_q3kBWBqMN9ZkkmSPuzoYxvGhMY7RR6OCI5bSVc","scope":"playlist-modify-private playlist-modify-public"} You need the “access_token” to keep the app accessible for up to 60 minutes. "BQAun84rQCsx0Gvio32AgGZCQ4LbSUmNf5mheTY4IML4UbkBbyRfNg97ZlF6szvth6YLg35wJzVEI-cyhiXweb1pKg7UWUxKasrKRn4kxvnxT8qlP6_e3ZE2vVWWpE3R4iTac76AHuZRSQ7FNQDaktF6SvybW8jxMeMlttqbl65fznuGBM5qWybZmimQuo_K7gpN3P2uLE4" Note also the “expires_in” value of 3600 or 1 hour. This is when the token stops working The “refresh_token” can be used to keep the app available for as long as needed. Copy the refresh token to your secrets.py then when the refresh.py is called it will "refresh" the token to keep it available for as long as necessary. For further details in the use of these facilities see Euan Morgans first Youtube video. Start again at 10.30