Deezer’s API with python
3 min readApr 21, 2020
This article will show you how to use Deezer’s API with python and Flask. We will create a project, see how to authenticate to the API, use some route to retrieves information and play music with the plugin.
Prerequisite
- You need a Deezer account
- Go to https://developers.deezer.com/myapps and create an a new app. You can set http://127.0.0.1:5000/deezer/login in Redirect URL field.
- You will need your Application ID, Secret Key and the Redirect URL to use the API
Set up project
- Create your project
- Create your virtual env
- Install packages
pip install Flask
pip install request
4. Add an app.py file. Add the code below in it, and fill your information in the three variables.
from flask import Flask
app = Flask(__name__)
DEEZER_APP_ID = "MY_APP_ID"
DEEZER_APP_SECRET = "MY_APP_SECRET"
DEEZER_REDIRECT_URI = "http://127.0.0.1:5000/deezer/login"
@app.route('/')
def default():
pass
if __name__ == '__main__':
app.run()
Your project is now ready.
OAuth
You can find the documentation here: developers.deezer.com/api/oauth