Browse docs and collections
Overview
songs / #1901
Component variants
Related
Request
curl example
curl -sS \ "https://example-data.com/api/v1/songs/1901" \ -H "Accept: application/json"
JavaScript example
const res = await fetch( "https://example-data.com/api/v1/songs/1901" ); 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/1901"
);
const song = (await res.json()) as Song; Python example
import requests
res = requests.get(
"https://example-data.com/api/v1/songs/1901"
)
song = res.json() Response
{
"id": 1901,
"albumId": 181,
"artistId": 65,
"title": "Brother, Can You Spare a Dime?",
"slug": "brother-can-you-spare-a-dime-1901",
"trackNumber": 2,
"durationSeconds": 350,
"isExplicit": false,
"playCount": 7017963,
"createdAt": "2021-12-16T03:01:35.850Z"
}