Introduction
Deezer Public API is a high-level wrapper around the Deezer Developers API. It provides a clean, type-safe interface for searching and fetching data about artists, albums, tracks, playlists, users, and more.
Why Version 2?
Version 2 is a complete rewrite of the library from the ground up, focusing on:
- Type Safety: Moving from plain JavaScript to TypeScript with extensive interface definitions.
- Zero Runtime Dependencies: The package has 0 external dependencies at runtime, reducing your attack surface and keeping your project lightweight.
- Schema Integrity: Response types match the real Deezer API structure and are continuously validated against live data.
- Native Standards: Uses the built-in Fetch API, avoiding bloated third-party HTTP clients.
- Modern ESM: Optimized for modern Node.js environments while maintaining CommonJS compatibility.
- Improved DX: Intuitive search builder and native pagination helpers that reduce boilerplate.
Core Concepts
The Client
Everything starts with the DeezerPublicApi class. It manages the base URL, rate limiting, and core request logic. You can also provide a custom userAgent to identify your application to Deezer.
Modules
API endpoints are grouped into modules (Album, Artist, Search, etc.). This modular approach makes the API easy to explore and use.
Pagination
Unlike the standard API which gives you simple URLs for next/prev pages, this library wraps them into next() and prev() methods that you can await directly.
Real-world Usage
See how projects like Nuclear Music Player and thousands of Discord bots use this library in our Use Cases guide.
Public API Only
This library is designed for the Public API, meaning you can start using it immediately without registering for an API key or handling complex OAuth flows. It focuses on data that is openly available on the Deezer platform.