Api Reference
Search Module
Search for any type of resource on Deezer.
General Search
const results = await deezer.search({ q: "Daft Punk" });
All search methods return a PaginationResult containing an array of data.
export interface PaginationResult<T> {
data: T[];
total?: number;
next?: () => Promise<PaginationResult<T>>;
prev?: () => Promise<PaginationResult<T>>;
}
{
"data": [
{
"id": 67238732,
"readable": true,
"title": "Instant Crush (feat. Julian Casablancas)",
"title_short": "Instant Crush",
"title_version": "(feat. Julian Casablancas)",
"isrc": "USQX91300105",
"link": "https://www.deezer.com/track/67238732",
"duration": 337,
"rank": 942491,
"explicit_lyrics": false,
"explicit_content_lyrics": 0,
"explicit_content_cover": 0,
"preview": "https://cdnt-preview.dzcdn.net/api/1/1/d/6/b/0/d6bc80aadfa1d7625d59a6620f229371.mp3?hdnea=exp=1774969892~acl=/api/1/1/d/6/b/0/d6bc80aadfa1d7625d59a6620f229371.mp3*~data=user_id=0,application_id=42~hmac=a1671cdc590ccdef156afe51756f3784f888fc7af803f6de720e0b6c52b83fc9",
"md5_image": "311bba0fc112d15f72c8b5a65f0456c1",
"artist": {
"id": 27,
"name": "Daft Punk",
"link": "https://www.deezer.com/artist/27",
"picture": "https://api.deezer.com/artist/27/image",
"picture_small": "https://cdn-images.dzcdn.net/images/artist/638e69b9caaf9f9f3f8826febea7b543/56x56-000000-80-0-0.jpg",
"picture_medium": "https://cdn-images.dzcdn.net/images/artist/638e69b9caaf9f9f3f8826febea7b543/250x250-000000-80-0-0.jpg",
"picture_big": "https://cdn-images.dzcdn.net/images/artist/638e69b9caaf9f9f3f8826febea7b543/500x500-000000-80-0-0.jpg",
"picture_xl": "https://cdn-images.dzcdn.net/images/artist/638e69b9caaf9f9f3f8826febea7b543/1000x1000-000000-80-0-0.jpg",
"tracklist": "https://api.deezer.com/artist/27/top?limit=50",
"type": "artist"
},
"album": {
"id": 6575789,
"title": "Random Access Memories",
"cover": "https://api.deezer.com/album/6575789/image",
"cover_small": "https://cdn-images.dzcdn.net/images/cover/311bba0fc112d15f72c8b5a65f0456c1/56x56-000000-80-0-0.jpg",
"cover_medium": "https://cdn-images.dzcdn.net/images/cover/311bba0fc112d15f72c8b5a65f0456c1/250x250-000000-80-0-0.jpg",
"cover_big": "https://cdn-images.dzcdn.net/images/cover/311bba0fc112d15f72c8b5a65f0456c1/500x500-000000-80-0-0.jpg",
"cover_xl": "https://cdn-images.dzcdn.net/images/cover/311bba0fc112d15f72c8b5a65f0456c1/1000x1000-000000-80-0-0.jpg",
"md5_image": "311bba0fc112d15f72c8b5a65f0456c1",
"tracklist": "https://api.deezer.com/album/6575789/tracks",
"type": "album"
},
"type": "track"
}
],
"total": 170
}
Specialized Search
Limit your search to a specific type. All methods return a PaginationResult containing an array of specific resource types.
These methods accept either a plain query string or a SearchBuilder instance.
// Using a string
await deezer.search.artist({ q: "Daft Punk" });
// Using the builder
const builder = deezer.search.builder("Daft Punk").strict();
await deezer.search.artist({ q: builder });
// All specialized methods share this signature:
await deezer.search.artist({ q, order, limit, index, strict });
Search Builder
For complex queries, use the builder():
const query = deezer.search.builder("Daft Punk")
.album("Discovery")
.strict()
.build();
const results = await deezer.search({ q: query });
Builder Methods
.artist(name): Filter by artist..album(title): Filter by album..track(title): Filter by track..label(name): Filter by label..durMin(seconds)/.durMax(seconds): Filter by duration..bpmMin(val)/.bpmMax(val): Filter by BPM..strict(): Enable strict matching..order(order): Set sorting order.