Fetch API と Django のクロスオリジンで気をつける事

個人的に開発する中で、localhost:8080 でホストしている javascript ファイルから localhost:8000 でホストしてる Django に対し HTTP リクエストをかけたところ、CORS (Cross Origin Resource Sharing) 関連のエラーが色々出ました。

色々調べながら解決しましたが、自分なりに分かりやすく整理したかったのでこの記事にまとめました。

Javascript からの HTTP リクエスト には fetch API を使っています。

  1. CORS (Cross Origin Resource Sharing) とは
  2. Step 1: GET
  3. Step 2: request に Cookie を含める
  4. Step 3: POST や DELETE

CORS (Cross Origin Resource Sharing) とは

下記こちらからの抜粋です。

アプリケーションが読み込まれたのと同じオリジンに対してのみリソースのリクエストを行うことができ、それ以外のオリジンからの場合は正しい CORS ヘッダーを含んでいることが必要です。

オリジン間リソース共有の仕様は、ウェブブラウザーから情報を読み取ることを許可されているオリジンをサーバーが記述することができる、新たな HTTP ヘッダーを追加することで作用します。

Step 1: GET

まずは一番単純な GET から。Cookie も送らない想定です。

何もクロスオリジン対応をしていないと恐らく「No 'Access-Control-Allow-Origin' header is present on the requested resource.」という様なエラーが発生します。

クロスオリジンの request に対してサーバー側から Access-Control-Allow-Origin ヘッダーを適切に返す必要があります。

Fetch API での対応

Fetch API は普通に fetch() で request URL を叩けば大丈夫です。

let fetchResponse = await fetch(
    'http://localhost:8000/api/something'
)

メインはサーバー側(Django)での対応です。

Django での対応

django-cors-headers を pip install し、settings.py を下記のように追記して http://localhost:8080 からのリクエストを許可します。

pip install django-cors-headers
# settings.py

INSTALLED_APPS = [
   ...
   'corsheaders',
]

MIDDLEWARE = [
  ...
  'corsheaders.middleware.CorsMiddleware',
]

CORS_ALLOWED_ORIGINS = ['http://localhost:8080']

これでクロスオリジンの request を送れる様になります。(localhost:8080 → localhost:8000)

次に、request に cookie を含める設定を行います。

クロスオリジンでの fetch API は「デフォルトでは cookies を送信しない」仕様になっています。

これを解決するには fetch API の credentials パラメータを 'include' に設定し、サーバー側は Access-Control-Allow-Credentials ヘッダーを true で返す必要があります。

Fetch API での対応

fetch API のオプションに credentials: 'include' を含めます。

let fetchResponse = await fetch(
    'http://localhost:8000/api/something',
    {credentials: 'include'} // 追記分
)

Django での対応

settings.py に「CORS_ALLOW_CREDENTIALS = True」を追記します。

# settings.py
CORS_ALLOW_CREDENTIALS = True

これで Fetch API で Cookie が送れる様になり、Django 側もそれを受けられる様になりました。

Django でログイン済みのはずが AnonymousUser となる件

ちなみにログインユーザーを対象にした処理を Django 側で行う場合、上記の設定をしていないと、例えブラウザの cookie と Django の django_session テーブルで sessionid が一致していても 500 Internal Server Error や 403 Forbidden が発生すると思います。

理由は、クライアント側からの sessionid を request.COOKIES として受け取れていないため、request.user が非ログインユーザーを意味する AnonymousUser となるためです。

Step 3: POST や DELETE

さらに、クロスオリジンで POST や DELETE など unsafe な request を送る場合、クライアント側の fetch() に X-CSRFToken ヘッダーを設定し、Django 側では settings.py の CSRF_TRUSTED_ORIGINS のリストに request を許可するオリジンを記述する必要がります。

Fetch API での対応

let fetchResponse = await fetch(
    'http://localhost:8000/api/something',
    {credentials: 'include'},
    // ここから追記分
    method: 'POST',
    headers: {
        'X-CSRFToken': csrftoken, // Cookie から取得
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
        'someKey1': someData1,
        'someKey2': someData2
    }
)

GET メソッドは fetch のデフォルト値でしたが、POST や他のメソッドを使用する場合は method を指定する必要があります。

また、headers に X-CSRFToken として cookie から取得した csrftoken をアサインし、Content-Type も指定する必要があります。

Django での対応

settings.py の CSRF_TRUSTED_ORIGINS のリストに request を許可するオリジンを記述します。

# settings.py
CSRF_TRUSTED_ORIGINS = ['http://localhost:8080']

【Django】Apple MusicKit JS で Apple Music サインインの問題発生

事象

まず、MusicKit JS でプレイヤーを設置し曲をフル再生しようとすると Apple Music へのサインインが必要となります。

その際の正常なフローとしては:

  1. 自動ポップアップでサインイン画面が表示される
  2. ユーザーID & パスワード、そして6 桁のワンタイムコードを入力してサインイン
    • Mac の Safari では指紋認証のみでサインイン可
  3. アプリケーション(オリジン毎)による Apple Music へのアクセス許可を求められる
  4. 「許可」ボタンのクリックするとポップアップ画面が閉じる
  5. アプリケーションで曲のフルバージョンが再生できるようになる

今回、上記 4 の「許可」ボタンをクリックしてもボタンがグレーアウトされるだけで何も変わらない事象が起きた。

ポップアップウィンドウは閉じず、曲も再生されない。

もう一度曲を再生しようとしても再度別のポップアップが開いてサインインを要求されるという状況でした。

ちなみにサインインされてない状態だとフルバージョンではなく 30 秒バージョンの再生になります。

問題 1:「許可」ボタンクリックから進まない

まず、上記ステップで「許可」ボタンをクリックしてもボタンがグレーアウトするだけでその先に進まなかった問題から。

原因:Referrer-Policy の設定漏れ

諸々調べた結果、原因としてボタンクリック時の HTTP request に Referer 情報が含まれていなかった事が挙げられます。

Django ではデフォルトの Referrer-Policy が same-origin となりますが、same-origin の挙動は「同一オリジンのリクエストではオリジン、パス、クエリー文字列を送信します。オリジン間リクエストでは Referer ヘッダーを送信しません。」となっています。

つまり Apple の認証システムへの request 時に Referer ヘッダーが送信されず、その後の処理が行われなかったと思われます。

Django での Referrer-Policy 変更方法

Django で Referrer-Policy を変更するには settings.py で SECURE_REFERRER_POLICY を設定する必要があります。

おそらく「SECURE_REFERRER_POLICY = "strict-origin-when-cross-origin"」で良いと思います。

残る問題

これで「許可」ボタンをクリックすると、ポップアップウィンドウの中でアプリが表示されました。

仕方なくその中で曲を再生してみようとするとまた別のポップアップウィンドウが開きサインインを求められるループに入りました。

一旦グレーアウトで止まる問題は解消されましたが、別の問題が発生しただけです。

問題 2:曲のフル再生ができない

「許可」ボタンクリック後ポップアップウィンドウが閉じない問題はさておき、曲が再生できないのはなぜなのかを調べました。

原因 1/2:musicUserToken が付与されない

デベロッパーツールで request/response の内容を確認した結果、「許可」ボタンをクリックした際の Apple 側からの response で musicUserToken を受け取っているにもかかわらず、それがこちら側の musicKitInstance に渡っていないことが判明。

正常時はブラウザの Local Storage に保存され、無事認証が完了した musicKitInstance をデベロッパーツールで覗くと下記のように musicUserToken が入っているはずですが、今回はこれが「undefined」となっていました。

ちなみにコード上で半ば無理やり下記のようにアサインすると曲の再生ができていました。(music は musicKitInstance)

music.musicUserToken = "AoSKv/b0ED6YZzVuAEIvki4eOgFgeQYrCPaU+KSFV7fFdEozGUawOuKXxrzGyISRlHPfJlOzkclA+Nk4I0SbLI/f0tiZ++a+QYOG3EP+d935PvL+udndhJjfG/xe+ctry69X/rTtqgdr2VRCbqMgt/xzocg7gg2w/QPuTcA7YSpevglys3/2AsC69ofZKl8fHKkp04dyLuhxVZOC2h4PGXc+6chmnSHIxo7tp/VTv+IWr8+fhQ=="

原因 2/2:ポップアップ起動直前の URL が「#」で終わっている

正直かなり特殊な例かもしれませんが、自分のアプリ上、曲のタブを表示するボタンに a タグを使用し href="#" としていました。

つまり、曲を再生する前にこれをクリックするとメインウィンドウの URL が「http://localhost:8000/#」という形になりますが、これが良くなかったようです。

サインイン用のポップアップが開いて「許可」ボタンをクリックした後、ポップアップウィンドウの URL が更新されますが、その際メインウィンドウの URL と musicUserToken が「#」で繋がったものが入ります。

「http://localhost:8000/#ユーザートークン」の形で「#」につづけて musicUserToken が入ってくるんですが、上記で先に「#」が一つ入るため「http://localhost:8000/##ユーザートークン」という風に「#」が重複していました。

これが原因なのではと思い「#」を一つ消してブラウザ更新すると musicKitInstance に musicUserToken がアサインされ、URL からトークンの部分が消えました。(http://localhost:8000/ になる)

解決:URLに「#」を含まない様変更

アプリのコードを変更して「#」が付かないようにしたところ、「許可」ボタンクリックで musicUserToken は付与されるようになりました。

残る問題

ただ、メインウィンドウに戻らずポップアップ上にそのままアプリが表示される状況です。

その状態で曲はフル再生できますが、ポップアップが閉じてくれないのは問題です。

正直これに関しては解決できませんでした。

Django のテンプレートをそのまま Django の外に置いて python の http.server の Web サーバーで表示したところ無事にサインインできました。

なぜ内容が同じなのに Django で render されたものだとポップアップの挙動がおかしくなるのかは謎です。

と言うわけで、結局 html/css/js の部分は Django を通さず、API 部分だけ Django で書くことにしました。

それによってクロスオリジンのエラーを解決する必要がありましたが今のところ大丈夫そうです。

その他メモ書き

  • musicUserToken はオリジン毎の割り当て。
    • 127.0.0.1:8000 で取得した musicUserToken は localhost:8000 には共有されない。
    • 同じ http://127.0.0.1:8000 であれば http.server を使った html/js でも Django の runserver を使った Django テンプレートでも同じ musicUserToken で動く。

Javascript から Django REST Framework への POST/DELETE で 415 Unsupported Media Type

問題

Django REST Framework を使って API を作成中、Javascript から POST または DELETE リクエストを送ろうとした結果「POST(リクエスト先 URL) 415 (Unsupported Media Type)」のエラー表示。

*DELETE の場合も同じエラーが出ます。

原因

リクエストヘッダーに Content-Type がなかったのが原因。

解決方法

元々↓だったヘッダー部分に…

fetch('http://example.com/exampleapi',
    {
        method: 'POST',
        headers:{
            "X-CSRFToken": getCookie('csrftoken')
        body: JSON.stringify({ 'username': 'example'})
    }
)

↓の様に Content-Type を追加したら解決しました。

fetch('http://example.com/exampleapi',
    {
        method: 'POST',
        headers:{
            "X-CSRFToken": getCookie('csrftoken'),
            'Content-Type': 'application/json'} // 追記分
        body: JSON.stringify({ 'username': 'example'})
    }
)

DELETE の場合も同じ方法で解決しました。

Javascript から Django REST Framework への POST/DELETE で 403 Forbidden

問題

Django REST Framework を使って API を作成中、Javascript から POST または DELETE リクエストを送ろうとした結果「POST(リクエスト先 URL) 403 (Forbidden)」のエラー表示。

*DELETE の場合も同じエラーが出ます。

原因

CRSF (Cross Site Request Forgery) に対するセキュリティが働いて、リクエストが拒否されている様子。

解決法

ブラウザのクッキーから CSRF Token を取って、POST リクエストのヘッダーに含めたら解決しました。

元々↓だったところに…

const fetchOptions = {
    method: 'POST'
}
fetch('http://example.com/exampleapi',fetchOptions)

クッキーから csfrtoken を抽出して headers に含めて POST リクエストをする様にしました。

function getCookie(name) {
    let cookieValue = null;
    if (document.cookie && document.cookie !== '') {
        const cookies = document.cookie.split(';');
        for (let i = 0; i < cookies.length; i++) {
                const cookie = cookies[i].trim();
                if (cookie.substring(0, name.length + 1) === (name + '=')) {
                cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                break;
            }
        }
    }
    return cookieValue;
}

const fetchOptions = {
    method: 'POST',
    headers:{"X-CSRFToken": getCookie('csrftoken')}
}
fetch('http://example.com/exampleapi',fetchOptions)

これで一応 POST リクエストが通る様になりました。(HTTP Status 200 が返ってきました。)

DELETE の場合も同じ方法で解決しました。

参考にした記事

【Django】カスタム User モデルの作成方法

Django プロジェクトを作る際、もしデフォルトの User モデルで機能が足りている場合でも、将来の保守性や変更の必要性が出た場合を考慮して、カスタムの User モデルを使用することが強く推奨されています。

また、この作業 Django プロジェクトを作成して最初の migrate 実行前に行う必要があります。

  1. ユーザー管理用アプリケーションの作成
  2. カスタム User モデルの作成
  3. カスタム User モデルの登録
  4. マイグレーション

参考資料

ユーザー管理用アプリケーションの作成

account という名前でアプリケーションを作ります。

% python manage.py startapp account
# settings.py

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'account.apps.AccountConfig', # 追記
]

カスタム User モデルの作成

# account/models.py

from django.contrib.auth.models import AbstractUser

class User(AbstractUser):
    pass

カスタム User モデルの登録

# settings.py

AUTH_USER_MODEL = 'account.User'

尚、この設定をした時の注意点として、django.contrib.auth.models の User を直接参照すると AUTH_USER_MODEL で設定した User モデルを参照できないそうです。

なので User モデルを参照する必要がある場合は django.contrib.auth.get_user_model() を使用する必要があります。

# account/admin.py

from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User # models.py のカスタム User をインポート

admin.site.register(User, UserAdmin)

マイグレーション

まず、新たに作成した「account」アプリケーションのマイグレーションを作成します。

% python manage.py makemigrations account
Migrations for 'account':
  account/migrations/0001_initial.py
    - Create model User

マイグレーションを実行します。

% python manage.py migrate
Operations to perform:
  Apply all migrations: account, admin, auth, contenttypes, sessions
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0001_initial... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying auth.0008_alter_user_username_max_length... OK
  Applying auth.0009_alter_user_last_name_max_length... OK
  Applying auth.0010_alter_group_name_max_length... OK
  Applying auth.0011_update_proxy_permissions... OK
  Applying auth.0012_alter_user_first_name_max_length... OK
  Applying account.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying admin.0002_logentry_remove_auto_add... OK
  Applying admin.0003_logentry_add_action_flag_choices... OK
  Applying sessions.0001_initial... OK

無事マイグレーション完了です。

【Mac】Django アプリ作成 & MySQL 初回 migrate まで

  1. Python 仮想環境の作成
  2. Django プロジェクト&アプリケーションの作成
  3. MySQL へ初回 migrate
  4. 管理ユーザーの作成

