Skip to content

Track

GET/v1/apple-music/track1 credit

Returns one song: title, album, artist, artwork, and when read from an album URL also its duration, track and disc number and preview.

01Query parameters

NameTypeDescription
idoptionalstringThe Apple Music song id, e.g. `1833328840` (US storefront). One of `id` or `url` is required; `url` wins when both are given.
urloptionalstringThe music.apple.com song URL, e.g. `https://music.apple.com/us/album/lover/1468058165?i=1468058172`. An album URL with `?i=<song id>` names one of its tracks; a `/song/` URL is accepted too. The storefront in the URL (`us`, `gb`, `tr`, …) is the one read.

02Request

curl "https://api.scrapesocial.ai/v1/apple-music/track?url=https%3A%2F%2Fmusic.apple.com%2Fus%2Falbum%2Flover%2F1468058165%3Fi%3D1468058169" \
  -H "x-api-key: $SCRAPESOCIAL_KEY"

03Responses

Real answers from the API. Lists are shortened to 2 items.

GET /v1/apple-music/track?url=https%3A%2F%2Fmusic.apple.com%2Fus%2Falbum%2Flover%2F1468058165%3Fi%3D1468058169

{
  "success": true,
  "credits_remaining": 4980,
  "credits_charged": 1,
  "id": "1468058169",
  "kind": "song",
  "title": "I Forgot That You Existed",
  "subtitle": null,
  "album": "Lover",
  "url": "https://music.apple.com/us/album/i-forgot-that-you-existed/1468058165?i=1468058169",
  "artwork": {
    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music125/v4/49/3d/ab/493dab54-f920-9043-6181-80993b8116c9/19UMGIM53909.rgb.jpg/1200x1200bb.jpg",
    "width": 3900,
    "height": 3900,
    "bgColor": "fbcedd",
    "textColor1": "31251f",
    "textColor2": "223040",
    "textColor3": "5a4745",
    "textColor4": "4d4f60"
  },
  "duration_ms": 170651,
  "track_number": 1,
  "disc_number": 1,
  "artist_name": "Taylor Swift",
  "explicit": false,
  "preview_url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview221/v4/9c/e2/97/9ce2976a-b1c8-aa80-3e94-f4562cbad53e/mzaf_13898706762824220632.plus.aac.ep.m4a",
  "track_count": null,
  "seo": {
    "title": null,
    "description": null,
    "canonical_url": "https://music.apple.com/us/album/i-forgot-that-you-existed/1468058165?i=1468058169"
  }
}

Common to every endpoint

Any route can answer these: a missing or wrong key, no credits left, the platform not answering, or a failure on our side. None of them costs credits.

GET /v1/cosmos/profile?handle=design

{
  "success": false,
  "message": "Invalid API key"
}

04Notes

By `id` or a `/song/` URL the song page is read, which has no duration, track or disc number or preview (they are null); by an album URL with `?i=` the album page's row is read, which has all of them. Items share one shape: `id`, `kind`, `title`, `subtitle`, `album`, `url`, `artwork` (1200×1200 URL, size, colours), `duration_ms`, `track_number`, `disc_number`, `artist_name`, `explicit`, `preview_url`, `track_count`; a value the page does not give is null. An unknown id, or a `?i=` that is not on that album, is a free 404; an album URL without `?i=`, or a URL of another kind, is a free 400.

05Errors & credits

Every error has success: false, a real HTTP status and costs no credits.

  • 400missing_parameter

    A required parameter is missing or invalid.

  • 403private_account

    The account is private or age-restricted.

  • 404not_found

    No such account.

  • 503upstream_error

    The platform did not answer; retry shortly.