example-data.com
Menu
Browse docs and collections

songs

songs

Page 21 of 125.

Overview

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/songs?limit=25"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/songs?limit=25"
);
const { data, meta } = 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, ListEnvelope } from "./types/songs";

const res = await fetch(
  "https://example-data.com/api/v1/songs?limit=25"
);
const { data, meta } = (await res.json()) as ListEnvelope<Song>;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/songs",
    params={"limit": 25},
)
data = res.json()

Response

{
  "data": [
    {
      "id": 481,
      "albumId": 45,
      "artistId": 19,
      "title": "Unchained Melody",
      "slug": "unchained-melody-481",
      "trackNumber": 5,
      "durationSeconds": 104,
      "isExplicit": false,
      "playCount": 48265040,
      "createdAt": "2022-01-03T15:28:42.598Z"
    },
    {
      "id": 482,
      "albumId": 45,
      "artistId": 19,
      "title": "Wanted",
      "slug": "wanted-482",
      "trackNumber": 6,
      "durationSeconds": 358,
      "isExplicit": false,
      "playCount": 37862566,
      "createdAt": "2022-05-18T14:38:10.445Z"
    },
    {
      "id": 483,
      "albumId": 45,
      "artistId": 19,
      "title": "You Don't Have to Be a Star (To Be in My Show)",
      "slug": "you-dont-have-to-be-a-star-to-be-in-my-show-483",
      "trackNumber": 7,
      "durationSeconds": 269,
      "isExplicit": true,
      "playCount": 27949668,
      "createdAt": "2022-06-18T05:39:49.279Z"
    }
  ],
  "meta": {
    "page": 21,
    "limit": 24,
    "total": 2978,
    "totalPages": 125
  },
  "links": {
    "self": "/api/v1/songs?page=21&limit=24",
    "first": "/api/v1/songs?page=1&limit=24",
    "last": "/api/v1/songs?page=125&limit=24",
    "next": "/api/v1/songs?page=22&limit=24",
    "prev": "/api/v1/songs?page=20&limit=24"
  }
}