Python 仮想環境の作成

任意の場所に Python 仮想環境を作成、起動します。

% python3 -m venv justjam
% cd justjam
% source bin/activate

Django プロジェクト&アプリケーションの作成

仮想環境内で django をインストール、そしてプロジェクトとアプリケーションを作成します。

% pip install --upgrade pip
% pip install django
% django-admin startproject justjam_proj
% cd justjam_proj
% python manage.py startapp api
# settings.py

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'api.apps.ApiConfig', # 追記分
]

runserver を実行し、ブラウザで動作確認します。

% python manage.py runserver

MySQL へ初回 migrate

注)カスタムユーザーモデルを使用する場合は、以下のステップに進む前に設定を完了しておく必要があります。

settings.py の DATABASES を変更し MySQL 対応にします。

# settings.py
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'justjam',
    }
}

MySQL でデータベースを作成し、migrate を実行します。

% mysql
mysql> create database justjam;
mysql> exit
% pip install mysql
% python manage.py migrate

Django のテーブルが作成されていることを確認します。

% mysql
mysql> show tables
    -> ;
+----------------------------+
| Tables_in_justjam          |
+----------------------------+
| auth_group                 |
| auth_group_permissions     |
| auth_permission            |
| auth_user                  |
| auth_user_groups           |
| auth_user_user_permissions |
| django_admin_log           |
| django_content_type        |
| django_migrations          |
| django_session             |
+----------------------------+
10 rows in set (0.00 sec)

mysql> exit;

管理ユーザーの作成

% python manage.py createsuperuser
Username (leave blank to use 'username'): admin
Email address: admin@justjam.com
Password: 
Password (again): 
Superuser created successfully.

Apple MusicKit JS で簡単な音楽プレーヤーを作ってみる

Apple の MusicKit JS を使って、とりあえず簡単な音楽プレーヤーを作ってみます。

その前段階として Developer Token を作成してください。下記が参考になれば幸いです。

というわけで作ったのが下記の html ファイル。「Your Developer Token」となっている部分を自身で作成したものに置換すれば動くと思います。

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />

<title>MusicKit JS</title>
</head>
<body>
<center>
    <p><img id="artwork"/></p>
    <p id="media-item-title">Display Media Item Title here</p>
    <p id="album-title">Display Album Title here</p>
    <p id="artist-name">Display Artist Name here</p>
    <p id="playback-time">Display Playback Time here</p>
    <p><button id="play">Play</button><button id="pause">Pause</button></p>
    <p><button id="previous-item">Previous</button><button id="next-item">Next</button></p>
</center>

<script src="https://js-cdn.music.apple.com/musickit/v1/musickit.js"></script>
<script type="text/javascript">
    // MusicKit JS の Promise を作成
    const setupMusicKit = new Promise((resolve) => {
        document.addEventListener('musickitloaded', function () {
            // MusicKit を定義
            MusicKit.configure({
                developerToken: 'Your Developer Token',
                app: {
                    name: 'My MusicKit JS App',
                    build: '2022.11.14'
                }
            })
            // MusicKit のインスタンスで Promise を resolve
            resolve(MusicKit.getInstance())
        })
    });

    // MusicKit.configure() が完了するのを待って残りを実行
    setupMusicKit.then(async (music) => {

        // 再生中の曲の情報を表示する HTML 要素を取得
        let currentSongName = document.getElementById('media-item-title');
        let currentAlbumName = document.getElementById('album-title');
        let currentArtistName = document.getElementById('artist-name');
        let playbackTime = document.getElementById('playback-time');

        // playbackTimeDidChange をトリガーにして再生時間の表示を更新
        music.addEventListener('playbackTimeDidChange', () => {
            playbackTime.textContent = music.player.currentPlaybackTime
        });

        // mediaItemDidChange をトリガーにして再生中の曲名の表示を更新
        music.addEventListener('mediaItemDidChange', () => {
            currentSongName.textContent = music.player.nowPlayingItem.title
        });

        // Play ボタンと player.play() の紐付け
        let playButton = document.getElementById('play');
        playButton.addEventListener('click', async () => {
            await music.player.play();
            // 曲を再生しつつ、紐づく情報の表示を更新
            currentAlbumName.textContent = music.player.nowPlayingItem.albumName
            currentArtistName.textContent = music.player.nowPlayingItem.artistName
        });

        // Pause ボタンと player.pause() の紐付け
        let pauseButton = document.getElementById('pause');
        pauseButton.addEventListener('click', () => {
            music.player.pause();
        });

        // Previous ボタンと player.skipToPreviousItem() の紐付け
        let previousButton = document.getElementById('previous-item');
        previousButton.addEventListener('click', () => {
            music.player.skipToPreviousItem();
        });

        // Next ボタンと player.skipToNextItem() の紐付け
        let nextButton = document.getElementById('next-item');
        nextButton.addEventListener('click', () => {
            music.player.skipToNextItem();
        });

        // アルバムを再生 Queue に登録
        await music.setQueue({
            album: '1542182291' // アルバム ID を渡す
        })

        // アルバム情報取得のプロミス
        let albumInfoPromise = music.api.album(1542182291)
        albumInfoPromise.then((albumData) => {
            let artworkImg = document.getElementById('artwork')
            // アルバムアートの URL を取得
            let artworkURL = MusicKit.formatArtworkURL(albumData.attributes.artwork, 100, 100)
            // アルバムアートを表示
            artworkImg.setAttribute('src', artworkURL)
        })
    })
</script>
</body>
</html>

大事なのは下記の記述で MusicKit JS を読み込んでいるところと。。。

<script src="https://js-cdn.music.apple.com/musickit/v1/musickit.js"></script>

下記の様な感じで MusicKit インスタンスの Promise を作っているところ。

    // MusicKit JS の Promise を作成
    const setupMusicKit = new Promise((resolve) => {
        document.addEventListener('musickitloaded', function () {
            // MusicKit を定義
            MusicKit.configure({
                developerToken: 'Your Developer Token',
                app: {
                    name: 'My MusicKit JS App',
                    build: '2022.11.14'
                }
            })
            // MusicKit のインスタンスで Promise を resolve
            resolve(MusicKit.getInstance())
        })
    });

この辺りは色々やり方があるんだと思いますが、とりあえず「musickitloaded」のイベントを待って MusicKit.configure() を実行する必要があります。

あとは公式ドキュメントを見ながら色々遊べればと。。。

ちなみに Apple Music API という、アルバムや楽曲などの情報の取得を主とした API もありますが、MusicKit API の MusicKit.API クラスがその役割を担っています。

curl で Apple Music API に検索をかける

取り急ぎ curl でアーティストや楽曲の検索を試してみたいと思います。

前提として Apple Music API の Developer Token を持っている必要があります。

よければ下記も参考にしてください。

では順にいきます。

  1. アーティスト名で検索
  2. アルバム ID で検索
  3. 楽曲 ID で検索
  4. 曲名で検索
  5. おまけ - シングル版「今夜月の見える丘に」

1. アーティスト名で検索

まずは Apple 公式ドキュメントを参考にしつつアーティスト名「B'z」を検索します。URL は下記とします。

「https://api.music.apple.com/v1/catalog/jp/search?term=B'z&types=artists」

その上でリクエストヘッダーにデベロッパートークンを追加して、curl を実行します。

% curl -s -H 'Authorization: Bearer eyJhbGc_o_JFUzIoN_IsImtpZBI6Iks3XEs1XUI1oFE_LBJoeXB_o_JKVoQ_fQ.eyJpc3M_o_JaoXlENXc3MjZUI_w_aWFoIjoxNDM3MXc5MDM1LBJleHB_ojEooXMyoXgxMDA9.QgQS5gv75mSJMw5Hw5rIoUFUx1-IYyXIsau_Lkv6oMS-GKeLk_XuIWW6aRZ-Ex3-7KUAzMJIR5yHznvw5XIkkB' "https://api.music.apple.com/v1/catalog/jp/search?term=B'z&types=artists"

で、返ってきたのがこちら。

