Exporting a Deezer Playlist

01 October 2017 - Node.js


Today I had to export a playlist from Deezer for an event. The DJ who will care for the event’s music asked me for title ideas. I have hacked together a quick-and-dirty Node.js script that generates a Markdown music list from Deezer playlists. Maybe it is useful for other people, too.

Getting the Access Token

First, you have to create an application in Deezer’s API portal.

Next, you can interactively get an access token using the following URL:


Note that it doesn’t matter if the redirect URI exists. You are just interested in the access token that is embedded in the redirect URI.

Export Script

const fetch = require('node-fetch');

async function run() {
    const response = await fetch('https://api.deezer.com/user/me/playlists?output=json&access_token=YOUR_ACCESS_TOKEN');
    const playlists = await response.json();
    const partyPlaylists = playlists.data.filter(p => p.title.startsWith('something'));
    console.log('# Dinner');
    await processPlaylist(partyPlaylists.find(p => p.title === 'Dinner'));
    console.log('# Party');
    await processPlaylist(partyPlaylists.find(p => p.title === 'Party'));
    console.log('# Dance Music');
    for (let playlist of partyPlaylists.filter(p => p.title !== 'Dinner' && p.title !== 'Party')) {
        console.log(`## ${playlist.title}`);
        await processPlaylist(playlist);

async function processPlaylist(playlist) {
    const response = await fetch(`https://api.deezer.com/playlist/${playlist.id.toString()}?output=json&access_token=YOUR_ACCESS_TOKEN`);
    const details = await response.json();
    for (let track of details.tracks.data) {
        console.log(`1. ${track.title} - ${track.artist.name}`);


Export the output into a Markdown file.

Create PDF

Once I had the Markdown playlist, I used pandoc (see my blog post Markdown and Pandoc for Conceptual Documents for details) to convert it to PDF.

Hope that this quick-and-dirty hack is useful for somebody.