A Cloudflare Worker that fetches animated album artwork.
GET /?s=song&a=artist
GET /?song=song&artist=artist
GET /?id=albumId
GET /?url=https://music.apple.com/us/album/album-name/1234567890
GET /health
{
"name": "Album Name",
"artist": "Artist Name",
"albumId": "123456",
"static": "https://...mzstatic.com/.../1200x1200.jpg",
"animated": "https://...m3u8",
"videoUrl": "https://...segment.mp4"
}static: High-resolution static album artwork (1200x1200)animated: M3U8 playlist URL for animated artwork (null if not available)videoUrl: Direct video segment URL for highest quality (null if not available)
npm install
npm run dev-
Create the KV namespace (if not already done):
npx wrangler kv:namespace create CACHE npx wrangler kv:namespace create CACHE --preview
-
Update
wrangler.tomlwith the KV namespace IDs -
Deploy:
npm run deploy
| Parameter | Aliases | Description |
|---|---|---|
s |
song |
Song name for search |
a |
artist |
Artist name for search |
id |
- | Direct album ID |
url |
- | Full album URL |
storefront |
- | Country code (default: us) |