{
    "results": {
        "artists": {
            "href": "/v1/catalog/jp/search?limit=5&term=B%27z&types=artists",
            "next": "/v1/catalog/jp/search?offset=5&term=B%27z&types=artists",
            "data": [
                {
                    "id": "74931253",
                    "type": "artists",
                    "href": "/v1/catalog/jp/artists/74931253",
                    "attributes": {
                        "name": "B'z",
                        "genreNames": [
                            "ロック"
                        ],
                        "artwork": {
                            "width": 2400,
                            "height": 2400,
                            "url": "https://is5-ssl.mzstatic.com/image/thumb/Music122/v4/0c/88/58/0c885888-c769-81f8-8485-069cd9a362f1/pr_source.png/{w}x{h}bb.jpg",
                            "bgColor": "dcdfe6",
                            "textColor1": "000001",
                            "textColor2": "1b191e",
                            "textColor3": "2c2c2f",
                            "textColor4": "424046"
                        },
                        "url": "https://music.apple.com/jp/artist/bz/74931253"
                    },
                    "relationships": {
                        "albums": {
                            "href": "/v1/catalog/jp/artists/74931253/albums",
                            "next": "/v1/catalog/jp/artists/74931253/albums?offset=25",
                            "data": [
                                {
                                    "id": "283000073",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/283000073"
                                },
                                {
                                    "id": "292067907",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/292067907"
                                },
                                {
                                    "id": "666625900",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/666625900"
                                },
                                {
                                    "id": "75682683",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/75682683"
                                },
                                {
                                    "id": "1561574089",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1561574089"
                                },
                                {
                                    "id": "74937562",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/74937562"
                                },
                                {
                                    "id": "666634430",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/666634430"
                                },
                                {
                                    "id": "75681798",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/75681798"
                                },
                                {
                                    "id": "1605118558",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1605118558"
                                },
                                {
                                    "id": "75356318",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/75356318"
                                },
                                {
                                    "id": "1466937136",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1466937136"
                                },
                                {
                                    "id": "74933581",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/74933581"
                                },
                                {
                                    "id": "75682153",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/75682153"
                                },
                                {
                                    "id": "347013256",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/347013256"
                                },
                                {
                                    "id": "74935606",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/74935606"
                                },
                                {
                                    "id": "75354662",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/75354662"
                                },
                                {
                                    "id": "1325460835",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1325460835"
                                },
                                {
                                    "id": "454667912",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/454667912"
                                },
                                {
                                    "id": "297710855",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/297710855"
                                },
                                {
                                    "id": "1561701429",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1561701429"
                                },
                                {
                                    "id": "74944705",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/74944705"
                                },
                                {
                                    "id": "1567851939",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1567851939"
                                },
                                {
                                    "id": "75361124",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/75361124"
                                },
                                {
                                    "id": "1567852104",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1567852104"
                                },
                                {
                                    "id": "75357159",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/75357159"
                                }
                            ]
                        }
                    }
                },
                {
                    "id": "1236215587",
                    "type": "artists",
                    "href": "/v1/catalog/jp/artists/1236215587",
                    "attributes": {
                        "name": "BZ",
                        "genreNames": [
                            "ヒップホップ/ラップ"
                        ],
                        "artwork": {
                            "width": 3000,
                            "height": 3000,
                            "url": "https://is3-ssl.mzstatic.com/image/thumb/Music124/v4/ae/b6/fb/aeb6fb97-56ba-e8fd-083f-f8c21970a74f/artwork.jpg/{w}x{h}ac.jpg",
                            "bgColor": "0f1050",
                            "textColor1": "d6bcf7",
                            "textColor2": "9dafdf",
                            "textColor3": "ae99d5",
                            "textColor4": "818fc2"
                        },
                        "url": "https://music.apple.com/jp/artist/bz/1236215587"
                    },
                    "relationships": {
                        "albums": {
                            "href": "/v1/catalog/jp/artists/1236215587/albums",
                            "data": [
                                {
                                    "id": "1612269170",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1612269170"
                                },
                                {
                                    "id": "1552528987",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1552528987"
                                },
                                {
                                    "id": "1170604377",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1170604377"
                                },
                                {
                                    "id": "1344358078",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1344358078"
                                },
                                {
                                    "id": "1501353949",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1501353949"
                                },
                                {
                                    "id": "1551034513",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1551034513"
                                },
                                {
                                    "id": "1502686217",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1502686217"
                                },
                                {
                                    "id": "1502573665",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1502573665"
                                },
                                {
                                    "id": "1544732805",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1544732805"
                                },
                                {
                                    "id": "1536654657",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1536654657"
                                },
                                {
                                    "id": "1549103433",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1549103433"
                                },
                                {
                                    "id": "1375096721",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1375096721"
                                },
                                {
                                    "id": "1561406752",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1561406752"
                                },
                                {
                                    "id": "1597875079",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1597875079"
                                },
                                {
                                    "id": "1566648690",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1566648690"
                                },
                                {
                                    "id": "1503527043",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1503527043"
                                },
                                {
                                    "id": "1448546746",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1448546746"
                                },
                                {
                                    "id": "1644747159",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1644747159"
                                },
                                {
                                    "id": "1629986398",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1629986398"
                                },
                                {
                                    "id": "1619147046",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1619147046"
                                },
                                {
                                    "id": "1606159561",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1606159561"
                                },
                                {
                                    "id": "1582431314",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1582431314"
                                }
                            ]
                        }
                    }
                },
                {
                    "id": "1465740891",
                    "type": "artists",
                    "href": "/v1/catalog/jp/artists/1465740891",
                    "attributes": {
                        "name": "BZ",
                        "genreNames": [
                            "エレクトロニック"
                        ],
                        "artwork": {
                            "width": 500,
                            "height": 500,
                            "url": "https://is3-ssl.mzstatic.com/image/thumb/Features125/v4/9e/da/50/9eda50fb-495d-62dd-473e-7e5ad83209f7/pr_source.png/{w}x{h}bb.jpg",
                            "bgColor": "1a1615",
                            "textColor1": "f6c069",
                            "textColor2": "d8a971",
                            "textColor3": "ca9e58",
                            "textColor4": "b28c5e"
                        },
                        "url": "https://music.apple.com/jp/artist/bz/1465740891"
                    },
                    "relationships": {
                        "albums": {
                            "href": "/v1/catalog/jp/artists/1465740891/albums",
                            "data": [
                                {
                                    "id": "838262440",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/838262440"
                                },
                                {
                                    "id": "997882538",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/997882538"
                                },
                                {
                                    "id": "964660751",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/964660751"
                                },
                                {
                                    "id": "1212786159",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1212786159"
                                },
                                {
                                    "id": "1579770371",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1579770371"
                                }
                            ]
                        }
                    }
                },
                {
                    "id": "1585689464",
                    "type": "artists",
                    "href": "/v1/catalog/jp/artists/1585689464",
                    "attributes": {
                        "name": "BZ",
                        "genreNames": [
                            "エレクトロニック"
                        ],
                        "artwork": {
                            "width": 4000,
                            "height": 4000,
                            "url": "https://is5-ssl.mzstatic.com/image/thumb/Music122/v4/ac/09/ab/ac09ab8c-1707-c6aa-a45e-9074649456f0/5059722847474_cover.jpg/{w}x{h}ac.jpg",
                            "bgColor": "03242f",
                            "textColor1": "d0cecc",
                            "textColor2": "21b9d9",
                            "textColor3": "a7acac",
                            "textColor4": "1b9bb7"
                        },
                        "url": "https://music.apple.com/jp/artist/bz/1585689464"
                    },
                    "relationships": {
                        "albums": {
                            "href": "/v1/catalog/jp/artists/1585689464/albums",
                            "data": [
                                {
                                    "id": "776208953",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/776208953"
                                },
                                {
                                    "id": "1612158034",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1612158034"
                                },
                                {
                                    "id": "1571657950",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1571657950"
                                },
                                {
                                    "id": "1581841967",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1581841967"
                                },
                                {
                                    "id": "1577141561",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1577141561"
                                },
                                {
                                    "id": "1577141651",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1577141651"
                                },
                                {
                                    "id": "1583900522",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1583900522"
                                },
                                {
                                    "id": "1620727001",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1620727001"
                                },
                                {
                                    "id": "1584610904",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1584610904"
                                }
                            ]
                        }
                    }
                },
                {
                    "id": "303385174",
                    "type": "artists",
                    "href": "/v1/catalog/jp/artists/303385174",
                    "attributes": {
                        "name": "BZ",
                        "genreNames": [
                            "ヒップホップ/ラップ"
                        ],
                        "artwork": {
                            "width": 996,
                            "height": 996,
                            "url": "https://is1-ssl.mzstatic.com/image/thumb/Music112/v4/81/ef/b0/81efb079-e993-f42a-cfe1-6ece22673a2f/pr_source.png/{w}x{h}bb.jpg",
                            "bgColor": "1f1c2d",
                            "textColor1": "c7cea4",
                            "textColor2": "d0ba8c",
                            "textColor3": "a6ab8c",
                            "textColor4": "ad9a79"
                        },
                        "url": "https://music.apple.com/jp/artist/bz/303385174"
                    },
                    "relationships": {
                        "albums": {
                            "href": "/v1/catalog/jp/artists/303385174/albums",
                            "data": [
                                {
                                    "id": "1447921556",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1447921556"
                                },
                                {
                                    "id": "1637062769",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1637062769"
                                },
                                {
                                    "id": "1517197555",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1517197555"
                                },
                                {
                                    "id": "1614079632",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1614079632"
                                },
                                {
                                    "id": "1558826365",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1558826365"
                                },
                                {
                                    "id": "1609298956",
                                    "type": "albums* Connection #0 to host api.music.apple.com left intact",
                                    "href": "/v1/catalog/jp/albums/1609298956"
                                },
                                {
                                    "id": "1584989196",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1584989196"
                                },
                                {
                                    "id": "1522129749",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1522129749"
                                },
                                {
                                    "id": "1648328595",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1648328595"
                                },
                                {
                                    "id": "1635988163",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1635988163"
                                }
                            ]
                        }
                    }
                }
            ]
        }
    },
    "meta": {
        "results": {
            "order": [
                "artists"
            ],
            "rawOrder": [
                "artists"
            ]
        }
    }

2. アルバム ID で検索

次に、上記で取得した情報の中からアルバム ID 「283000073」をキーにしてアルバムの情報を取得します。

また Apple 公式ドキュメントを参考に、URL を「https://api.music.apple.com/v1/catalog/jp/albums/283000073」としました。

% curl -s -H 'Authorization: Bearer eyJhbGc_o_JFUzIoN_IsImtpZBI6Iks3XEs1XUI1oFE_LBJoeXB_o_JKVoQ_fQ.eyJpc3M_o_JaoXlENXc3MjZUI_w_aWFoIjoxNDM3MXc5MDM1LBJleHB_ojEooXMyoXgxMDA9.QgQS5gv75mSJMw5Hw5rIoUFUx1-IYyXIsau_Lkv6oMS-GKeLk_XuIWW6aRZ-Ex3-7KUAzMJIR5yHznvw5XIkkB' "https://api.music.apple.com/v1/catalog/jp/albums/283000073"

で、返ってきた内容が下記の通りです。

アルバムのジャンルや、楽曲の順番、複数ディスクの場合のディスク番号、個別の楽曲のリリース日なども含まれています。

{
    "data": [
        {
            "id": "283000073",
            "type": "albums",
            "href": "/v1/catalog/jp/albums/283000073",
            "attributes": {
                "copyright": "℗ VERMILLION RECORDS",
                "genreNames": [
                    "ロック",
                    "ミュージック",
                    "J-Pop",
                    "ワールド ",
                    "J ポップ",
                    "アフリカ",
                    "アフロビート",
                    "サウンドトラック",
                    "サウンドトラック",
                    "ポップ",
                    "ポップ / ロック"
                ],
                "releaseDate": "2008-06-18",
                "upc": "4582283790893",
                "isMasteredForItunes": false,
                "artwork": {
                    "width": 2400,
                    "height": 2400,
                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                    "bgColor": "b31319",
                    "textColor1": "fff9f9",
                    "textColor2": "e3cccd",
                    "textColor3": "efcbcc",
                    "textColor4": "daa7a9"
                },
                "playParams": {
                    "id": "283000073",
                    "kind": "album"
                },
                "url": "https://music.apple.com/jp/album/bz-the-best-ultra-pleasure/283000073",
                "recordLabel": "VERMILLION RECORDS",
                "trackCount": 30,
                "isCompilation": false,
                "isSingle": false,
                "name": "B'z The Best “ULTRA Pleasure”",
                "artistName": "B'z",
                "isComplete": true
            },
            "relationships": {
                "tracks": {
                    "href": "/v1/catalog/jp/albums/283000073/tracks",
                    "data": [
                        {
                            "id": "283000107",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000107",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "ポップ",
                                    "ポップ / ロック",
                                    "アフリカ",
                                    "アフロビート"
                                ],
                                "trackNumber": 1,
                                "releaseDate": "2008-06-18",
                                "durationInMillis": 379215,
                                "isrc": "JPBM00805001",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/bad-communication-ultra-pleasure-style/283000073?i=283000107",
                                "playParams": {
                                    "id": "283000107",
                                    "kind": "song"
                                },
                                "discNumber": 1,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "BAD COMMUNICATION -ULTRA Pleasure Style-",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview114/v4/a1/c3/1e/a1c31e2e-4bc3-7d0d-24d0-6dfc5a032798/mzaf_7411853953750226698.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000112",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000112",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "アフリカ",
                                    "アフロビート",
                                    "ポップ",
                                    "ポップ / ロック"
                                ],
                                "trackNumber": 2,
                                "releaseDate": "1990-01-01",
                                "durationInMillis": 251681,
                                "isrc": "JPBM00805002",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/be-there/283000073?i=283000112",
                                "playParams": {
                                    "id": "283000112",
                                    "kind": "song"
                                },
                                "discNumber": 1,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "BE THERE",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview114/v4/27/b8/a3/27b8a37f-a947-b98d-e922-9452fcdbe50b/mzaf_892619016481388971.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000116",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000116",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "ポップ",
                                    "ポップ / ロック",
                                    "アフリカ",
                                    "アフロビート"
                                ],
                                "trackNumber": 3,
                                "releaseDate": "1990-10-03",
                                "durationInMillis": 278554,
                                "isrc": "JPBM00805003",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/easy-come-easy-go/283000073?i=283000116",
                                "playParams": {
                                    "id": "283000116",
                                    "kind": "song"
                                },
                                "discNumber": 1,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "Easy Come, Easy Go!",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview114/v4/4b/a5/b9/4ba5b9d0-63b2-5f4e-d263-533f54e707bc/mzaf_4267871420543208362.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000121",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000121",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "ポップ",
                                    "ポップ / ロック",
                                    "アフリカ",
                                    "アフロビート"
                                ],
                                "trackNumber": 4,
                                "releaseDate": "1991-03-27",
                                "durationInMillis": 259141,
                                "isrc": "JPBM00805004",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/lady-navigation/283000073?i=283000121",
                                "playParams": {
                                    "id": "283000121",
                                    "kind": "song"
                                },
                                "discNumber": 1,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "LADY NAVIGATION",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview114/v4/9b/27/c6/9b27c621-e033-0b5e-91d8-4c9340339b1e/mzaf_4051041125887373432.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000128",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000128",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "ポップ",
                                    "ポップ / ロック",
                                    "アフリカ",
                                    "アフロビート"
                                ],
                                "trackNumber": 5,
                                "releaseDate": "2008-06-18",
                                "durationInMillis": 358351,
                                "isrc": "JPBM00805005",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/alone/283000073?i=283000128",
                                "playParams": {
                                    "id": "283000128",
                                    "kind": "song"
                                },
                                "discNumber": 1,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "ALONE",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview114/v4/aa/88/df/aa88dfa7-1845-a79f-65c3-9ef1fb894def/mzaf_6171150850819265853.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000134",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000134",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "ポップ",
                                    "ポップ / ロック",
                                    "アフリカ",
                                    "アフロビート"
                                ],
                                "trackNumber": 6,
                                "releaseDate": "1992-10-07",
                                "durationInMillis": 288302,
                                "isrc": "JPBM00805006",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/zero/283000073?i=283000134",
                                "playParams": {
                                    "id": "283000134",
                                    "kind": "song"
                                },
                                "discNumber": 1,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "ZERO",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/55/e4/40/55e4405c-fe9a-a1b2-ef8d-d0d91a42682a/mzaf_3557724539005683879.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000140",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000140",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "アフリカ",
                                    "アフロビート",
                                    "ポップ",
                                    "ポップ / ロック"
                                ],
                                "trackNumber": 7,
                                "releaseDate": "1992-12-09",
                                "durationInMillis": 334144,
                                "isrc": "JPBM00805007",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/%E3%81%84%E3%81%A4%E3%81%8B%E3%81%AE%E3%83%A1%E3%83%AA%E3%83%BC%E3%82%AF%E3%83%AA%E3%82%B9%E3%83%9E%E3%82%B9/283000073?i=283000140",
                                "playParams": {
                                    "id": "283000140",
                                    "kind": "song"
                                },
                                "discNumber": 1,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "いつかのメリークリスマス",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/4d/0a/39/4d0a39c5-09f1-6cd0-00ec-eec7baccf6f9/mzaf_2328992746598592071.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000145",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000145",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "ポップ",
                                    "ポップ / ロック",
                                    "アフリカ",
                                    "アフロビート"
                                ],
                                "trackNumber": 8,
                                "releaseDate": "1993-03-17",
                                "durationInMillis": 235232,
                                "isrc": "JPBM00805008",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/%E6%84%9B%E3%81%AE%E3%81%BE%E3%81%BE%E3%81%AB%E3%82%8F%E3%81%8C%E3%81%BE%E3%81%BE%E3%81%AB-%E5%83%95%E3%81%AF%E5%90%9B%E3%81%A0%E3%81%91%E3%82%92%E5%82%B7%E3%81%A4%E3%81%91%E3%81%AA%E3%81%84/283000073?i=283000145",
                                "playParams": {
                                    "id": "283000145",
                                    "kind": "song"
                                },
                                "discNumber": 1,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "愛のままにわがままに 僕は君だけを傷つけない",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview114/v4/b8/56/f0/b856f08b-b402-93f9-c7ee-75297a9634de/mzaf_5822043827315744146.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000149",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000149",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "ポップ",
                                    "ポップ / ロック",
                                    "アフリカ",
                                    "アフロビート"
                                ],
                                "trackNumber": 9,
                                "releaseDate": "1993-06-02",
                                "durationInMillis": 264719,
                                "isrc": "JPBM00805009",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/%E8%A3%B8%E8%B6%B3%E3%81%AE%E5%A5%B3%E7%A5%9E/283000073?i=283000149",
                                "playParams": {
                                    "id": "283000149",
                                    "kind": "song"
                                },
                                "discNumber": 1,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "裸足の女神",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview114/v4/4c/a8/2c/4ca82cee-afed-c448-d182-37bb28605760/mzaf_11873762874783215889.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000151",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000151",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "ポップ",
                                    "ポップ / ロック",
                                    "アフリカ",
                                    "アフロビート"
                                ],
                                "trackNumber": 10,
                                "releaseDate": "1995-05-31",
                                "durationInMillis": 207398,
                                "isrc": "JPBM00805010",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/%E3%81%AD%E3%81%8C%E3%81%84/283000073?i=283000151",
                                "playParams": {
                                    "id": "283000151",
                                    "kind": "song"
                                },
                                "discNumber": 1,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "ねがい",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/ca/ce/d2/caced2db-dac8-8eaf-ab87-e763436d41bb/mzaf_10394475427852778389.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000154",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000154",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "ポップ",
                                    "ポップ / ロック",
                                    "アフリカ",
                                    "アフロビート"
                                ],
                                "trackNumber": 11,
                                "releaseDate": "1995-07-07",
                                "durationInMillis": 197197,
                                "isrc": "JPBM00805011",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/love-me-i-love-you/283000073?i=283000154",
                                "playParams": {
                                    "id": "283000154",
                                    "kind": "song"
                                },
                                "discNumber": 1,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "love me, I love you",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview114/v4/89/7d/0d/897d0dab-921d-c64c-9c7f-30c940176b3b/mzaf_11880311714578689083.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000158",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000158",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "アフリカ",
                                    "アフロビート",
                                    "ポップ",
                                    "ポップ / ロック"
                                ],
                                "trackNumber": 12,
                                "releaseDate": "1995-10-11",
                                "durationInMillis": 277847,
                                "isrc": "JPBM00805012",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/love-phantom/283000073?i=283000158",
                                "playParams": {
                                    "id": "283000158",
                                    "kind": "song"
                                },
                                "discNumber": 1,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "LOVE PHANTOM",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/48/7d/19/487d192f-ae8f-18af-4126-80671fa0cd8a/mzaf_5936532717698931733.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000163",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000163",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "アフリカ",
                                    "アフロビート",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "ポップ",
                                    "ポップ / ロック"
                                ],
                                "trackNumber": 13,
                                "releaseDate": "1996-03-09",
                                "durationInMillis": 278164,
                                "isrc": "JPBM00805013",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/%E3%83%9F%E3%82%A8%E3%83%8A%E3%82%A4%E3%83%81%E3%82%AB%E3%83%A9-invisible-one/283000073?i=283000163",
                                "playParams": {
                                    "id": "283000163",
                                    "kind": "song"
                                },
                                "discNumber": 1,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "ミエナイチカラ 〜INVISIBLE ONE〜",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/81/ff/c8/81ffc839-bdb3-3e13-9b85-b0cfa30748de/mzaf_15974577907308628444.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000167",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000167",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "ポップ",
                                    "ポップ / ロック",
                                    "アフリカ",
                                    "アフロビート"
                                ],
                                "trackNumber": 14,
                                "releaseDate": "1997-11-19",
                                "durationInMillis": 353170,
                                "isrc": "JPBM00805014",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/calling/283000073?i=283000167",
                                "playParams": {
                                    "id": "283000167",
                                    "kind": "song"
                                },
                                "discNumber": 1,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "Calling",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/5b/e0/8a/5be08a92-29cf-f1a9-62b1-e20b9050275a/mzaf_2059155166800627492.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000172",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000172",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "アフリカ",
                                    "アフロビート",
                                    "ポップ",
                                    "ポップ / ロック"
                                ],
                                "trackNumber": 15,
                                "releaseDate": "1998-04-08",
                                "durationInMillis": 244384,
                                "isrc": "JPBM00805015",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/%E3%81%95%E3%81%BE%E3%82%88%E3%81%88%E3%82%8B%E8%92%BC%E3%81%84%E5%BC%BE%E4%B8%B8/283000073?i=283000172",
                                "playParams": {
                                    "id": "283000172",
                                    "kind": "song"
                                },
                                "discNumber": 1,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "さまよえる蒼い弾丸",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/3e/ee/ed/3eeeedd1-eb3b-22aa-4303-397656c1c5f2/mzaf_15894679202637424560.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000176",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000176",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "ポップ",
                                    "ポップ / ロック",
                                    "アフリカ",
                                    "アフロビート"
                                ],
                                "trackNumber": 1,
                                "releaseDate": "1998-07-08",
                                "durationInMillis": 259144,
                                "isrc": "JPBM00805016",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/home/283000073?i=283000176",
                                "playParams": {
                                    "id": "283000176",
                                    "kind": "song"
                                },
                                "discNumber": 2,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "HOME",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/2f/b6/41/2fb64116-313f-e663-4781-9028df029b1b/mzaf_12931330346110155513.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000180",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000180",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "アフリカ",
                                    "アフロビート",
                                    "ポップ",
                                    "ポップ / ロック"
                                ],
                                "trackNumber": 2,
                                "releaseDate": "1999-06-09",
                                "durationInMillis": 237157,
                                "isrc": "JPBM00805017",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/%E3%82%AE%E3%83%AA%E3%82%AE%E3%83%AAchop/283000073?i=283000180",
                                "playParams": {
                                    "id": "283000180",
                                    "kind": "song"
                                },
                                "discNumber": 2,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "ギリギリchop",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/92/40/2e/92402e93-00c6-9f9f-3922-2c432198d447/mzaf_16215780478281309936.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000183",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000183",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "ポップ",
                                    "ポップ / ロック",
                                    "アフリカ",
                                    "アフロビート"
                                ],
                                "trackNumber": 3,
                                "releaseDate": "2000-02-09",
                                "durationInMillis": 248823,
                                "isrc": "JPBM00805018",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/%E4%BB%8A%E5%A4%9C%E6%9C%88%E3%81%AE%E8%A6%8B%E3%81%88%E3%82%8B%E4%B8%98%E3%81%AB/283000073?i=283000183",
                                "playParams": {
                                    "id": "283000183",
                                    "kind": "song"
                                },
                                "discNumber": 2,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "今夜月の見える丘に",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/b9/be/53/b9be5367-8571-7b15-0e2a-b58e660c0bd5/mzaf_10765349844474317131.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000187",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000187",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "ポップ",
                                    "ポップ / ロック",
                                    "アフリカ",
                                    "アフロビート"
                                ],
                                "trackNumber": 4,
                                "releaseDate": "2000-07-12",
                                "durationInMillis": 238002,
                                "isrc": "JPBM00805019",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/juice/283000073?i=283000187",
                                "playParams": {
                                    "id": "283000187",
                                    "kind": "song"
                                },
                                "discNumber": 2,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "juice",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview114/v4/aa/91/0b/aa910b35-a28f-c605-28b5-4ffffa4c6229/mzaf_17384298869559685117.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000191",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000191",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "アフリカ",
                                    "アフロビート",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "ポップ",
                                    "ポップ / ロック"
                                ],
                                "trackNumber": 5,
                                "releaseDate": "2001-03-14",
                                "durationInMillis": 221335,
                                "isrc": "JPBM00805020",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/ultra-soul/283000073?i=283000191",
                                "playParams": {
                                    "id": "283000191",
                                    "kind": "song"
                                },
                                "discNumber": 2,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "ultra soul",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/8b/21/dc/8b21dcb3-f557-9832-2a34-3cc8e1db8868/mzaf_14521386775521914886.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000194",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000194",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "アフリカ",
                                    "アフロビート",
                                    "ポップ",
                                    "ポップ / ロック"
                                ],
                                "trackNumber": 6,
                                "releaseDate": "2002-06-05",
                                "durationInMillis": 245533,
                                "isrc": "JPBM00805021",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/%E7%86%B1%E3%81%8D%E9%BC%93%E5%8B%95%E3%81%AE%E6%9E%9C%E3%81%A6/283000073?i=283000194",
                                "playParams": {
                                    "id": "283000194",
                                    "kind": "song"
                                },
                                "discNumber": 2,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "熱き鼓動の果て",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview114/v4/11/43/d0/1143d0fe-1e8e-5fc6-d93f-6f7133850b95/mzaf_16723506345757005642.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000197",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000197",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "ポップ",
                                    "ポップ / ロック",
                                    "アフリカ",
                                    "アフロビート"
                                ],
                                "trackNumber": 7,
                                "releaseDate": "2003-03-26",
                                "durationInMillis": 237883,
                                "isrc": "JPBM00805022",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/its-showtime/283000073?i=283000197",
                                "playParams": {
                                    "id": "283000197",
                                    "kind": "song"
                                },
                                "discNumber": 2,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "IT'S SHOWTIME!!",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/48/9d/10/489d1068-0539-32b0-3a58-84feb1c6c966/mzaf_2514394422699192888.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000199",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000199",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "ポップ",
                                    "ポップ / ロック",
                                    "アフリカ",
                                    "アフロビート"
                                ],
                                "trackNumber": 8,
                                "releaseDate": "2004-05-05",
                                "durationInMillis": 227215,
                                "isrc": "JPBM00805023",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/banzai/283000073?i=283000199",
                                "playParams": {
                                    "id": "283000199",
                                    "kind": "song"
                                },
                                "discNumber": 2,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "BANZAI",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/5b/f0/5a/5bf05af4-5795-908a-9327-a84b9bf0344d/mzaf_4118405068698009331.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000203",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000203",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "アフリカ",
                                    "アフロビート",
                                    "ポップ",
                                    "ポップ / ロック"
                                ],
                                "trackNumber": 9,
                                "releaseDate": "2005-03-09",
                                "durationInMillis": 261980,
                                "isrc": "JPBM00805024",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/%E6%84%9B%E3%81%AE%E3%83%90%E3%82%AF%E3%83%80%E3%83%B3/283000073?i=283000203",
                                "playParams": {
                                    "id": "283000203",
                                    "kind": "song"
                                },
                                "discNumber": 2,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "愛のバクダン",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview114/v4/38/56/42/38564277-e3c7-8892-4a38-363e02982c1c/mzaf_7931602334840061919.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000206",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000206",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "ポップ",
                                    "ポップ / ロック",
                                    "アフリカ",
                                    "アフロビート"
                                ],
                                "trackNumber": 10,
                                "releaseDate": "2005-08-10",
                                "durationInMillis": 325198,
                                "isrc": "JPBM00805025",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/ocean/283000073?i=283000206",
                                "playParams": {
                                    "id": "283000206",
                                    "kind": "song"
                                },
                                "discNumber": 2,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "OCEAN",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/13/79/e4/1379e4b2-135a-82d9-89d4-62c76ba9d7a5/mzaf_4622046857049795843.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000209",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000209",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "アフリカ",
                                    "アフロビート",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "ポップ",
                                    "ポップ / ロック"
                                ],
                                "trackNumber": 11,
                                "releaseDate": "2006-01-25",
                                "durationInMillis": 193303,
                                "isrc": "JPBM00805026",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/%E8%A1%9D%E5%8B%95/283000073?i=283000209",
                                "playParams": {
                                    "id": "283000209",
                                    "kind": "song"
                                },
                                "discNumber": 2,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "衝動",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/f1/eb/19/f1eb1939-26de-6146-c12d-57e6ae0b96f2/mzaf_6872363229656617418.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000211",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000211",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "アフリカ",
                                    "アフロビート",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "ポップ",
                                    "ポップ / ロック"
                                ],
                                "trackNumber": 12,
                                "releaseDate": "2006-06-07",
                                "durationInMillis": 211403,
                                "isrc": "JPBM00805027",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/splash/283000073?i=283000211",
                                "playParams": {
                                    "id": "283000211",
                                    "kind": "song"
                                },
                                "discNumber": 2,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "SPLASH!",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview114/v4/dd/8a/f9/dd8af95a-d7f8-9267-42f0-5a4ec7035be0/mzaf_1072998915713595128.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000215",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000215",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "ポップ",
                                    "ポップ / ロック",
                                    "アフリカ",
                                    "アフロビート"
                                ],
                                "trackNumber": 13,
                                "releaseDate": "2007-05-09",
                                "durationInMillis": 306787,
                                "isrc": "JPBM00805028",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/%E6%B0%B8%E9%81%A0%E3%81%AE%E7%BF%BC/283000073?i=283000215",
                                "playParams": {
                                    "id": "283000215",
                                    "kind": "song"
                                },
                                "discNumber": 2,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "永遠の翼",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/fa/de/4c/fade4cd6-4a5c-7b28-257a-d8da822461ed/mzaf_559845820496670159.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000218",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000218",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "アフリカ",
                                    "アフロビート",
                                    "サウンドトラック",
                                    "サウンドトラック",
                                    "ポップ",
                                    "ポップ / ロック"
                                ],
                                "trackNumber": 14,
                                "releaseDate": "2007-10-03",
                                "durationInMillis": 238469,
                                "isrc": "JPBM00805029",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/super-love-song/283000073?i=283000218",
                                "playParams": {
                                    "id": "283000218",
                                    "kind": "song"
                                },
                                "discNumber": 2,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "SUPER LOVE SONG",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/bc/f1/bc/bcf1bc26-1be6-c7bc-e0a3-2a7f971bb02c/mzaf_8776164769843508828.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "283000222",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/283000222",
                            "attributes": {
                                "albumName": "B'z The Best “ULTRA Pleasure”",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop",
                                    "ワールド ",
                                    "J ポップ",
                                    "ポップ",
                                    "ポップ / ロック",
                                    "アフリカ",
                                    "アフロビート",
                                    "サウンドトラック",
                                    "サウンドトラック"
                                ],
                                "trackNumber": 15,
                                "releaseDate": "1991-03-27",
                                "durationInMillis": 285756,
                                "isrc": "JPBM00805030",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "b31319",
                                    "textColor1": "fff9f9",
                                    "textColor2": "e3cccd",
                                    "textColor3": "efcbcc",
                                    "textColor4": "daa7a9"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/pleasure-2008-%E4%BA%BA%E7%94%9F%E3%81%AE%E5%BF%AB%E6%A5%BD/283000073?i=283000222",
                                "playParams": {
                                    "id": "283000222",
                                    "kind": "song"
                                },
                                "discNumber": 2,
                                "hasLyrics": true,
                                "isAppleDigitalMaster": false,
                                "name": "Pleasure 2008 ~人生の快楽~",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/75/7e/8e/757e8ea7-2cd2-9230-6216-f05a4b646721/mzaf_3980145666140894443.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        }
                    ]
                },
                "artists": {
                    "href": "/v1/catalog/jp/albums/283000073/artists",
                    "data": [
                        {
                            "id": "74931253",
                            "type": "artists",
                            "href": "/v1/catalog/jp/artists/74931253"
                        }
                    ]
                }
            }
        }
    ]
}

