Browse docs and collections
Overview
songs / #7
Component variants
Medium
Smoke On the Water
· 7 min
Small
Smoke On the Water Related
References
Request
curl example
curl -sS \ "https://example-data.com/api/v1/songs/7" \ -H "Accept: application/json"
JavaScript example
const res = await fetch( "https://example-data.com/api/v1/songs/7" ); 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/7"
);
const song = (await res.json()) as Song; Python example
import requests
res = requests.get(
"https://example-data.com/api/v1/songs/7"
)
song = res.json() Response
{
"id": 7,
"albumId": 1,
"artistId": 1,
"title": "Smoke On the Water",
"slug": "smoke-on-the-water-7",
"trackNumber": 7,
"durationSeconds": 401,
"isExplicit": false,
"playCount": 20674589,
"createdAt": "2021-11-30T14:31:55.417Z"
}