100 free credits. No credit card required. Get a key

Apple Music search API

Search Apple Music for artists, albums, songs and music videos in any storefront.

GET /v1/applemusic/search1 credit per callRefunded on failure
import os, requests

res = requests.get(
    "https://api.groundsocial.dev/v1/applemusic/search?q=taylor%20swift",
    headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()
Response
200 · 1 credit
{
"artists": [
{
"wrapperType": "artist",
"artistType": "Artist",
"artistName": "Taylor Swift",
"artistLinkUrl": "https://music.apple.com/us/artist/taylor-swift/159260351?uo=4",
"artistId": 159260351,
"amgArtistId": 816977,
"primaryGenreName": "Pop",
"primaryGenreId": 14
},
"… 4 more"
],
"albums": [
{
"wrapperType": "collection",
"collectionType": "Album",
"artistId": 159260351,
"collectionId": 1440913923,
"artistName": "Taylor Swift",
"collectionName": "Taylor Swift (Bonus Track Version)",
"collectionCensoredName": "Taylor Swift (Bonus Track Version)",
"artistViewUrl": "https://music.apple.com/us/artist/taylor-swift/159260351?uo=4",
"collectionViewUrl": "https://music.apple.com/us/album/taylor-swift-bonus-track-version/1440913923?uo=…",
"artworkUrl100": "https://is1-ssl.mzstatic.com/image/thumb/Music221/v4/be/e1/48/bee148d6-d16c-d8f7…",
"…": "10 more fields"
},
"… 9 more"
],
"songs": [
{
"wrapperType": "track",
"kind": "song",
"artistId": 159260351,
"collectionId": 6814997249,
"trackId": 6814997425,
"artistName": "Taylor Swift",
"collectionName": "The Life of a Showgirl: The Encore",
"trackName": "Patient Zero",
"trackViewUrl": "https://music.apple.com/us/album/patient-zero/6814997249?i=6814997425&uo=4",
"previewUrl": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview221/v4/db/e7/50/dbe…",
"…": "21 more fields"
},
"… 9 more"
],
"music_videos": []
}

Parameters

NameTypeDescription
qquery · requiredstringSearch words. Example: taylor swift.
typequerystringKinds to search: artist, album, song, music-video.
limitqueryintegerResults per kind (default 10).
countryquerystringStorefront, ISO 3166-1 alpha-2 in any case (default us, or the link’s). uk reads as gb. Example: gb.
Response fields

200 with a AppleMusicSearchResponse, in Apple’s own iTunes Search API and RSS chart JSON.

FieldTypeDescription
artistsAppleMusicArtist[]
albumsAppleMusicAlbum[]
songsAppleMusicTrack[]
music_videosAppleMusicTrack[]
Status codes
StatusMeaning
200Matches by kind.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404No Apple Music item by that id in that storefront.
429Too many requests. Wait for Retry-After seconds.
503Apple Music is temporarily unavailable. Retryable; nothing was charged.

Every error has code, message, hint and retryable. All error codes

Questions

How many results?

Up to 50 per kind.

Apple Music is a trademark of Apple Inc. We are not affiliated with or endorsed by Apple.