Browse docs and collections
Overview
songs / #1276
Component variants
Related
Request
curl example
curl -sS \ "https://example-data.com/api/v1/songs/1276" \ -H "Accept: application/json"
JavaScript example
const res = await fetch( "https://example-data.com/api/v1/songs/1276" ); const song = await res.json();
TypeScript example
// Download once: mkdir -p types && curl -o types/songs.d.ts https://example-data.com/types/songs.d.ts
import type { Song } from "./types/songs";
const res = await fetch(
"https://example-data.com/api/v1/songs/1276"
);
const song = (await res.json()) as Song; Python example
import requests
res = requests.get(
"https://example-data.com/api/v1/songs/1276"
)
song = res.json() Response
{
"id": 1276,
"albumId": 120,
"artistId": 45,
"title": "Caldonia Boogie (What Makes Your Big Head So Hard)",
"slug": "caldonia-boogie-what-makes-your-big-head-so-hard-1276",
"trackNumber": 6,
"durationSeconds": 237,
"isExplicit": false,
"playCount": 39373070,
"createdAt": "2023-08-01T16:17:41.958Z"
}