Browse docs and collections
Overview
songs / #2257
Component variants
Medium
Hanging by a Moment
· 7 min
Small
Hanging by a Moment Related
References
Request
curl example
curl -sS \ "https://example-data.com/api/v1/songs/2257" \ -H "Accept: application/json"
JavaScript example
const res = await fetch( "https://example-data.com/api/v1/songs/2257" ); 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/2257"
);
const song = (await res.json()) as Song; Python example
import requests
res = requests.get(
"https://example-data.com/api/v1/songs/2257"
)
song = res.json() Response
{
"id": 2257,
"albumId": 213,
"artistId": 74,
"title": "Hanging by a Moment",
"slug": "hanging-by-a-moment-2257",
"trackNumber": 1,
"durationSeconds": 434,
"isExplicit": false,
"playCount": 24267149,
"createdAt": "2024-02-26T05:18:47.214Z"
}