3. 楽曲 ID で検索する

アルバム内に含まれていた楽曲 ID「283000183」を使って楽曲の情報を取得します。

今度はこちらを参考にして URL を「https://api.music.apple.com/v1/catalog/jp/songs/283000183」としました。

% curl -s -H 'Authorization: Bearer eyJhbGc_o_JFUzIoN_IsImtpZBI6Iks3XEs1XUI1oFE_LBJoeXB_o_JKVoQ_fQ.eyJpc3M_o_JaoXlENXc3MjZUI_w_aWFoIjoxNDM3MXc5MDM1LBJleHB_ojEooXMyoXgxMDA9.QgQS5gv75mSJMw5Hw5rIoUFUx1-IYyXIsau_Lkv6oMS-GKeLk_XuIWW6aRZ-Ex3-7KUAzMJIR5yHznvw5XIkkB' "https://api.music.apple.com/v1/catalog/jp/songs/283000183"

で、返ってきたのがこちら。

あくまで先ほど取得したアルバム「B'z The Best “ULTRA Pleasure」の中の一曲として返ってきている様です。

{
    "data": [
        {
            "id": "283000183",
            "type": "songs",
            "href": "/v1/catalog/jp/songs/283000183",
            "attributes": {
                "albumName": "B'z The Best “ULTRA Pleasure”",
                "genreNames": [
                    "ロック",
                    "ミュージック",
                    "J-Pop",
                    "ワールド ",
                    "J ポップ",
                    "サウンドトラック",
                    "サウンドトラック",
                    "ポップ",
                    "ポップ / ロック",
                    "アフリカ",
                    "アフロビート"
                ],
                "trackNumber": 3,
                "durationInMillis": 248823,
                "releaseDate": "2000-02-09",
                "isrc": "JPBM00805018",
                "artwork": {
                    "width": 2400,
                    "height": 2400,
                    "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                    "bgColor": "b31319",
                    "textColor1": "fff9f9",
                    "textColor2": "e3cccd",
                    "textColor3": "efcbcc",
                    "textColor4": "daa7a9"
                },
                "composerName": "松本孝弘",
                "url": "https://music.apple.com/jp/album/%E4%BB%8A%E5%A4%9C%E6%9C%88%E3%81%AE%E8%A6%8B%E3%81%88%E3%82%8B%E4%B8%98%E3%81%AB/283000073?i=283000183",
                "playParams": {
                    "id": "283000183",
                    "kind": "song"
                },
                "discNumber": 2,
                "hasLyrics": true,
                "isAppleDigitalMaster": false,
                "name": "今夜月の見える丘に",
                "previews": [
                    {
                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/b9/be/53/b9be5367-8571-7b15-0e2a-b58e660c0bd5/mzaf_10765349844474317131.plus.aac.p.m4a"
                    }
                ],
                "artistName": "B'z"
            },
            "relationships": {
                "albums": {
                    "href": "/v1/catalog/jp/songs/283000183/albums",
                    "data": [
                        {
                            "id": "283000073",
                            "type": "albums",
                            "href": "/v1/catalog/jp/albums/283000073"
                        }
                    ]
                },
                "artists": {
                    "href": "/v1/catalog/jp/songs/283000183/artists",
                    "data": [
                        {
                            "id": "74931253",
                            "type": "artists",
                            "href": "/v1/catalog/jp/artists/74931253"
                        }
                    ]
                }
            }
        }
    ]
}

4. 曲名で検索

シングル版の「今夜月の見える丘に」もあるはずなので、とりあえず曲名で検索してみます。

