Docs menu

Apple Music album

Beta GET /v1/apple-music/album

GET /v1/apple-music/album

The album with its tracks, label, UPC, copyright and editorial notes.

  • Cost: 1 credit
  • Status: Beta. Built and tested against recorded responses; the shape may still gain fields.
  • Cache: Results are kept up to 30 days; send max_age_days to reuse them for free.
  • Timeout: A request still running after about 25 seconds answers 202 with a job to poll (Batch and jobs).

Parameters#

NameTypeRequiredDescription
urlURLone ofApple Music album URL. Accepted hosts: music.apple.com.
idstringone ofApple Music album id.

Send at least one of url, id. If you send several, the first listed is used and the rest are ignored.

Every request also accepts:

  • region: two-letter country code for results that vary by country. Changing it restarts the cursor chain.
  • trim: true for a smaller response without null fields and extra.
  • raw: true to also get the platform's original object as raw.
  • max_age_days: accept a cached result up to this many days old, for 0 credits (Caching).

Example request#

Set your key in the environment first (see Authentication).

curl
curl -G "https://api.socialscrape.io/v1/apple-music/album" \
  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \
  --data-urlencode "id=1468058165"
Python
import os
import requests

params = {
    "id": "1468058165",
}
res = requests.get(
    "https://api.socialscrape.io/v1/apple-music/album",
    headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},
    params=params,
)
body = res.json()

if body["ok"]:
    print(body["data"])
else:
    print(body["error"]["code"], body["error"]["message"])
TypeScript
const url = new URL("https://api.socialscrape.io/v1/apple-music/album");
url.search = new URLSearchParams({
  "id": "1468058165"
}).toString();
const res = await fetch(url, {
  headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },
});
const body = await res.json();

if (body.ok) {
  console.log(body.data);
} else {
  console.error(body.error.code, body.error.message);
}
n8n
{
  "nodes": [
    {
      "name": "SocialScrape Apple Music album",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        0,
        0
      ],
      "parameters": {
        "method": "GET",
        "url": "https://api.socialscrape.io/v1/apple-music/album",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "id",
              "value": "1468058165"
            }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-api-key",
              "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"
            }
          ]
        }
      }
    }
  ],
  "connections": {}
}

Example response#

This is a sample from a recorded response, lists and long text are shortened, dash characters in the text are replaced with hyphens. Status 200.

