REST API · GET / POST
Shazam API
Identify a song from audio or video via URL or file upload.
GET
https://api.interapi.dev/api/v1/shazam
Price: 5 credits per successful response. 5xx is free, 4xx costs at most 1 credit. Pricing
What it does
INTERA Shazam service: pass a direct audio/video URL (GET) or upload a file (POST). The server extracts multiple ffmpeg clips (mono 16 kHz) and recognizes via Shazam. Response includes title, artist, album, coverart, and label.
- GET by URL or POST file
- MP3, MP4, M4A, OGG, WebM…
- Multi-segment retry
- Redis result cache
- Artist — Title in label field
How to use it
- GET — direct HTTPS audio/video URL in url. POST — upload a file (MP3, MP4, M4A… max 50 MB)
- GET /api/v1/shazam?url=… or POST /api/v1/shazam with file field
- Response: title, artist, album, coverart, label. Recognition takes 5–30 s.
Parameters
GET parameters
urlstring (query)required- Direct HTTPS link to audio or video. Works with music_url from TikTok/Instagram or any direct MP3/MP4.
POST, multipart/form-data
filefile (multipart/form-data)required- Audio or video file: MP3, MP4, M4A, OGG, WebM, WAV, MKV, MOV. Max 50 MB.
Request example
curl -G "https://api.interapi.dev/api/v1/shazam" \
-H "X-API-Key: YOUR_API_KEY" \
--data-urlencode "url=https://cdn.example.com/audio.mp4"import requests
resp = requests.get(
"https://api.interapi.dev/api/v1/shazam",
params={"url": "https://cdn.example.com/audio.mp4"},
headers={"X-API-Key": "YOUR_API_KEY"},
timeout=60,
)
resp.raise_for_status()
print(resp.json())const params = new URLSearchParams({ url: "https://cdn.example.com/audio.mp4" });
const resp = await fetch(`https://api.interapi.dev/api/v1/shazam?${params}`, {
headers: { "X-API-Key": "YOUR_API_KEY" },
});
if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
console.log(await resp.json());<?php
$query = http_build_query(["url" => "https://cdn.example.com/audio.mp4"]);
$ch = curl_init("https://api.interapi.dev/api/v1/shazam?" . $query);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-API-Key: YOUR_API_KEY"],
CURLOPT_TIMEOUT => 60,
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);
POST
curl -X POST "https://api.interapi.dev/api/v1/shazam" \
-H "X-API-Key: YOUR_API_KEY" \
-F "file=@clip.mp4"import requests
with open("clip.mp4", "rb") as f:
resp = requests.post(
"https://api.interapi.dev/api/v1/shazam",
headers={"X-API-Key": "YOUR_API_KEY"},
files={"file": f},
timeout=90,
)
print(resp.json())const form = new FormData();
form.append("file", fileInput.files[0]);
const resp = await fetch("https://api.interapi.dev/api/v1/shazam", {
method: "POST",
headers: { "X-API-Key": "YOUR_API_KEY" },
body: form,
});
console.log(await resp.json());<?php
$ch = curl_init("https://api.interapi.dev/api/v1/shazam");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ["X-API-Key: YOUR_API_KEY"],
CURLOPT_POSTFIELDS => ["file" => new CURLFile("clip.mp4")],
]);
print_r(json_decode(curl_exec($ch), true));
Response example
{
"status": "success",
"platform": "InterAPI",
"found": true,
"track": {
"title": "Shazam",
"artist": "MACAN",
"album": "Shazam - Single",
"coverart": "https://is1-ssl.mzstatic.com/…/400x400cc.jpg",
"shazam_url": "https://www.shazam.com/track/…",
"isrc": "RUA1D2401234",
"key": "683214321",
"label": "MACAN - Shazam"
},
"duration_ms": 4870
}duration_ms is server processing time. URLs in the example are shortened.
Test a request
Without a key — up to 30 requests per hour per IP. With your key, each request costs the API price in credits.
Paste a link and press Send. The response shows up here.