% curl -s -H 'Authorization: Bearer eyJhbGc_o_JFUzIoN_IsImtpZBI6Iks3XEs1XUI1oFE_LBJoeXB_o_JKVoQ_fQ.eyJpc3M_o_JaoXlENXc3MjZUI_w_aWFoIjoxNDM3MXc5MDM1LBJleHB_ojEooXMyoXgxMDA9.QgQS5gv75mSJMw5Hw5rIoUFUx1-IYyXIsau_Lkv6oMS-GKeLk_XuIWW6aRZ-Ex3-7KUAzMJIR5yHznvw5XIkkB' "https://api.music.apple.com/v1/catalog/jp/search?term=今夜月の見える丘に"

たくさん返ってきました。ピアノインスト版も含まれています。

下記データをよくみると、results の下の階層で songs、albums、artists と分かれています。

{
    "results": {
        "songs": {
            "href": "/v1/catalog/jp/search?limit=5&term=%E4%BB%8A%E5%A4%9C%E6%9C%88%E3%81%AE%E8%A6%8B%E3%81%88%E3%82%8B%E4%B8%98%E3%81%AB&types=songs",
            "next": "/v1/catalog/jp/search?offset=5&term=%E4%BB%8A%E5%A4%9C%E6%9C%88%E3%81%AE%E8%A6%8B%E3%81%88%E3%82%8B%E4%B8%98%E3%81%AB&types=songs",
            "data": [
                {
                    "id": "283000183",
                    "type": "songs",
                    "href": "/v1/catalog/jp/songs/283000183",
                    "attributes": {
                        "albumName": "B'z The Best “ULTRA Pleasure”",
                        "genreNames": [
                            "ロック",
                            "ミュージック",
                            "J-Pop",
                            "ワールド ",
                            "J ポップ",
                            "サウンドトラック",
                            "サウンドトラック",
                            "ポップ",
                            "ポップ / ロック",
                            "アフリカ",
                            "アフロビート"
                        ],
                        "trackNumber": 3,
                        "releaseDate": "2000-02-09",
                        "durationInMillis": 248823,
                        "isrc": "JPBM00805018",
                        "artwork": {
                            "width": 2400,
                            "height": 2400,
                            "url": "https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/c8/33/0f/c8330fd7-b55f-adf3-5eac-70785a8eee75/BMCV_8022.jpg/{w}x{h}bb.jpg",
                            "bgColor": "b31319",
                            "textColor1": "fff9f9",
                            "textColor2": "e3cccd",
                            "textColor3": "efcbcc",
                            "textColor4": "daa7a9"
                        },
                        "composerName": "松本孝弘",
                        "url": "https://music.apple.com/jp/album/%E4%BB%8A%E5%A4%9C%E6%9C%88%E3%81%AE%E8%A6%8B%E3%81%88%E3%82%8B%E4%B8%98%E3%81%AB/283000073?i=283000183",
                        "playParams": {
                            "id": "283000183",
                            "kind": "song"
                        },
                        "discNumber": 2,
                        "isAppleDigitalMaster": false,
                        "hasLyrics": true,
                        "name": "今夜月の見える丘に",
                        "previews": [
                            {
                                "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/b9/be/53/b9be5367-8571-7b15-0e2a-b58e660c0bd5/mzaf_10765349844474317131.plus.aac.p.m4a"
                            }
                        ],
                        "artistName": "B'z"
                    }
                },
                {
                    "id": "1560094045",
                    "type": "songs",
                    "href": "/v1/catalog/jp/songs/1560094045",
                    "attributes": {
                        "albumName": "今夜月の見える丘に - Single",
                        "genreNames": [
                            "ロック",
                            "ミュージック",
                            "J-Pop"
                        ],
                        "trackNumber": 1,
                        "releaseDate": "2000-02-09",
                        "durationInMillis": 248667,
                        "isrc": "JPBM09901114",
                        "artwork": {
                            "width": 2400,
                            "height": 2400,
                            "url": "https://is3-ssl.mzstatic.com/image/thumb/Music124/v4/1a/9f/ab/1a9fab6f-0db2-315c-4bfe-75a40e716e25/dj.zbywctsr.jpg/{w}x{h}bb.jpg",
                            "bgColor": "000000",
                            "textColor1": "fffffd",
                            "textColor2": "e5e5e5",
                            "textColor3": "cbcbca",
                            "textColor4": "b7b7b7"
                        },
                        "composerName": "松本孝弘",
                        "url": "https://music.apple.com/jp/album/%E4%BB%8A%E5%A4%9C%E6%9C%88%E3%81%AE%E8%A6%8B%E3%81%88%E3%82%8B%E4%B8%98%E3%81%AB/1560094041?i=1560094045",
                        "playParams": {
                            "id": "1560094045",
                            "kind": "song"
                        },
                        "discNumber": 1,
                        "isAppleDigitalMaster": false,
                        "hasLyrics": true,
                        "name": "今夜月の見える丘に",
                        "previews": [
                            {
                                "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/68/f5/16/68f516f1-01dd-6bfc-6e8e-c6e3cc746294/mzaf_737226102774676319.plus.aac.p.m4a"
                            }
                        ],
                        "artistName": "B'z"
                    }
                },
                {
                    "id": "666634433",
                    "type": "songs",
                    "href": "/v1/catalog/jp/songs/666634433",
                    "attributes": {
                        "albumName": "B'z The Best XXV 1999-2012",
                        "genreNames": [
                            "ロック",
                            "ミュージック"
                        ],
                        "trackNumber": 2,
                        "durationInMillis": 248600,
                        "releaseDate": "2000-02-09",
                        "isrc": "JPBM09901114",
                        "artwork": {
                            "width": 2400,
                            "height": 2400,
                            "url": "https://is1-ssl.mzstatic.com/image/thumb/Music114/v4/7f/40/d5/7f40d515-4618-1d1c-877e-a3089981b327/BMCV_8042.jpg/{w}x{h}bb.jpg",
                            "bgColor": "000000",
                            "textColor1": "fffffd",
                            "textColor2": "d4fb01",
                            "textColor3": "cbcbca",
                            "textColor4": "a9c900"
                        },
                        "composerName": "松本孝弘",
                        "url": "https://music.apple.com/jp/album/%E4%BB%8A%E5%A4%9C%E6%9C%88%E3%81%AE%E8%A6%8B%E3%81%88%E3%82%8B%E4%B8%98%E3%81%AB/666634430?i=666634433",
                        "playParams": {
                            "id": "666634433",
                            "kind": "song"
                        },
                        "discNumber": 1,
                        "isAppleDigitalMaster": false,
                        "hasLyrics": true,
                        "name": "今夜月の見える丘に",
                        "previews": [
                            {
                                "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/ab/55/35/ab5535ca-e21a-c757-9620-be3cbaa0a0fa/mzaf_3411343503929317375.plus.aac.p.m4a"
                            }
                        ],
                        "artistName": "B'z"
                    }
                },
                {
                    "id": "75363013",
                    "type": "songs",
                    "href": "/v1/catalog/jp/songs/75363013",
                    "attributes": {
                        "albumName": "ELEVEN",
                        "genreNames": [
                            "ロック",
                            "ミュージック",
                            "J-Pop"
                        ],
                        "trackNumber": 14,
                        "releaseDate": "2000-02-09",
                        "durationInMillis": 249629,
                        "isrc": "JPBM00001120",
                        "artwork": {
                            "width": 2400,
                            "height": 2400,
                            "url": "https://is2-ssl.mzstatic.com/image/thumb/Music124/v4/26/37/88/263788a4-fae1-dbfd-fcf8-8d58eba2e6a9/BMCR-7046.jpg/{w}x{h}bb.jpg",
                            "bgColor": "000000",
                            "textColor1": "fdfeff",
                            "textColor2": "fafdea",
                            "textColor3": "cacbcb",
                            "textColor4": "c8cabb"
                        },
                        "composerName": "松本孝弘",
                        "url": "https://music.apple.com/jp/album/%E4%BB%8A%E5%A4%9C%E6%9C%88%E3%81%AE%E8%A6%8B%E3%81%88%E3%82%8B%E4%B8%98%E3%81%AB-alternative-guitar-solo-ver/75363205?i=75363013",
                        "playParams": {
                            "id": "75363013",
                            "kind": "song"
                        },
                        "discNumber": 1,
                        "isAppleDigitalMaster": false,
                        "hasLyrics": true,
                        "name": "今夜月の見える丘に (Alternative Guitar Solo ver.)",
                        "previews": [
                            {
                                "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview114/v4/97/b4/9f/97b49f3e-a6ba-2dff-078a-349e84a85163/mzaf_10665736781832925052.plus.aac.p.m4a"
                            }
                        ],
                        "artistName": "B'z"
                    }
                },
                {
                    "id": "393492969",
                    "type": "songs",
                    "href": "/v1/catalog/jp/songs/393492969",
                    "attributes": {
                        "albumName": "12のラブ・ストーリー ピアノ・インテリア",
                        "genreNames": [
                            "インストゥルメンタル",
                            "ミュージック",
                            "J-Pop"
                        ],
                        "trackNumber": 9,
                        "durationInMillis": 290333,
                        "releaseDate": "2001-01-24",
                        "isrc": "JPKI00046130",
                        "artwork": {
                            "width": 941,
                            "height": 941,
                            "url": "https://is1-ssl.mzstatic.com/image/thumb/Music/c8/f2/d0/mzi.ldzduogi.jpg/{w}x{h}bb.jpg",
                            "bgColor": "ffffff",
                            "textColor1": "090909",
                            "textColor2": "212121",
                            "textColor3": "3a3a3a",
                            "textColor4": "4d4d4d"
                        },
                        "url": "https://music.apple.com/jp/album/%E4%BB%8A%E5%A4%9C%E6%9C%88%E3%81%AE%E8%A6%8B%E3%81%88%E3%82%8B%E4%B8%98%E3%81%AB/393492914?i=393492969",
                        "playParams": {
                            "id": "393492969",
                            "kind": "song"
                        },
                        "discNumber": 1,
                        "hasLyrics": false,
                        "isAppleDigitalMaster": false,
                        "name": "今夜月の見える丘に",
                        "previews": [
                            {
                                "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview125/v4/2c/1d/04/2c1d0460-7f64-46bf-c501-416266565965/mzaf_14225783347699209617.plus.aac.p.m4a"
                            }
                        ],
                        "artistName": "平野孝幸"
                    }
                }
            ]
        },
        "albums": {
            "href": "/v1/catalog/jp/search?limit=5&term=%E4%BB%8A%E5%A4%9C%E6%9C%88%E3%81%AE%E8%A6%8B%E3%81%88%E3%82%8B%E4%B8%98%E3%81%AB&types=albums",
            "data": [
                {
                    "id": "1560094041",
                    "type": "albums",
                    "href": "/v1/catalog/jp/albums/1560094041",
                    "attributes": {
                        "copyright": "℗ VERMILLION RECORDS",
                        "genreNames": [
                            "ロック",
                            "ミュージック",
                            "J-Pop"
                        ],
                        "releaseDate": "2000-02-09",
                        "isMasteredForItunes": false,
                        "upc": "4938068101185",
                        "artwork": {
                            "width": 2400,
                            "height": 2400,
                            "url": "https://is3-ssl.mzstatic.com/image/thumb/Music124/v4/1a/9f/ab/1a9fab6f-0db2-315c-4bfe-75a40e716e25/dj.zbywctsr.jpg/{w}x{h}bb.jpg",
                            "bgColor": "000000",
                            "textColor1": "fffffd",
                            "textColor2": "e5e5e5",
                            "textColor3": "cbcbca",
                            "textColor4": "b7b7b7"
                        },
                        "url": "https://music.apple.com/jp/album/%E4%BB%8A%E5%A4%9C%E6%9C%88%E3%81%AE%E8%A6%8B%E3%81%88%E3%82%8B%E4%B8%98%E3%81%AB-single/1560094041",
                        "playParams": {
                            "id": "1560094041",
                            "kind": "album"
                        },
                        "recordLabel": "VERMILLION RECORDS",
                        "trackCount": 2,
                        "isCompilation": false,
                        "isSingle": false,
                        "name": "今夜月の見える丘に - Single",
                        "artistName": "B'z",
                        "isComplete": true
                    }
                }
            ]
        },
        "artists": {
            "href": "/v1/catalog/jp/search?limit=5&term=%E4%BB%8A%E5%A4%9C%E6%9C%88%E3%81%AE%E8%A6%8B%E3%81%88%E3%82%8B%E4%B8%98%E3%81%AB&types=artists",
            "data": [
                {
                    "id": "74931253",
                    "type": "artists",
                    "href": "/v1/catalog/jp/artists/74931253",
                    "attributes": {
                        "name": "B'z",
                        "genreNames": [
                            "ロック"
                        ],
                        "artwork": {
                            "width": 2400,
                            "height": 2400,
                            "url": "https://is5-ssl.mzstatic.com/image/thumb/Music122/v4/0c/88/58/0c885888-c769-81f8-8485-069cd9a362f1/pr_source.png/{w}x{h}bb.jpg",
                            "bgColor": "dcdfe6",
                            "textColor1": "000001",
                            "textColor2": "1b191e",
                            "textColor3": "2c2c2f",
                            "textColor4": "424046"
                        },
                        "url": "https://music.apple.com/jp/artist/bz/74931253"
                    },
                    "relationships": {
                        "albums": {
                            "href": "/v1/catalog/jp/artists/74931253/albums",
                            "next": "/v1/catalog/jp/artists/74931253/albums?offset=25",
                            "data": [
                                {
                                    "id": "283000073",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/283000073"
                                },
                                {
                                    "id": "292067907",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/292067907"
                                },
                                {
                                    "id": "666625900",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/666625900"
                                },
                                {
                                    "id": "75682683",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/75682683"
                                },
                                {
                                    "id": "1561574089",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1561574089"
                                },
                                {
                                    "id": "74937562",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/74937562"
                                },
                                {
                                    "id": "666634430",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/666634430"
                                },
                                {
                                    "id": "75681798",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/75681798"
                                },
                                {
                                    "id": "1605118558",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1605118558"
                                },
                                {
                                    "id": "75356318",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/75356318"
                                },
                                {
                                    "id": "1466937136",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1466937136"
                                },
                                {
                                    "id": "74933581",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/74933581"
                                },
                                {
                                    "id": "75682153",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/75682153"
                                },
                                {
                                    "id": "347013256",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/347013256"
                                },
                                {
                                    "id": "74935606",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/74935606"
                                },
                                {
                                    "id": "75354662",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/75354662"
                                },
                                {
                                    "id": "1325460835",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1325460835"
                                },
                                {
                                    "id": "454667912",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/454667912"
                                },
                                {
                                    "id": "297710855",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/297710855"
                                },
                                {
                                    "id": "1561701429",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1561701429"
                                },
                                {
                                    "id": "74944705",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/74944705"
                                },
                                {
                                    "id": "1567851939",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1567851939"
                                },
                                {
                                    "id": "75361124",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/75361124"
                                },
                                {
                                    "id": "1567852104",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1567852104"
                                },
                                {
                                    "id": "75357159",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/75357159"
                                }
                            ]
                        }
                    }
                }
            ]
        }
    },
    "meta": {
        "results": {
            "order": [
                "songs",
                "albums",
                "artists"
            ],
            "rawOrder": [
                "songs",
                "albums",
                "artists"
            ]
        }
    }
}