{
  "ok": true,
  "credits_charged": 1,
  "credits_remaining": 4999,
  "cached": false,
  "cached_at": null,
  "request_id": "req_56093305f3637feb6c7d7917",
  "data": {
    "object": "album",
    "platform": "apple_music",
    "id": "1468058165",
    "url": "https://music.apple.com/us/album/lover/1468058165",
    "title": "Lover",
    "artists": [
      "Taylor Swift"
    ],
    "released_at": "2019-08-23",
    "track_count": 18,
    "cover_url": "https://is1-ssl.mzstatic.com/image/thumb/Music125/v4/49/3d/ab/493dab54-f920-9043-6181-80993b8116c9/19UMGIM53909.rgb.jpg/1200x1200bb.jpg",
    "label": "Taylor Swift",
    "tracks": [
      {
        "object": "song",
        "platform": "apple_music",
        "id": "1468058169",
        "url": "https://music.apple.com/us/album/i-forgot-that-you-existed/1468058165?i=1468058169",
        "title": "I Forgot That You Existed",
        "artists": [
          "Taylor Swift"
        ],
        "album": "Lover",
        "duration_seconds": 170.651,
        "cover_url": "https://is1-ssl.mzstatic.com/image/thumb/Music125/v4/49/3d/ab/493dab54-f920-9043-6181-80993b8116c9/19UMGIM53909.rgb.jpg/1200x1200bb.jpg",
        "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",
        "released_at": "2019-08-23",
        "isrc": "USUG11901471",
        "explicit": false,
        "is_original": null,
        "stats": {
          "plays": null,
          "uses": null,
          "likes": null
        },
        "extra": {
          "album_artist": "Taylor Swift",
          "album_id": "1468058165",
          "audio_locale": "en-US",
          "audio_traits": [
            "atmos",
            "lossless",
            "lossy-stereo"
          ],
          "composer": "Taylor Swift, Louis Bell & Adam Feeney",
          "disc_number": 1,
          "genres": [
            "Pop",
            "Music"
          ],
          "has_lyrics": true,
          "has_time_synced_lyrics": true,
          "is_apple_digital_master": true,
          "track_number": 1
        }
      },
      {
        "object": "song",
        "platform": "apple_music",
        "id": "1468058171",
        "url": "https://music.apple.com/us/album/cruel-summer/1468058165?i=1468058171",
        "title": "Cruel Summer",
        "artists": [
          "Taylor Swift"
        ],
        "album": "Lover",
        "duration_seconds": 178.426,
        "cover_url": "https://is1-ssl.mzstatic.com/image/thumb/Music125/v4/49/3d/ab/493dab54-f920-9043-6181-80993b8116c9/19UMGIM53909.rgb.jpg/1200x1200bb.jpg",
        "preview_url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview221/v4/44/af/81/44af8168-9609-1b85-5048-ada08dceacf3/mzaf_5595361395314573470.plus.aac.ep.m4a",
        "released_at": "2019-08-23",
        "isrc": "USUG11901472",
        "explicit": false,
        "is_original": null,
        "stats": {
          "plays": null,
          "uses": null,
          "likes": null
        },
        "extra": {
          "album_artist": "Taylor Swift",
          "album_id": "1468058165",
          "audio_locale": "en-US",
          "audio_traits": [
            "atmos",
            "lossless",
            "lossy-stereo"
          ],
          "composer": "Taylor Swift, Jack Antonoff & Annie Clark",
          "disc_number": 1,
          "genres": [
            "Pop",
            "Music"
          ],
          "has_lyrics": true,
          "has_time_synced_lyrics": true,
          "is_apple_digital_master": true,
          "track_number": 2
        }
      },
      {
        "object": "song",
        "platform": "apple_music",
        "id": "1468058173",
        "url": "https://music.apple.com/us/album/lover/1468058165?i=1468058173",
        "title": "Lover",
        "artists": [
          "Taylor Swift"
        ],
        "album": "Lover",
        "duration_seconds": 221.3,
        "cover_url": "https://is1-ssl.mzstatic.com/image/thumb/Music125/v4/49/3d/ab/493dab54-f920-9043-6181-80993b8116c9/19UMGIM53909.rgb.jpg/1200x1200bb.jpg",
        "preview_url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview211/v4/e0/db/47/e0db47b0-7f70-0631-0414-cd4777d2fb3e/mzaf_6008069204816798831.plus.aac.ep.m4a",
        "released_at": "2019-08-16",
        "isrc": "USUG11901473",
        "explicit": false,
        "is_original": null,
        "stats": {
          "plays": null,
          "uses": null,
          "likes": null
        },
        "extra": {
          "album_artist": "Taylor Swift",
          "album_id": "1468058165",
          "audio_locale": "en-US",
          "audio_traits": [
            "atmos",
            "lossless",
            "lossy-stereo"
          ],
          "composer": "Taylor Swift",
          "disc_number": 1,
          "genres": [
            "Pop",
            "Music"
          ],
          "has_lyrics": true,
          "has_time_synced_lyrics": true,
          "is_apple_digital_master": true,
          "track_number": 3
        }
      }
    ],
    "extra": {
      "artist_ids": [
        "159260351"
      ],
      "artist_urls": [
        "https://music.apple.com/us/artist/taylor-swift/159260351"
      ],
      "audio_traits": [
        "atmos",
        "lossless",
        "lossy-stereo"
      ],
      "copyright": "℗ 2019 Taylor Swift",
      "editorial_notes": {
        "short": "A love letter to love itself.",
        "standard": "There’s a reason Taylor Swift sounds so confident and cool on Lover, her seventh album and the most free-spirited yet. She’s in love - pure, steady, starry-eyed, shout-it-from-the-rooftops love. Arriving 13 years after her eponymous debut alb..."
      },
      "genres": [
        "Pop",
        "Music"
      ],
      "is_compilation": false,
      "is_complete": true,
      "is_mastered_for_itunes": true,
      "is_prerelease": false,
      "is_single": false,
      "release_date": "2019-08-23",
      "upc": "00602508005275"
    }
  },
  "cursor": null,
  "has_more": null
}

Response#

A Album object in data.

See Data models for every field. The envelope around data is described in Responses.

Errors#

Failures are free: credits_charged is 0. Branch on error.code, never on the message.

CodeHTTPRetryMeaning
invalid_params400noA parameter is missing, unknown or has the wrong type.
unsupported_url400noThe URL is not one this endpoint accepts (wrong platform or form).
not_found404noThe platform says this profile, post or item does not exist.

Every request can also fail with the account and platform errors listed on the Errors page.

Example error:

{
  "ok": false,
  "error": {
    "code": "not_found",
    "message": "The platform says this profile, post or item does not exist.",
    "retryable": false
  },
  "credits_charged": 0,
  "request_id": "req_07360b47dce49e4117144bf5"
}