Spotify API
Dokumentasi resmi untuk endpoint Spotify Downloader. Endpoint ini punya 2 mode: search (query teks) memakai spotifySearch.js dengan Spotify partner API + TOTP auth (no env vars needed, no DDG/Bing), dan download (Spotify URL) memakai spotmate.js untuk konversi audio MP3. Thumbnail, preview, dan audio URL di-rewrite ke domain API ini.
Wajib API Key
Cost 5 per request berhasil
Proxy gratis tanpa apikey
Refund otomatis kalau gagal
Engine: spotifySearch.js + spotmate.js
Domain aktif
Dashboard
https://api.chioriya.my.idSearch Endpoint
GET /api/spotify?q=...&apikey=...Download Endpoint
GET /api/spotify?url=...&apikey=...Thumb Proxy
GET /api/spotify/thumb?url=<id>Audio Proxy
GET /api/spotify/audio?t=<token>Quick Start
GET https://api.chioriya.my.id/api/spotify?q=Enchanted&apikey=YOUR_APIKEY
Endpoint /api/spotify wajib memakai API key panel. Cost 5 limit per request berhasil (refund otomatis kalau gagal). Ada 2 mode:
Search (input = query teks): return
Download (input = Spotify URL): return
Search (input = query teks): return
allSongs (5 lagu) dengan previewUrl 30-detik. pickedSong dan audioUrl = null.Download (input = Spotify URL): return
pickedSong + audioUrl (full MP3) + allSongs.
Contoh response Search (query)
{
"status": true,
"ok": true,
"source": "spotify",
"traceId": "spotify_search_abc123",
"input": "Enchanted",
"inputType": "query",
"auth": "apikey",
"cost": 5,
"contentType": "search",
"pickedSong": null,
"allSongs": [
{
"title": "Enchanted",
"artist": "Taylor Swift",
"url": "https://open.spotify.com/track/1nyySeUvIxeIydsDL4G80X",
"thumbnail": "/api/spotify/thumb?url=ab67616d0000b2730ac2865a6b8b6ffecf85ce7d",
"originalThumbnail": "https://i.scdn.co/image/ab67616d0000b2730ac2865a6b8b6ffecf85ce7d",
"duration": 353,
"spotifyId": "1nyySeUvIxeIydsDL4G80X",
"previewUrl": "/api/spotify/audio?t=aHR0cHM6...",
"originalPreviewUrl": "https://p.scdn.co/mp3-preview/abc123..."
},
{ "title": "Enchanted (Taylor's Version)", ... },
...total 5 songs
],
"audioUrl": null,
"audioType": null,
"audioError": null
}
Contoh response Download (URL)
{
"status": true,
"ok": true,
"source": "spotify",
"traceId": "spotify_search_def456",
"input": "https://open.spotify.com/track/1nyySeUvIxeIydsDL4G80X",
"inputType": "url",
"auth": "apikey",
"cost": 5,
"contentType": "track",
"pickedSong": {
"title": "Enchanted",
"artist": "Taylor Swift",
"url": "https://open.spotify.com/track/1nyySeUvIxeIydsDL4G80X",
"thumbnail": "/api/spotify/thumb?url=ab67616d0000b2730ac2865a6b8b6ffecf85ce7d",
"originalThumbnail": "https://i.scdn.co/image/ab67616d0000b2730ac2865a6b8b6ffecf85ce7d",
"duration": 353,
"spotifyId": "1nyySeUvIxeIydsDL4G80X"
},
"allSongs": [],
"audioUrl": "/api/spotify/audio?t=aHR0cHM6...",
"originalAudioUrl": "https://rapid.dlapi.app/download/tracks/...",
"audioType": "instant",
"audioError": null
}
Endpoint Spotify
SearchQuery teks → 5 lagu + preview URL.
GET /api/spotify?q=...DownloadSpotify URL → pickedSong + audioUrl MP3.
GET /api/spotify?url=...Thumb ProxyStream thumbnail i.scdn.co. Gratis.
GET /api/spotify/thumbAudio ProxyStream audio/preview MP3. Gratis.
GET /api/spotify/audioParameter Main Endpoint
| Param | Default | Keterangan |
|---|---|---|
apikey / header x-api-key / Bearer | wajib | API key panel bot. Cost 5 limit per request berhasil. Refund otomatis kalau gagal. |
q / query | โ | Query pencarian untuk mode search. Contoh: Enchanted, Another Love. Return 5 lagu dengan preview URL. pickedSong = null. |
url | โ | Spotify URL untuk mode download. Contoh: https://open.spotify.com/track/xxx. Mendukung track, album, playlist. Return pickedSong + audioUrl. |
API otomatis deteksi mode: kalau input diawali
http:// atau https:// → mode download. Selain itu → mode search.Parameter Proxy Endpoints (GRATIS, gak butuh apikey)
| Endpoint | Param | Keterangan |
|---|---|---|
/api/spotify/thumb | url | Image ID dari i.scdn.co (contoh: ab67616d0000b2730b04da4f224b51ff86e0a481). Bisa juga full URL. |
/api/spotify/audio | t | Base64url token (dari field audioUrl atau previewUrl di response). Stateless, selalu works. |
Cara kirim API key (main endpoint)
- Query string:
?apikey=YOUR_APIKEY - Header:
x-api-key: YOUR_APIKEY - Authorization Bearer:
Authorization: Bearer YOUR_APIKEY - POST body JSON:
{ "apikey": "YOUR_APIKEY" }
Proxy endpoints (
/api/spotify/thumb dan /api/spotify/audio) gak butuh apikey dan gak ngurangin limit. Buka/download URL dari response JSON sepuasnya.URL Proxy Rewriting
Thumbnail, preview, dan audio URL di response sudah di-rewrite ke domain API ini. Proxy endpoints gak butuh apikey dan gak ngurangin limit.
- thumbnail:
/api/spotify/thumb?url=<image_id>โ contoh:/api/spotify/thumb?url=ab67616d0000b2730b04da4f224b51ff86e0a481 - previewUrl:
/api/spotify/audio?t=<base64url_token>โ 30-detik preview darip.scdn.co. Hanya ada di mode search. - audioUrl:
/api/spotify/audio?t=<base64url_token>โ full MP3 darirapid.dlapi.app. Hanya ada di mode download. - originalThumbnail: URL thumbnail asli dari
i.scdn.co - originalPreviewUrl / originalAudioUrl: URL asli sebelum di-rewrite
Host yang di-allow untuk proxy
Thumb: i.scdn.co
Audio: rapid.dlapi.app, dlapi.app, audio-ak-spotify-com.akamaized.net,
audio-fa.scdn.co, audio-gm-off.scdn.co, audio-off.scdn.co,
audio-mp3-fa.scdn.co, audio-fa.spotifycdn.com, p.scdn.co
Host lain diluar list di atas akan ditolak dengan 403. Audio proxy pakai base64url token (stateless) jadi selalu works di serverless.
Struktur Response
| Field | Tipe | Keterangan |
|---|---|---|
status / ok | boolean | true kalau request sukses. |
source | string | Selalu spotify. |
traceId | string | ID trace untuk pelacakan error. |
input / inputType | string | Input asli dan tipe (query atau url). |
auth / cost | string/number | Selalu apikey dan cost yang dipotong (5). |
contentType | string | search (mode search), track/album/playlist (mode download). |
pickedSong | object|null | null di mode search. Di mode download: lagu terpilih dengan title, artist, url, thumbnail (proxy), originalThumbnail, duration, spotifyId. |
allSongs | array | Mode search: 5 lagu dengan previewUrl (30-detik). Mode download: list lagu lain (kosong untuk single track). |
audioUrl | string|null | null di mode search. Di mode download: full MP3 URL yang sudah di-rewrite ke /api/spotify/audio?t=.... |
originalAudioUrl | string|null | Audio URL asli dari rapid.dlapi.app sebelum di-rewrite. Hanya di mode download. |
audioType | string|null | instant atau async. Hanya di mode download. |
audioError | string|null | Pesan error kalau konversi audio gagal. |
remaining | number | Sisa limit panel setelah request. |
Search → Download flow: Panggil
/api/spotify?q=... untuk cari lagu. Pilih lagu dari allSongs, lalu panggil /api/spotify?url=song_url untuk download full MP3. Cost 5 limit per request.Examples
1. Search lagu (query → list 5 lagu + preview)
fetch("/api/spotify?q=Enchanted&apikey=YOUR_APIKEY")
.then(res => res.json())
.then(data => {
console.log("Found", data.allSongs.length, "songs");
data.allSongs.forEach((song, i) => {
console.log(`${i+1}. ${song.title} - ${song.artist}`);
console.log(" URL:", song.url);
console.log(" Preview:", song.previewUrl);
console.log(" Thumbnail:", song.thumbnail);
});
});
2. Search + Download (query → pilih lagu → download MP3)
// Step 1: Search lagu
const searchRes = await fetch("/api/spotify?q=Enchanted&apikey=YOUR_APIKEY");
const searchData = await searchRes.json();
// Step 2: Pilih lagu pertama dari allSongs
const song = searchData.allSongs[0];
console.log("Downloading:", song.title, "-", song.artist);
// Step 3: Download full MP3 pakai URL lagu yang dipilih
const dlRes = await fetch("/api/spotify?url=" + encodeURIComponent(song.url) + "&apikey=YOUR_APIKEY");
const dlData = await dlRes.json();
// Step 4: Audio URL siap untuk stream/download (gratis, gak butuh apikey)
console.log("Audio URL:", dlData.audioUrl);
console.log("Picked:", dlData.pickedSong.title, "-", dlData.pickedSong.artist);
// Play di browser
const audio = new Audio(dlData.audioUrl);
audio.play();
3. Download langsung dari Spotify URL
fetch("/api/spotify?url=https%3A%2F%2Fopen.spotify.com%2Ftrack%2F1nyySeUvIxeIydsDL4G80X&apikey=YOUR_APIKEY")
.then(res => res.json())
.then(data => {
console.log(data.pickedSong.title, data.pickedSong.artist);
console.log("Audio URL:", data.audioUrl);
});
4. POST dengan body JSON
const res = await fetch("/api/spotify", {
method: "POST",
headers: { "Content-Type": "application/json", "x-api-key": "YOUR_APIKEY" },
body: JSON.stringify({ q: "Enchanted" })
});
const data = await res.json();
console.log(data.allSongs);
5. Stream preview 30-detik dari search (gratis)
const audio = document.querySelector("audio");
audio.src = data.allSongs[0].previewUrl; // Sudah /api/spotify/audio?t=...
audio.play();
6. Tampilkan thumbnail dari search (gratis)
const img = document.querySelector("img");
img.src = data.allSongs[0].thumbnail; // Sudah /api/spotify/thumb?url=...
7. Node.js (axios) — search + download + simpan file
const axios = require("axios");
const fs = require("fs");
async function searchAndDownload(query, apiKey, outputFile) {
// Step 1: Search
const searchRes = await axios.get("https://api.chioriya.my.id/api/spotify", {
params: { q: query, apikey: apiKey },
timeout: 30000
});
if (!searchRes.data.status) throw new Error("Search gagal");
const song = searchRes.data.allSongs[0];
console.log("Found:", song.title, "-", song.artist);
// Step 2: Download via URL
const dlRes = await axios.get("https://api.chioriya.my.id/api/spotify", {
params: { url: song.url, apikey: apiKey },
timeout: 180000
});
if (!dlRes.data.audioUrl) throw new Error("Audio gagal: " + dlRes.data.audioError);
// Step 3: Stream audio ke file (proxy gratis, gak butuh apikey)
const audioRes = await axios.get(dlRes.data.audioUrl, {
responseType: "stream",
timeout: 120000
});
audioRes.data.pipe(fs.createWriteStream(outputFile));
return dlRes.data.pickedSong;
}
searchAndDownload("Enchanted", "YOUR_APIKEY", "enchanted.mp3")
.then(song => console.log("Saved:", song.title, "-", song.artist))
.catch(console.error);
8. Baileys / Keila — search + download
case "spotify": {
if (!text) return m.keila("Contoh: .spotify Enchanted");
await m.react("๐ต");
const axios = require("axios");
// Step 1: Search
const searchRes = await axios.get("https://api.chioriya.my.id/api/spotify", {
params: { q: text, apikey: global.apikey || "YOUR_APIKEY" },
timeout: 30000
});
if (!searchRes.data.status) return m.keila("Search gagal.");
if (!searchRes.data.allSongs.length) return m.keila("Tidak ada hasil.");
// Step 2: Download lagu pertama
const song = searchRes.data.allSongs[0];
const dlRes = await axios.get("https://api.chioriya.my.id/api/spotify", {
params: { url: song.url, apikey: global.apikey || "YOUR_APIKEY" },
timeout: 180000
});
if (!dlRes.data.audioUrl) return m.keila("Audio gagal: " + dlRes.data.audioError);
// Step 3: Get audio buffer (proxy gratis)
const audioRes = await axios.get(dlRes.data.audioUrl, {
responseType: "arraybuffer",
timeout: 120000
});
const buffer = Buffer.from(audioRes.data);
let teks = `*Spotify Downloader*\n\n` +
`Title: ${dlRes.data.pickedSong.title}\n` +
`Artist: ${dlRes.data.pickedSong.artist}\n` +
`Duration: ${dlRes.data.pickedSong.duration || "-"}s`;
await m.keila(teks);
await keila.sendMessage(m.chat, {
audio: buffer,
mimetype: "audio/mpeg",
fileName: (dlRes.data.pickedSong.title || "audio") + ".mp3"
}, { quoted: m });
}
break;
Catatan Penting
- Endpoint utama wajib memakai API key panel. Cost 5 limit per request berhasil. Refund otomatis kalau gagal.
- Proxy endpoints (
/api/spotify/thumbdan/api/spotify/audio) gak butuh apikey dan gak ngurangin limit. Buka/download URL dari response JSON sepuasnya. - Mode search memakai
spotifySearch.jsdengan Spotify partner API + TOTP auth. Gak butuh env vars, gak pakai DDG/Bing. Return 5 lagu denganpreviewUrl30-detik. - Mode download memakai
spotmate.jsuntuk konversi audio MP3 via spotmate.online. Bisa lama sampai 3 menit kalau harus polling task async. - Search → Download flow: panggil
?q=...untuk search, pilih lagu dariallSongs, lalu panggil?url=song_urluntuk download full MP3. Total cost: 10 limit (5 search + 5 download). - Di mode search,
pickedSong= null danaudioUrl= null. Hanya adaallSongsdenganpreviewUrl. - Di mode download,
pickedSongberisi lagu terpilih +audioUrlberisi full MP3 URL.allSongskosong untuk single track. - Thumbnail URL di-rewrite ke
/api/spotify/thumb?url=<image_id>(cuma ID, bukan full URL). - Audio & preview URL di-rewrite ke
/api/spotify/audio?t=<base64url_token>(stateless, selalu works di serverless). - Spotify URL mendukung track, album, dan playlist. Untuk album/playlist, response akan berisi list semua track di
allSongs. - Jangan salah gunakan untuk distribusi ilegal. Pakai hanya untuk preview pribadi atau metadata.