曲名が「今夜月の見える丘に - Single」となっているものがあるのでとりあえずこれがシングル版ですね。

おまけ - シングル版「今夜月の見える丘に」

検索の方法はわかったんですがシングル版の方が気になったので検索をかけてみます。

上の JSON データで、songs データにはアルバム「今夜月の見える丘に - Single」に入っている楽曲「今夜月の見える丘に」の情報と、albums データにはアルバム「今夜月の見える丘に - Single」の情報が入っていました。

まずは「今夜月の見える丘に - Single」のアルバム ID「1560094041」で検索します。

% curl -s -H 'Authorization: Bearer eyJhbGc_o_JFUzIoN_IsImtpZBI6Iks3XEs1XUI1oFE_LBJoeXB_o_JKVoQ_fQ.eyJpc3M_o_JaoXlENXc3MjZUI_w_aWFoIjoxNDM3MXc5MDM1LBJleHB_ojEooXMyoXgxMDA9.QgQS5gv75mSJMw5Hw5rIoUFUx1-IYyXIsau_Lkv6oMS-GKeLk_XuIWW6aRZ-Ex3-7KUAzMJIR5yHznvw5XIkkB' "https://api.music.apple.com/v1/catalog/jp/albums/1560094041"

カップリング楽曲も含めて返ってきます。

{
    "data": [
        {
            "id": "1560094041",
            "type": "albums",
            "href": "/v1/catalog/jp/albums/1560094041",
            "attributes": {
                "copyright": "℗ VERMILLION RECORDS",
                "genreNames": [
                    "ロック",
                    "ミュージック",
                    "J-Pop"
                ],
                "releaseDate": "2000-02-09",
                "isMasteredForItunes": false,
                "upc": "4938068101185",
                "artwork": {
                    "width": 2400,
                    "height": 2400,
                    "url": "https://is3-ssl.mzstatic.com/image/thumb/Music124/v4/1a/9f/ab/1a9fab6f-0db2-315c-4bfe-75a40e716e25/dj.zbywctsr.jpg/{w}x{h}bb.jpg",
                    "bgColor": "000000",
                    "textColor1": "fffffd",
                    "textColor2": "e5e5e5",
                    "textColor3": "cbcbca",
                    "textColor4": "b7b7b7"
                },
                "playParams": {
                    "id": "1560094041",
                    "kind": "album"
                },
                "url": "https://music.apple.com/jp/album/%E4%BB%8A%E5%A4%9C%E6%9C%88%E3%81%AE%E8%A6%8B%E3%81%88%E3%82%8B%E4%B8%98%E3%81%AB-single/1560094041",
                "recordLabel": "VERMILLION RECORDS",
                "isCompilation": false,
                "trackCount": 2,
                "isSingle": false,
                "name": "今夜月の見える丘に - Single",
                "artistName": "B'z",
                "isComplete": true
            },
            "relationships": {
                "artists": {
                    "href": "/v1/catalog/jp/albums/1560094041/artists",
                    "data": [
                        {
                            "id": "74931253",
                            "type": "artists",
                            "href": "/v1/catalog/jp/artists/74931253"
                        }
                    ]
                },
                "tracks": {
                    "href": "/v1/catalog/jp/albums/1560094041/tracks",
                    "data": [
                        {
                            "id": "1560094045",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/1560094045",
                            "attributes": {
                                "albumName": "今夜月の見える丘に - Single",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop"
                                ],
                                "trackNumber": 1,
                                "releaseDate": "2000-02-09",
                                "durationInMillis": 248667,
                                "isrc": "JPBM09901114",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is3-ssl.mzstatic.com/image/thumb/Music124/v4/1a/9f/ab/1a9fab6f-0db2-315c-4bfe-75a40e716e25/dj.zbywctsr.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "000000",
                                    "textColor1": "fffffd",
                                    "textColor2": "e5e5e5",
                                    "textColor3": "cbcbca",
                                    "textColor4": "b7b7b7"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/%E4%BB%8A%E5%A4%9C%E6%9C%88%E3%81%AE%E8%A6%8B%E3%81%88%E3%82%8B%E4%B8%98%E3%81%AB/1560094041?i=1560094045",
                                "playParams": {
                                    "id": "1560094045",
                                    "kind": "song"
                                },
                                "discNumber": 1,
                                "isAppleDigitalMaster": false,
                                "hasLyrics": true,
                                "name": "今夜月の見える丘に",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/68/f5/16/68f516f1-01dd-6bfc-6e8e-c6e3cc746294/mzaf_737226102774676319.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        },
                        {
                            "id": "1560094048",
                            "type": "songs",
                            "href": "/v1/catalog/jp/songs/1560094048",
                            "attributes": {
                                "albumName": "今夜月の見える丘に - Single",
                                "genreNames": [
                                    "ロック",
                                    "ミュージック",
                                    "J-Pop"
                                ],
                                "trackNumber": 2,
                                "releaseDate": "2000-02-09",
                                "durationInMillis": 247767,
                                "isrc": "JPBM09901117",
                                "artwork": {
                                    "width": 2400,
                                    "height": 2400,
                                    "url": "https://is3-ssl.mzstatic.com/image/thumb/Music124/v4/1a/9f/ab/1a9fab6f-0db2-315c-4bfe-75a40e716e25/dj.zbywctsr.jpg/{w}x{h}bb.jpg",
                                    "bgColor": "000000",
                                    "textColor1": "fffffd",
                                    "textColor2": "e5e5e5",
                                    "textColor3": "cbcbca",
                                    "textColor4": "b7b7b7"
                                },
                                "composerName": "松本孝弘",
                                "url": "https://music.apple.com/jp/album/%E3%81%A0%E3%81%8B%E3%82%89%E3%81%9D%E3%81%AE%E6%89%8B%E3%82%92%E9%9B%A2%E3%81%97%E3%81%A6-mixture-style/1560094041?i=1560094048",
                                "playParams": {
                                    "id": "1560094048",
                                    "kind": "song"
                                },
                                "discNumber": 1,
                                "isAppleDigitalMaster": false,
                                "hasLyrics": true,
                                "name": "だからその手を離して -Mixture style-",
                                "previews": [
                                    {
                                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview114/v4/f9/4d/b5/f94db5dd-2b53-49c0-4f1b-296d37a0ead9/mzaf_1661300318659944684.plus.aac.p.m4a"
                                    }
                                ],
                                "artistName": "B'z"
                            }
                        }
                    ]
                }
            }
        }
    ]
}

で、今度は楽曲としての「1560094045」で検索をかけます。URL でも ID の手前部分が「albums/」から「songs/」に変わります。

% curl -s -H 'Authorization: Bearer eyJhbGc_o_JFUzIoN_IsImtpZBI6Iks3XEs1XUI1oFE_LBJoeXB_o_JKVoQ_fQ.eyJpc3M_o_JaoXlENXc3MjZUI_w_aWFoIjoxNDM3MXc5MDM1LBJleHB_ojEooXMyoXgxMDA9.QgQS5gv75mSJMw5Hw5rIoUFUx1-IYyXIsau_Lkv6oMS-GKeLk_XuIWW6aRZ-Ex3-7KUAzMJIR5yHznvw5XIkkB' "https://api.music.apple.com/v1/catalog/jp/songs/1560094045"
{
    "data": [
        {
            "id": "1560094045",
            "type": "songs",
            "href": "/v1/catalog/jp/songs/1560094045",
            "attributes": {
                "albumName": "今夜月の見える丘に - Single",
                "genreNames": [
                    "ロック",
                    "ミュージック",
                    "J-Pop"
                ],
                "trackNumber": 1,
                "durationInMillis": 248667,
                "releaseDate": "2000-02-09",
                "isrc": "JPBM09901114",
                "artwork": {
                    "width": 2400,
                    "height": 2400,
                    "url": "https://is3-ssl.mzstatic.com/image/thumb/Music124/v4/1a/9f/ab/1a9fab6f-0db2-315c-4bfe-75a40e716e25/dj.zbywctsr.jpg/{w}x{h}bb.jpg",
                    "bgColor": "000000",
                    "textColor1": "fffffd",
                    "textColor2": "e5e5e5",
                    "textColor3": "cbcbca",
                    "textColor4": "b7b7b7"
                },
                "composerName": "松本孝弘",
                "url": "https://music.apple.com/jp/album/%E4%BB%8A%E5%A4%9C%E6%9C%88%E3%81%AE%E8%A6%8B%E3%81%88%E3%82%8B%E4%B8%98%E3%81%AB/1560094041?i=1560094045",
                "playParams": {
                    "id": "1560094045",
                    "kind": "song"
                },
                "discNumber": 1,
                "hasLyrics": true,
                "isAppleDigitalMaster": false,
                "name": "今夜月の見える丘に",
                "previews": [
                    {
                        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview124/v4/68/f5/16/68f516f1-01dd-6bfc-6e8e-c6e3cc746294/mzaf_737226102774676319.plus.aac.p.m4a"
                    }
                ],
                "artistName": "B'z"
            },
            "relationships": {
                "artists": {
                    "href": "/v1/catalog/jp/songs/1560094045/artists",
                    "data": [
                        {
                            "id": "74931253",
                            "type": "artists",
                            "href": "/v1/catalog/jp/artists/74931253"
                        }
                    ]
                },
                "albums": {
                    "href": "/v1/catalog/jp/songs/1560094045/albums",
                    "data": [
                        {
                            "id": "1560094041",
                            "type": "albums",
                            "href": "/v1/catalog/jp/albums/1560094041"
                        }
                    ]
                }
            }
        }
    ]
}

とりあえずこんな感じです。

PyJWT で Apple Music API の Developer Token を作成する

下記を参考にしつつ、Developer Token の作成と Apple 公式のテスト URL での確認を行いました。

手順をメモしておきますが、前提として Apple Developer で Media ID と秘密鍵の作成が終わっている必要があります。

  1. PyJWT と cryptography のインストール
  2. 秘密鍵ファイルの確認
  3. Developer Token の作成
  4. curl コマンドでアクセス確認
  5. B'z を検索してみる

PyJWT と cryptography のインストール

まず pip で PyJWT をインストールします。

% pip install pyjwt
Collecting pyjwt
  Downloading https://files.pythonhosted.org/packages/40/46/505f0dd53c14096f01922bf93a7abb4e40e29a06f858abbaa791e6954324/PyJWT-2.6.0-py3-none-any.whl
Installing collected packages: pyjwt
Successfully installed pyjwt-2.6.0

そして cryptography もインストールします。Apple 指定の ES256 での処理には必要だそうです。

