Deezer

Deezer


Deezer API Documentation

Deezer API is a public API that allows developers to access the Deezer music platform’s data and functionality. With Deezer API, developers can create third-party applications that allow users to search, stream and organize music on the Deezer platform.

Authentication

To use Deezer API, you must first register your application on the Deezer developers’ website, and obtain an API key. Deezer API uses OAuth2 to authenticate requests.

// Authentication example

const client_id = 'YOUR CLIENT ID';
const client_secret = 'YOUR CLIENT SECRET';
const authorize_url = `https://connect.deezer.com/oauth/auth.php?app_id=${client_id}&redirect_uri=YOUR_REDIRECT_URL&perms=basic_access,email,offline_access`;

// redirect user to authorize_url, and get access token upon successful authentication

Search API

The Deezer Search API allows developers to search for tracks, artists, albums, playlists, podcasts and radio channels on the Deezer platform.

// Search example

const query = 'love';
const search_type = 'track';

fetch(`https://api.deezer.com/search/${search_type}?q=${query}`)
    .then((response) => response.json())
    .then((data) => {
        console.log(data); // returns search results in JSON format
    });

Track API

The Deezer Track API allows developers to retrieve details about tracks on the Deezer platform, such as the song title, artist, album, genre, duration, and cover art.

// Track example

const track_id = 3135556;

fetch(`https://api.deezer.com/track/${track_id}`)
    .then((response) => response.json())
    .then((data) => {
        console.log(data); // returns track details in JSON format
    });

Playlist API

The Deezer Playlist API allows developers to retrieve details about playlists on the Deezer platform, such as the playlist title, creator, fans, number of tracks, and cover art.

// Playlist example

const playlist_id = 908622995;

fetch(`https://api.deezer.com/playlist/${playlist_id}`)
    .then((response) => response.json())
    .then((data) => {
        console.log(data); // returns playlist details in JSON format
    });

Artist API

The Deezer Artist API allows developers to retrieve details about artists on the Deezer platform, such as the artist name, genre, biography, fans, and albums.

// Artist example

const artist_id = 27;

fetch(`https://api.deezer.com/artist/${artist_id}`)
    .then((response) => response.json())
    .then((data) => {
        console.log(data); // returns artist details in JSON format
    });

Conclusion

Deezer API provides developers with an interface to access and integrate the Deezer music platform’s data and functionality seamlessly into their applications. By leveraging Deezer API, you can create amazing music-based applications that improve the user experience and drive greater engagement.