example-data.com
Menu
Browse docs and collections

songs

songs

Page 96 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": 2281,
      "albumId": 215,
      "artistId": 76,
      "title": "The Power of Love",
      "slug": "the-power-of-love-2281",
      "trackNumber": 2,
      "durationSeconds": 327,
      "isExplicit": false,
      "playCount": 6597194,
      "createdAt": "2024-02-28T03:32:05.163Z"
    },
    {
      "id": 2282,
      "albumId": 215,
      "artistId": 76,
      "title": "Give Me Everything",
      "slug": "give-me-everything-2282",
      "trackNumber": 3,
      "durationSeconds": 280,
      "isExplicit": false,
      "playCount": 45306802,
      "createdAt": "2023-03-04T16:52:42.302Z"
    },
    {
      "id": 2283,
      "albumId": 215,
      "artistId": 76,
      "title": "Hound Dog",
      "slug": "hound-dog-2283",
      "trackNumber": 4,
      "durationSeconds": 409,
      "isExplicit": true,
      "playCount": 34420297,
      "createdAt": "2021-10-30T20:50:33.021Z"
    }
  ],
  "meta": {
    "page": 96,
    "limit": 24,
    "total": 2978,
    "totalPages": 125
  },
  "links": {
    "self": "/api/v1/songs?page=96&limit=24",
    "first": "/api/v1/songs?page=1&limit=24",
    "last": "/api/v1/songs?page=125&limit=24",
    "next": "/api/v1/songs?page=97&limit=24",
    "prev": "/api/v1/songs?page=95&limit=24"
  }
}