Skip to content

Latest commit

 

History

History
71 lines (47 loc) · 2.09 KB

README.md

File metadata and controls

71 lines (47 loc) · 2.09 KB

Deezer API Python 3 Example

Example of working with Deezer API in Python 3.

Download your listening history with this simple Flask App!

Used libraries:

Based on Requests-OAuthlib GitHub OAuth 2 Tutorial

To Get Started

  1. Create a new Deezer Application at the Deezer for developers

Important: When creating your app, set field Redirect URL after authentication to http://127.0.0.1:5000/callback

Other fields can be set to whatever you want :)

  1. Fill in missing fields in "config.json" file
  • app_id:
    "Application ID" in application settings

    (Example: 289071)

  • client_secret:
    "Secret Key" in application settings

    (Example: 23a1ca17cf5ea13a03e1f4155320aec6)

  • user_id:
    "Deezer User ID" from your profile page URL

    (Example: if your profile page URL is "https://www.deezer.com/en/profile/102643295", your User ID is 102643295)

  1. Install dependencies:
    pip install -r requirements.txt

  2. Launch your application
    python3 app.py

  3. Go to http://127.0.0.1:5000/ in your web-browser

You will be asked to give permissions to your newly created application.

Press "Accept".

After that you should see the line:
History has been loaded! Check out the file in the project directory :)

If this line appears, congratulations!
You have successfully downloaded all of your available Deezer listening history!

  1. Open "deezer_history<current_date>.json" file in your project directory.

It's structure is basically:

{
    "data": [
        {track_1_dict},
        {track_2_dict},
        ...
        {track_n_dict}
    ]
}

For the format of track information, see Deezer API Explorer.

Further information

Check Deezer API Page for more information on Deezer API.