Data Retrieval Script: A Python script that uses Spotipy to interact with the Web API and retrieve a user's saved tracks, playlists, and recently played tracks. Outputs to console.
To use this script, you will need to install the Spotipy library. You can do this using pip:
pip install spotipy
Clone this repository to your local machine.
Enter your client ID, client secret, and redirect URI when prompted.
Run the script using the command :
python _data_retrieval.py
The script will then retrieve the user's saved tracks, playlists, and recently played tracks, and print them out to the console.
Go to https://developer..com/dasard/ and log in to your account (or create a new account if you don't have one).
Create a new app by clicking the "Create an App" button and fill in the required information.
Once your app is created, you will see the "Client ID" and "Client Secret" on the app dasard. Copy these values to a secure location, as you will need them later.
Add the "Redirect URI" for your app by clicking the "Edit Settings" button and entering the URI under the "Redirect URIs" section. This URI will be used to authenticate your app and obtain an access token for the API (eg. https://open..com/? ).
Note : You can also use environment variables to store your credentials and access them in your code.
After obtaining the Client ID, Client Secret & Redirect URI,
Install the Spotipy library by running
pip install spotipy
in your terminal. (in case if you don't have)Download the script from the repository.
Open the script in your preferred code editor/terminal.
Paste your client_id, client_secret, and redirect_uri values in the input() function at the beginning of the script.
Run the script.
The script will prompt you to authenticate with through the browser.
Once authenticated, the script will retrieve your saved tracks, playlists, and recently played tracks from your account and display them in the console.