% pip install cryptography
Collecting cryptography
  Downloading cryptography-38.0.3-cp36-abi3-macosx_10_10_x86_64.whl (2.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.8/2.8 MB 12.3 MB/s eta 0:00:00
Collecting cffi>=1.12
  Downloading cffi-1.15.1-cp38-cp38-macosx_10_9_x86_64.whl (178 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 178.9/178.9 kB 817.2 kB/s eta 0:00:00
Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Installing collected packages: pycparser, cffi, cryptography
Successfully installed cffi-1.15.1 cryptography-38.0.3 pycparser-2.21

秘密鍵ファイルの確認

今回は秘密鍵作成時にダウンロードした .p8 ファイルから直接秘密鍵を読み込んで使います。

一旦ファイルが読み込めるか確認します。不慣れなので。。。

>>> f = open('AuthKey_A1BC2DE34F.p8','r')
>>> f.read()
'-----BEGIN PRIVATE KEY-----\nMIGTBgEBMCMGCyqGSM49BgEGBBqGSM49BwEHCHkwdwICBQQg1nVJd1PhibK9odZT\n3yzf1MzRHmtSx2qXmqU5458MW/BgBgYIKoZIzj1DBQehRBNBBBSIDgBHsm//5jXy\nDTqW3JQmqbwwDhMEOb1fk+Cd6Gc681B3CtSubCz5bm9zcO/kMpasgLhM4CTmYoJE\nmMhVfb7q\n-----END PRIVATE KEY-----'
>>> 

無事、ファイルが読み込まれていますね。秘密鍵はダミーのものに書き換えてあります。

Developer Token の作成

では仕切り直してもう一度。

jwt の encode メソッドを実行して、ヘッダ、ペイロード、サインの 3 つがエンコード & 「.」で連結された文字列を吐き出します。これが Developer Token になります。

ヘッダーとペイロードに渡す内容はこちらを、コードの書き方についてはこちらを参考にしています。

>>> import jwt
>>> f = open('AuthKey_A1BC2DE34F.p8','r')
>>> key = f.read()
>>> jwt.encode(
...     {"iss": "Z98Y76543X","iat": 1667892347,"exp": 1667978747},
...     key,
...     algorithm = "ES256",
...     headers = {"kid": "A1BC2DE34F"}
... )
'eyJhbGc_o_JFUzIoN_IsImtpZBI6Iks3XEs1XUI1oFE_LBJoeXB_o_JKVoQ_fQ.eyJpc3M_o_JaoXlENXc3MjZUI_w_aWFoIjoxNDM3MXc5MDM1LBJleHB_ojEooXMyoXgxMDA9.QgQS5gv75mSJMw5Hw5rIoUFUx1-IYyXIsau_Lkv6oMS-GKeLk_XuIWW6aRZ-Ex3-7KUAzMJIR5yHznvw5XIkkB'
>>> 

Apple の公式ドキュメントに記載のサンプルコードに当てはめて curl コマンドを実行します。

curl コマンドでアクセステスト

% curl -v -H 'Authorization: Bearer eyJhbGc_o_JFUzIoN_IsImtpZBI6Iks3XEs1XUI1oFE_LBJoeXB_o_JKVoQ_fQ.eyJpc3M_o_JaoXlENXc3MjZUI_w_aWFoIjoxNDM3MXc5MDM1LBJleHB_ojEooXMyoXgxMDA9.QgQS5gv75mSJMw5Hw5rIoUFUx1-IYyXIsau_Lkv6oMS-GKeLk_XuIWW6aRZ-Ex3-7KUAzMJIR5yHznvw5XIkkB' "https://api.music.apple.com/v1/test"

重要なのは後半、HTTP のレスポンスが「200」で返ってきている部分です。

*   Trying 23.56.16.9:443...
* Connected to api.music.apple.com (23.56.16.9) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* (304) (OUT), TLS handshake, Client hello (1):
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Certificate (11):
* (304) (IN), TLS handshake, CERT verify (15):
* (304) (IN), TLS handshake, Finished (20):
* (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-AES256-GCM-SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: businessCategory=Private Organization; jurisdictionCountryName=US; jurisdictionStateOrProvinceName=California; serialNumber=C0806592; C=US; ST=California; L=Cupertino; O=Apple Inc.; OU=management:idms.group.1208920; CN=itunes.apple.com
*  start date: Apr 25 16:27:49 2022 GMT
*  expire date: May 25 16:27:48 2023 GMT
*  subjectAltName: host "api.music.apple.com" matched cert's "api.music.apple.com"
*  issuer: C=US; O=Apple Inc.; CN=Apple Public EV Server RSA CA 2 - G1
*  SSL certificate verify ok.
* Using HTTP2, server supports multiplexing
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fb56e811c00)
> GET /v1/test HTTP/2
> Host: api.music.apple.com
> user-agent: curl/7.79.1
> accept: */*
> authorization: Bearer eyJhbGc_o_JFUzIoN_IsImtpZBI6Iks3XEs1XUI1oFE_LBJoeXB_o_JKVoQ_fQ.eyJpc3M_o_JaoXlENXc3MjZUI_w_aWFoIjoxNDM3MXc5MDM1LBJleHB_ojEooXMyoXgxMDA9.QgQS5gv75mSJMw5Hw5rIoUFUx1-IYyXIsau_Lkv6oMS-GKeLk_XuIWW6aRZ-Ex3-7KUAzMJIR5yHznvw5XIkkB
> 
< HTTP/2 200 
< server: 4.0.0
< content-type: application/json
< content-length: 0
< x-apple-jingle-correlation-key: Y4JI7FBYVWF6I6MSJMT6OBPQMQ
< x-apple-request-uuid: c7128f94-38ad-8be4-7992-4b27e705f064
< b3: c7128f9438ad8be479924b27e705f064-382f7c8a2052e4cc
< x-b3-traceid: c7128f9438ad8be479924b27e705f064
< x-b3-spanid: 382f7c8a2052e4cc
< apple-seq: 0.0
< apple-tk: false
< apple-originating-system: MZStorePlatform
< x-apple-application-site: ST11
< x-apple-application-instance: 2534168
< x-responding-instance: MZStorePlatform:2534168:::
< apple-timing-app: 7 ms
< access-control-allow-origin: *
< strict-transport-security: max-age=31536000; includeSubDomains
< is-jetty: true
< x-apple-lokamai-no-cache: true
< x-daiquiri-instance: daiquiri:41896001:st53p00it-qujn12040301:7987:22RELEASE167:daiquiri-amp-store-l7shared-int-001-st
< x-daiquiri-instance: daiquiri:42282006:st53p00it-qujn15040502:7987:22RELEASE167:daiquiri-amp-store-l7shared-ext-001-st
< expires: Tue, 08 Nov 2022 11:30:33 GMT
< cache-control: max-age=0, no-cache, private
< pragma: no-cache
< date: Tue, 08 Nov 2022 11:30:33 GMT
< x-cache: TCP_MISS from a23-55-45-84.deploy.akamaitechnologies.com (AkamaiGHost/10.10.1-44825277) (-)
< vary: Accept-Encoding
< vary: Accept-Encoding
< 
* Connection #0 to host api.music.apple.com left intact
% 

ついでに URL の部分を検索用のものに変えてみます。

「"https://api.music.apple.com/v1/catalog/jp/search?term=B'z&types=artists"」

で、実行。

% curl -v -H 'Authorization: Bearer eyJhbGc_o_JFUzIoN_IsImtpZBI6Iks3XEs1XUI1oFE_LBJoeXB_o_JKVoQ_fQ.eyJpc3M_o_JaoXlENXc3MjZUI_w_aWFoIjoxNDM3MXc5MDM1LBJleHB_ojEooXMyoXgxMDA9.QgQS5gv75mSJMw5Hw5rIoUFUx1-IYyXIsau_Lkv6oMS-GKeLk_XuIWW6aRZ-Ex3-7KUAzMJIR5yHznvw5XIkkB' "https://api.music.apple.com/v1/catalog/jp/search?term=B'z&types=artists"

するとレスポンスの最後、B'z にまつわる情報が返ってきているのが分かるかと思います。

*   Trying 23.56.16.9:443...
* Connected to api.music.apple.com (23.56.16.9) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* (304) (OUT), TLS handshake, Client hello (1):
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Certificate (11):
* (304) (IN), TLS handshake, CERT verify (15):
* (304) (IN), TLS handshake, Finished (20):
* (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-AES256-GCM-SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: businessCategory=Private Organization; jurisdictionCountryName=US; jurisdictionStateOrProvinceName=California; serialNumber=C0806592; C=US; ST=California; L=Cupertino; O=Apple Inc.; OU=management:idms.group.1208920; CN=itunes.apple.com
*  start date: Apr 25 16:27:49 2022 GMT
*  expire date: May 25 16:27:48 2023 GMT
*  subjectAltName: host "api.music.apple.com" matched cert's "api.music.apple.com"
*  issuer: C=US; O=Apple Inc.; CN=Apple Public EV Server RSA CA 2 - G1
*  SSL certificate verify ok.
* Using HTTP2, server supports multiplexing
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fedf900b600)
> GET /v1/catalog/jp/search?term=B'z&types=artists HTTP/2
> Host: api.music.apple.com
> user-agent: curl/7.79.1
> accept: */*
> authorization: Bearer eyJhbGc_o_JFUzIoN_IsImtpZBI6Iks3XEs1XUI1oFE_LBJoeXB_o_JKVoQ_fQ.eyJpc3M_o_JaoXlENXc3MjZUI_w_aWFoIjoxNDM3MXc5MDM1LBJleHB_ojEooXMyoXgxMDA9.QgQS5gv75mSJMw5Hw5rIoUFUx1-IYyXIsau_Lkv6oMS-GKeLk_XuIWW6aRZ-Ex3-7KUAzMJIR5yHznvw5XIkkB
> 
< HTTP/2 200 
< server: 4.0.0
< content-type: application/json;charset=utf-8
< x-apple-jingle-correlation-key: JOSXR57OF2OG2ZRUJKOEOZVJRA
< x-apple-request-uuid: 4ba578f7-ee2e-9c6d-6634-4a9c4766a988
< b3: 4ba578f7ee2e9c6d66344a9c4766a988-0b03f71f5b294b1c
< x-b3-traceid: 4ba578f7ee2e9c6d66344a9c4766a988
< x-b3-spanid: 0b03f71f5b294b1c
< apple-seq: 0.0
< apple-tk: false
< apple-originating-system: MZStorePlatform
< x-apple-application-site: ST11
< x-apple-application-instance: 2534673
< x-responding-instance: MZStorePlatform:2534673:::
< apple-timing-app: 88 ms
< access-control-allow-origin: *
< strict-transport-security: max-age=31536000; includeSubDomains
< is-jetty: true
< x-daiquiri-instance: daiquiri:41896004:st53p00it-qujn15040101:7987:22RELEASE167:daiquiri-amp-store-l7shared-int-001-st
< x-daiquiri-instance: daiquiri:42282002:st53p00it-qujn13050102:7987:22RELEASE167:daiquiri-amp-store-l7shared-ext-001-st
< cache-control: public, no-transform, max-age=29
< date: Wed, 09 Nov 2022 00:22:40 GMT
< content-length: 8620
< x-cache: TCP_HIT from a23-55-45-84.deploy.akamaitechnologies.com (AkamaiGHost/10.10.1-44825277) (-)
< vary: Accept-Encoding
< vary: Accept-Encoding
< 
{"results":{"artists":{"href":"/v1/catalog/jp/search?limit=5&term=B%27z&types=artists","next":"/v1/catalog/jp/search?offset=5&term=B%27z&types=artists","data":[{"id":"74931253","type":"artists","href":"/v1/catalog/jp/artists/74931253","attributes":{"name":"B'z","genreNames":["ロック"],"artwork":{"width":2400,"height":2400,"url":"https://is5-ssl.mzstatic.com/image/thumb/Music122/v4/0c/88/58/0c885888-c769-81f8-8485-069cd9a362f1/pr_source.png/{w}x{h}bb.jpg","bgColor":"dcdfe6","textColor1":"000001","textColor2":"1b191e","textColor3":"2c2c2f","textColor4":"424046"},"url":"https://music.apple.com/jp/artist/bz/74931253"},"relationships":{"albums":{"href":"/v1/catalog/jp/artists/74931253/albums","next":"/v1/catalog/jp/artists/74931253/albums?offset=25","data":[{"id":"283000073","type":"albums","href":"/v1/catalog/jp/albums/283000073"},{"id":"292067907","type":"albums","href":"/v1/catalog/jp/albums/292067907"},{"id":"666625900","type":"albums","href":"/v1/catalog/jp/albums/666625900"},{"id":"75682683","type":"albums","href":"/v1/catalog/jp/albums/75682683"},{"id":"1561574089","type":"albums","href":"/v1/catalog/jp/albums/1561574089"},{"id":"74937562","type":"albums","href":"/v1/catalog/jp/albums/74937562"},{"id":"666634430","type":"albums","href":"/v1/catalog/jp/albums/666634430"},{"id":"75681798","type":"albums","href":"/v1/catalog/jp/albums/75681798"},{"id":"1605118558","type":"albums","href":"/v1/catalog/jp/albums/1605118558"},{"id":"75356318","type":"albums","href":"/v1/catalog/jp/albums/75356318"},{"id":"1466937136","type":"albums","href":"/v1/catalog/jp/albums/1466937136"},{"id":"74933581","type":"albums","href":"/v1/catalog/jp/albums/74933581"},{"id":"75682153","type":"albums","href":"/v1/catalog/jp/albums/75682153"},{"id":"347013256","type":"albums","href":"/v1/catalog/jp/albums/347013256"},{"id":"74935606","type":"albums","href":"/v1/catalog/jp/albums/74935606"},{"id":"75354662","type":"albums","href":"/v1/catalog/jp/albums/75354662"},{"id":"1325460835","type":"albums","href":"/v1/catalog/jp/albums/1325460835"},{"id":"454667912","type":"albums","href":"/v1/catalog/jp/albums/454667912"},{"id":"297710855","type":"albums","href":"/v1/catalog/jp/albums/297710855"},{"id":"1561701429","type":"albums","href":"/v1/catalog/jp/albums/1561701429"},{"id":"74944705","type":"albums","href":"/v1/catalog/jp/albums/74944705"},{"id":"1567851939","type":"albums","href":"/v1/catalog/jp/albums/1567851939"},{"id":"75361124","type":"albums","href":"/v1/catalog/jp/albums/75361124"},{"id":"1567852104","type":"albums","href":"/v1/catalog/jp/albums/1567852104"},{"id":"75357159","type":"albums","href":"/v1/catalog/jp/albums/75357159"}]}}},{"id":"1236215587","type":"artists","href":"/v1/catalog/jp/artists/1236215587","attributes":{"name":"BZ","genreNames":["ヒップホップ/ラップ"],"artwork":{"width":3000,"height":3000,"url":"https://is3-ssl.mzstatic.com/image/thumb/Music124/v4/ae/b6/fb/aeb6fb97-56ba-e8fd-083f-f8c21970a74f/artwork.jpg/{w}x{h}ac.jpg","bgColor":"0f1050","textColor1":"d6bcf7","textColor2":"9dafdf","textColor3":"ae99d5","textColor4":"818fc2"},"url":"https://music.apple.com/jp/artist/bz/1236215587"},"relationships":{"albums":{"href":"/v1/catalog/jp/artists/1236215587/albums","data":[{"id":"1612269170","type":"albums","href":"/v1/catalog/jp/albums/1612269170"},{"id":"1552528987","type":"albums","href":"/v1/catalog/jp/albums/1552528987"},{"id":"1170604377","type":"albums","href":"/v1/catalog/jp/albums/1170604377"},{"id":"1344358078","type":"albums","href":"/v1/catalog/jp/albums/1344358078"},{"id":"1501353949","type":"albums","href":"/v1/catalog/jp/albums/1501353949"},{"id":"1551034513","type":"albums","href":"/v1/catalog/jp/albums/1551034513"},{"id":"1502686217","type":"albums","href":"/v1/catalog/jp/albums/1502686217"},{"id":"1502573665","type":"albums","href":"/v1/catalog/jp/albums/1502573665"},{"id":"1544732805","type":"albums","href":"/v1/catalog/jp/albums/1544732805"},{"id":"1536654657","type":"albums","href":"/v1/catalog/jp/albums/1536654657"},{"id":"1549103433","type":"albums","href":"/v1/catalog/jp/albums/1549103433"},{"id":"1375096721","type":"albums","href":"/v1/catalog/jp/albums/1375096721"},{"id":"1561406752","type":"albums","href":"/v1/catalog/jp/albums/1561406752"},{"id":"1597875079","type":"albums","href":"/v1/catalog/jp/albums/1597875079"},{"id":"1566648690","type":"albums","href":"/v1/catalog/jp/albums/1566648690"},{"id":"1503527043","type":"albums","href":"/v1/catalog/jp/albums/1503527043"},{"id":"1448546746","type":"albums","href":"/v1/catalog/jp/albums/1448546746"},{"id":"1644747159","type":"albums","href":"/v1/catalog/jp/albums/1644747159"},{"id":"1629986398","type":"albums","href":"/v1/catalog/jp/albums/1629986398"},{"id":"1619147046","type":"albums","href":"/v1/catalog/jp/albums/1619147046"},{"id":"1606159561","type":"albums","href":"/v1/catalog/jp/albums/1606159561"},{"id":"1582431314","type":"albums","href":"/v1/catalog/jp/albums/1582431314"}]}}},{"id":"1465740891","type":"artists","href":"/v1/catalog/jp/artists/1465740891","attributes":{"name":"BZ","genreNames":["エレクトロニック"],"artwork":{"width":500,"height":500,"url":"https://is3-ssl.mzstatic.com/image/thumb/Features125/v4/9e/da/50/9eda50fb-495d-62dd-473e-7e5ad83209f7/pr_source.png/{w}x{h}bb.jpg","bgColor":"1a1615","textColor1":"f6c069","textColor2":"d8a971","textColor3":"ca9e58","textColor4":"b28c5e"},"url":"https://music.apple.com/jp/artist/bz/1465740891"},"relationships":{"albums":{"href":"/v1/catalog/jp/artists/1465740891/albums","data":[{"id":"838262440","type":"albums","href":"/v1/catalog/jp/albums/838262440"},{"id":"997882538","type":"albums","href":"/v1/catalog/jp/albums/997882538"},{"id":"964660751","type":"albums","href":"/v1/catalog/jp/albums/964660751"},{"id":"1212786159","type":"albums","href":"/v1/catalog/jp/albums/1212786159"},{"id":"1579770371","type":"albums","href":"/v1/catalog/jp/albums/1579770371"}]}}},{"id":"1585689464","type":"artists","href":"/v1/catalog/jp/artists/1585689464","attributes":{"name":"BZ","genreNames":["エレクトロニック"],"artwork":{"width":4000,"height":4000,"url":"https://is5-ssl.mzstatic.com/image/thumb/Music122/v4/ac/09/ab/ac09ab8c-1707-c6aa-a45e-9074649456f0/5059722847474_cover.jpg/{w}x{h}ac.jpg","bgColor":"03242f","textColor1":"d0cecc","textColor2":"21b9d9","textColor3":"a7acac","textColor4":"1b9bb7"},"url":"https://music.apple.com/jp/artist/bz/1585689464"},"relationships":{"albums":{"href":"/v1/catalog/jp/artists/1585689464/albums","data":[{"id":"776208953","type":"albums","href":"/v1/catalog/jp/albums/776208953"},{"id":"1612158034","type":"albums","href":"/v1/catalog/jp/albums/1612158034"},{"id":"1571657950","type":"albums","href":"/v1/catalog/jp/albums/1571657950"},{"id":"1581841967","type":"albums","href":"/v1/catalog/jp/albums/1581841967"},{"id":"1577141561","type":"albums","href":"/v1/catalog/jp/albums/1577141561"},{"id":"1577141651","type":"albums","href":"/v1/catalog/jp/albums/1577141651"},{"id":"1583900522","type":"albums","href":"/v1/catalog/jp/albums/1583900522"},{"id":"1620727001","type":"albums","href":"/v1/catalog/jp/albums/1620727001"},{"id":"1584610904","type":"albums","href":"/v1/catalog/jp/albums/1584610904"}]}}},{"id":"303385174","type":"artists","href":"/v1/catalog/jp/artists/303385174","attributes":{"name":"BZ","genreNames":["ヒップホップ/ラップ"],"artwork":{"width":996,"height":996,"url":"https://is1-ssl.mzstatic.com/image/thumb/Music112/v4/81/ef/b0/81efb079-e993-f42a-cfe1-6ece22673a2f/pr_source.png/{w}x{h}bb.jpg","bgColor":"1f1c2d","textColor1":"c7cea4","textColor2":"d0ba8c","textColor3":"a6ab8c","textColor4":"ad9a79"},"url":"https://music.apple.com/jp/artist/bz/303385174"},"relationships":{"albums":{"href":"/v1/catalog/jp/artists/303385174/albums","data":[{"id":"1447921556","type":"albums","href":"/v1/catalog/jp/albums/1447921556"},{"id":"1637062769","type":"albums","href":"/v1/catalog/jp/albums/1637062769"},{"id":"1517197555","type":"albums","href":"/v1/catalog/jp/albums/1517197555"},{"id":"1614079632","type":"albums","href":"/v1/catalog/jp/albums/1614079632"},{"id":"1558826365","type":"albums","href":"/v1/catalog/jp/albums/1558826365"},{"id":"1609298956","type":"albums* Connection #0 to host api.music.apple.com left intact
","href":"/v1/catalog/jp/albums/1609298956"},{"id":"1584989196","type":"albums","href":"/v1/catalog/jp/albums/1584989196"},{"id":"1522129749","type":"albums","href":"/v1/catalog/jp/albums/1522129749"},{"id":"1648328595","type":"albums","href":"/v1/catalog/jp/albums/1648328595"},{"id":"1635988163","type":"albums","href":"/v1/catalog/jp/albums/1635988163"}]}}}]}},"meta":{"results":{"order":["artists"],"rawOrder":["artists"]}}}%                                                                                                                      % 

見づらいので形を整えたものが下記です。

{
    "results": {
        "artists": {
            "href": "/v1/catalog/jp/search?limit=5&term=B%27z&types=artists",
            "next": "/v1/catalog/jp/search?offset=5&term=B%27z&types=artists",
            "data": [
                {
                    "id": "74931253",
                    "type": "artists",
                    "href": "/v1/catalog/jp/artists/74931253",
                    "attributes": {
                        "name": "B'z",
                        "genreNames": [
                            "ロック"
                        ],
                        "artwork": {
                            "width": 2400,
                            "height": 2400,
                            "url": "https://is5-ssl.mzstatic.com/image/thumb/Music122/v4/0c/88/58/0c885888-c769-81f8-8485-069cd9a362f1/pr_source.png/{w}x{h}bb.jpg",
                            "bgColor": "dcdfe6",
                            "textColor1": "000001",
                            "textColor2": "1b191e",
                            "textColor3": "2c2c2f",
                            "textColor4": "424046"
                        },
                        "url": "https://music.apple.com/jp/artist/bz/74931253"
                    },
                    "relationships": {
                        "albums": {
                            "href": "/v1/catalog/jp/artists/74931253/albums",
                            "next": "/v1/catalog/jp/artists/74931253/albums?offset=25",
                            "data": [
                                {
                                    "id": "283000073",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/283000073"
                                },
                                {
                                    "id": "292067907",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/292067907"
                                },
                                {
                                    "id": "666625900",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/666625900"
                                },
                                {
                                    "id": "75682683",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/75682683"
                                },
                                {
                                    "id": "1561574089",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1561574089"
                                },
                                {
                                    "id": "74937562",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/74937562"
                                },
                                {
                                    "id": "666634430",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/666634430"
                                },
                                {
                                    "id": "75681798",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/75681798"
                                },
                                {
                                    "id": "1605118558",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1605118558"
                                },
                                {
                                    "id": "75356318",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/75356318"
                                },
                                {
                                    "id": "1466937136",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1466937136"
                                },
                                {
                                    "id": "74933581",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/74933581"
                                },
                                {
                                    "id": "75682153",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/75682153"
                                },
                                {
                                    "id": "347013256",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/347013256"
                                },
                                {
                                    "id": "74935606",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/74935606"
                                },
                                {
                                    "id": "75354662",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/75354662"
                                },
                                {
                                    "id": "1325460835",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1325460835"
                                },
                                {
                                    "id": "454667912",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/454667912"
                                },
                                {
                                    "id": "297710855",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/297710855"
                                },
                                {
                                    "id": "1561701429",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1561701429"
                                },
                                {
                                    "id": "74944705",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/74944705"
                                },
                                {
                                    "id": "1567851939",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1567851939"
                                },
                                {
                                    "id": "75361124",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/75361124"
                                },
                                {
                                    "id": "1567852104",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1567852104"
                                },
                                {
                                    "id": "75357159",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/75357159"
                                }
                            ]
                        }
                    }
                },
                {
                    "id": "1236215587",
                    "type": "artists",
                    "href": "/v1/catalog/jp/artists/1236215587",
                    "attributes": {
                        "name": "BZ",
                        "genreNames": [
                            "ヒップホップ/ラップ"
                        ],
                        "artwork": {
                            "width": 3000,
                            "height": 3000,
                            "url": "https://is3-ssl.mzstatic.com/image/thumb/Music124/v4/ae/b6/fb/aeb6fb97-56ba-e8fd-083f-f8c21970a74f/artwork.jpg/{w}x{h}ac.jpg",
                            "bgColor": "0f1050",
                            "textColor1": "d6bcf7",
                            "textColor2": "9dafdf",
                            "textColor3": "ae99d5",
                            "textColor4": "818fc2"
                        },
                        "url": "https://music.apple.com/jp/artist/bz/1236215587"
                    },
                    "relationships": {
                        "albums": {
                            "href": "/v1/catalog/jp/artists/1236215587/albums",
                            "data": [
                                {
                                    "id": "1612269170",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1612269170"
                                },
                                {
                                    "id": "1552528987",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1552528987"
                                },
                                {
                                    "id": "1170604377",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1170604377"
                                },
                                {
                                    "id": "1344358078",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1344358078"
                                },
                                {
                                    "id": "1501353949",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1501353949"
                                },
                                {
                                    "id": "1551034513",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1551034513"
                                },
                                {
                                    "id": "1502686217",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1502686217"
                                },
                                {
                                    "id": "1502573665",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1502573665"
                                },
                                {
                                    "id": "1544732805",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1544732805"
                                },
                                {
                                    "id": "1536654657",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1536654657"
                                },
                                {
                                    "id": "1549103433",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1549103433"
                                },
                                {
                                    "id": "1375096721",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1375096721"
                                },
                                {
                                    "id": "1561406752",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1561406752"
                                },
                                {
                                    "id": "1597875079",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1597875079"
                                },
                                {
                                    "id": "1566648690",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1566648690"
                                },
                                {
                                    "id": "1503527043",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1503527043"
                                },
                                {
                                    "id": "1448546746",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1448546746"
                                },
                                {
                                    "id": "1644747159",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1644747159"
                                },
                                {
                                    "id": "1629986398",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1629986398"
                                },
                                {
                                    "id": "1619147046",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1619147046"
                                },
                                {
                                    "id": "1606159561",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1606159561"
                                },
                                {
                                    "id": "1582431314",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1582431314"
                                }
                            ]
                        }
                    }
                },
                {
                    "id": "1465740891",
                    "type": "artists",
                    "href": "/v1/catalog/jp/artists/1465740891",
                    "attributes": {
                        "name": "BZ",
                        "genreNames": [
                            "エレクトロニック"
                        ],
                        "artwork": {
                            "width": 500,
                            "height": 500,
                            "url": "https://is3-ssl.mzstatic.com/image/thumb/Features125/v4/9e/da/50/9eda50fb-495d-62dd-473e-7e5ad83209f7/pr_source.png/{w}x{h}bb.jpg",
                            "bgColor": "1a1615",
                            "textColor1": "f6c069",
                            "textColor2": "d8a971",
                            "textColor3": "ca9e58",
                            "textColor4": "b28c5e"
                        },
                        "url": "https://music.apple.com/jp/artist/bz/1465740891"
                    },
                    "relationships": {
                        "albums": {
                            "href": "/v1/catalog/jp/artists/1465740891/albums",
                            "data": [
                                {
                                    "id": "838262440",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/838262440"
                                },
                                {
                                    "id": "997882538",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/997882538"
                                },
                                {
                                    "id": "964660751",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/964660751"
                                },
                                {
                                    "id": "1212786159",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1212786159"
                                },
                                {
                                    "id": "1579770371",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1579770371"
                                }
                            ]
                        }
                    }
                },
                {
                    "id": "1585689464",
                    "type": "artists",
                    "href": "/v1/catalog/jp/artists/1585689464",
                    "attributes": {
                        "name": "BZ",
                        "genreNames": [
                            "エレクトロニック"
                        ],
                        "artwork": {
                            "width": 4000,
                            "height": 4000,
                            "url": "https://is5-ssl.mzstatic.com/image/thumb/Music122/v4/ac/09/ab/ac09ab8c-1707-c6aa-a45e-9074649456f0/5059722847474_cover.jpg/{w}x{h}ac.jpg",
                            "bgColor": "03242f",
                            "textColor1": "d0cecc",
                            "textColor2": "21b9d9",
                            "textColor3": "a7acac",
                            "textColor4": "1b9bb7"
                        },
                        "url": "https://music.apple.com/jp/artist/bz/1585689464"
                    },
                    "relationships": {
                        "albums": {
                            "href": "/v1/catalog/jp/artists/1585689464/albums",
                            "data": [
                                {
                                    "id": "776208953",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/776208953"
                                },
                                {
                                    "id": "1612158034",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1612158034"
                                },
                                {
                                    "id": "1571657950",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1571657950"
                                },
                                {
                                    "id": "1581841967",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1581841967"
                                },
                                {
                                    "id": "1577141561",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1577141561"
                                },
                                {
                                    "id": "1577141651",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1577141651"
                                },
                                {
                                    "id": "1583900522",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1583900522"
                                },
                                {
                                    "id": "1620727001",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1620727001"
                                },
                                {
                                    "id": "1584610904",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1584610904"
                                }
                            ]
                        }
                    }
                },
                {
                    "id": "303385174",
                    "type": "artists",
                    "href": "/v1/catalog/jp/artists/303385174",
                    "attributes": {
                        "name": "BZ",
                        "genreNames": [
                            "ヒップホップ/ラップ"
                        ],
                        "artwork": {
                            "width": 996,
                            "height": 996,
                            "url": "https://is1-ssl.mzstatic.com/image/thumb/Music112/v4/81/ef/b0/81efb079-e993-f42a-cfe1-6ece22673a2f/pr_source.png/{w}x{h}bb.jpg",
                            "bgColor": "1f1c2d",
                            "textColor1": "c7cea4",
                            "textColor2": "d0ba8c",
                            "textColor3": "a6ab8c",
                            "textColor4": "ad9a79"
                        },
                        "url": "https://music.apple.com/jp/artist/bz/303385174"
                    },
                    "relationships": {
                        "albums": {
                            "href": "/v1/catalog/jp/artists/303385174/albums",
                            "data": [
                                {
                                    "id": "1447921556",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1447921556"
                                },
                                {
                                    "id": "1637062769",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1637062769"
                                },
                                {
                                    "id": "1517197555",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1517197555"
                                },
                                {
                                    "id": "1614079632",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1614079632"
                                },
                                {
                                    "id": "1558826365",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1558826365"
                                },
                                {
                                    "id": "1609298956",
                                    "type": "albums* Connection #0 to host api.music.apple.com left intact",
                                    "href": "/v1/catalog/jp/albums/1609298956"
                                },
                                {
                                    "id": "1584989196",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1584989196"
                                },
                                {
                                    "id": "1522129749",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1522129749"
                                },
                                {
                                    "id": "1648328595",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1648328595"
                                },
                                {
                                    "id": "1635988163",
                                    "type": "albums",
                                    "href": "/v1/catalog/jp/albums/1635988163"
                                }
                            ]
                        }
                    }
                }
            ]
        }
    },
    "meta": {
        "results": {
            "order": [
                "artists"
            ],
            "rawOrder": [
                "artists"
            ]
        }
    }
}

とりあえず無事認証済みの開発者としてアクセスできました。

Apple Developer の Media ID と秘密鍵を作成する方法

Apple の MusicKit を使いたいんですが、そのためには Media ID と秘密鍵を作る必要があったため手順を記録しておきます。

手順は ↓ にも Apple 公式の記載があります。

▶︎ サービスにアクセスするための秘密鍵を作成する - Apple デベロッパアカウントヘルプ

  1. Media ID の作成
  2. 秘密鍵の作成

1. Media ID の作成

まず Developer アカウントにサインインした上で下記にアクセスします。

▶︎ Certificates, Identifiers & Profiles - Apple Developer

Identifiers タブで「+」アイコンをクリックします。

すると ID の種類を選択する画面が表示されるので「Media IDs」をチェックし「Continue」をクリックします。

Description(ID の名前)を入力し、MusicKit にチェックを入れ「Continue」をクリックします。

入力した内容に間違いがないか確認し、「Register」をクリックします。

作成した ID と ID 名が表示されます。これで MusicKit の Media ID が作成されました。

2. 秘密鍵の作成

次に秘密鍵を作成します。「Keys」タブをクリックし、「Create a key」をクリックします。

秘密鍵の種類を選択する画面で「Media Services」にチェックを入れ「Continue」をクリックします。

ちなみに、先ほどの紹介した ID の作成が完了していないと下記の様にグレーアウトされた表示となります。

先ほど作成した ID を選択し「Save」をクリックします。

画面が戻るので「Continue」をクリックします。

作成する秘密鍵の内容が表示されます。問題なければ「Register」をクリックします。

「Download」ボタンをクリックすると .p8 形式のファイルがダウンロードされます。

一度「Download」ボタンをクリックするとファイルの再ダウンロードはできないので安全な場所に保存しましょう。

下記の様な形式になっています。

無事ダウンロードが完了したら「Done」をクリックします。

Key ID と表示されている部分に 10 桁の Key ID が表示されます。これは後々「kid」として使用するものになります。

これで MusicKit ID と秘密鍵の作成は完了です。

手順は ↓ にも記載があります。

▶︎ サービスにアクセスするための秘密鍵を作成する - Apple デベロッパアカウントヘルプ

実際に MusicKit を使うにはこれらを使用して Developer Token を作成する必要があります。