Apple iTunes Search API 完整参考指南。用于搜索 iTunes/Apple Music 目录中的音乐、电影、播客、应用、图书等内容。 触发条件: 用户提及 "iTunes API"、"Apple Music API"、"搜索歌曲"、"查找专辑"、"获取歌词"、 "搜索 App"、"查找播客"、"iTunes 搜索"、"获取封面"、"album art"、"track lookup" 等。 涵盖 Search API、Lookup API、Genre API、RSS Feed Generator 四大端点。
Ships in game-dev-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
无需认证的公开 REST API,用于搜索和获取 Apple 内容目录的元数据。
| 端点 | 基础 URL | 用途 |
|---|---|---|
| Search | https://itunes.apple.com/search | 关键词搜索 |
| Lookup | https://itunes.apple.com/lookup | 按 ID 精确查询 |
| Genre | https://itunes.apple.com/WebObjects/MZStoreServices.woa/ws/genres | 获取分类列表 |
| RSS Feed | https://rss.itunes.apple.com/api/v1/{country}/{media}/{feed}/{genre}/{limit}/{format} | 获取排行榜 |
GET https://itunes.apple.com/search
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
term | string | 是 | 搜索关键词,需 URL 编码 |
country | string | 否 | 两位国家代码,如 US、CN,默认 US |
media | string | 否 | 媒体类型,见下表 |
entity | string | 否 | 结果实体类型,需与 media 搭配 |
limit | number | 否 | 返回数量,最大 200,默认 50 |
offset | number | 否 | 分页偏移量 |
lang | string | 否 | 返回结果的语言,如 en_us、zh_cn |
version | number | 否 | API 版本,默认 2 |
callback | string | 否 | JSONP 回调函数名 |
| media 值 | 说明 |
|---|---|
movie | 电影 |
podcast | 播客 |
music | 音乐 |
musicVideo | 音乐视频 |
audiobook | 有声书 |
shortFilm | 短片 |
tvShow | 电视节目 |
software | 应用 (iOS/Mac) |
ebook | 电子书 |
all | 全部 (默认) |
music:
musicArtist, album, song, musicVideo, mix, genre
movie:
movieArtist, movie, genre
podcast:
podcastAuthor, podcast
software:
software, softwareDeveloper, iPadSoftware -- 注意: software 适用于 iOS,iPadSoftware 适用于 iPad
ebook:
ebook, audiobook, ebookAuthor, audiobookAuthor
all:
allArtist, allTrack
tvShow:
tvEpisode, tvSeason, tvShow -- 注意: 默认不返回所有季的剧集,需指定 entity
搭配 media 使用,限定搜索的匹配字段:
| attribute 值 | 适用 media |
|---|---|
actorTerm | movie |
albumTerm | music |
artistTerm | music, podcast, musicVideo, shortFilm, tvShow, all |
artworkUrlTerm | all |
authorTerm | ebook |
collectionTerm | all |
composerTerm | all |
descriptionTerm | all |
directorTerm | movie, shortFilm, podcast |
editorTerm | podcast |
genreIndex | all |
keywordTerm | software, ebook |
languageTerm | software |
movieArtistTerm | movie |
movieTerm | movie |
podcastAuthorTerm | podcast |
podcastTerm | podcast |
producerTerm | podcast |
ratingIndex | all |
releaseYearTerm | all |
songTerm | music |
softwareDeveloperTerm | software |
titleTerm | all |
tvEpisodeTerm | tvShow |
tvSeasonTerm | tvShow |
tvShowTerm | tvShow |
# 搜索歌曲
curl "https://itunes.apple.com/search?term=beatles&media=music&entity=song&limit=5"
# 搜索特定艺术家的专辑
curl "https://itunes.apple.com/search?term=radiohead&entity=album&limit=10"
# 搜索应用
curl "https://itunes.apple.com/search?term=wechat&entity=software&country=CN&limit=5"
# 按艺术家名称搜索
curl "https://itunes.apple.com/search?attribute=artistTerm&term=coldplay&entity=song&limit=5"
# 搜索电影
curl "https://itunes.apple.com/search?term=inception&entity=movie&limit=5"
# 搜索播客
curl "https://itunes.apple.com/search?term=true+crime&entity=podcast&limit=5"
# 分页搜索
curl "https://itunes.apple.com/search?term=pop&entity=song&limit=25&offset=50"
# 中文搜索
curl "https://itunes.apple.com/search?term=%E5%91%A8%E6%9D%B0%E4%BC%A6&country=CN&entity=song&limit=5"
GET https://itunes.apple.com/lookup
通过 ID 精确查询内容详情,支持批量查询。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 否 | iTunes ID,多个 ID 用逗号分隔,最多 200 个 |
amgArtistId | string | 否 | All Music Guide 艺术家 ID |
isbn | string | 否 | 图书 ISBN |
upc | string | 否 | 商品 UPC/EAN 码 |
entity | string | 否 | 返回关联实体类型 |
limit | number | 否 | 关联实体返回数量 |
country | string | 否 | 两位国家代码 |
lang | string | 否 | 返回结果的语言 |
id、amgArtistId、isbn、upc四选一
# 按单个 ID 查询
curl "https://itunes.apple.com/lookup?id=909253"
# 批量查询 (多个 ID)
curl "https://itunes.apple.com/lookup?id=909253,252013914,294298906"
# 查询艺术家及其专辑
curl "https://itunes.apple.com/lookup?id=909253&entity=album&limit=5"
# 查询艺术家及其歌曲
curl "https://itunes.apple.com/lookup?id=909253&entity=song&limit=10"
# 按 AMG 艺术家 ID 查询
curl "https://itunes.apple.com/lookup?amgArtistId=468749&entity=album&limit=5"
# 按 ISBN 查询图书
curl "https://itunes.apple.com/lookup?isbn=9780316069359&country=US"
# 按 UPC 查询
curl "https://itunes.apple.com/lookup?upc=074646139324&country=US"
GET https://itunes.apple.com/WebObjects/MZStoreServices.woa/ws/genres
获取所有分类及其子分类的层级结构。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | number | 否 | 媒体类型 ID,获取特定媒体的分类 |
| 值 | 媒体 |
|---|---|
| 20 | Music |
| 22 | Podcasts |
| 23 | iBooks |
| 24 | Podcasts (旧) |
| 26 | Podcasts |
| 27 | iBooks |
| 28 | iBooks |
| 33 | Movies |
| 36 | Software (Apps) |
| 0 | 全部 (根节点) |
# 获取所有分类
curl "https://itunes.apple.com/WebObjects/MZStoreServices.woa/ws/genres"
# 获取音乐分类
curl "https://itunes.apple.com/WebObjects/MZStoreServices.woa/ws/genres?id=20"
# 获取应用分类
curl "https://itunes.apple.com/WebObjects/MZStoreServices.woa/ws/genres?id=36"
GET https://rss.itunes.apple.com/api/v1/{country}/{media}/{feed}/{genre}/{limit}/{format}
获取各类排行榜数据。
| 参数 | 说明 | 示例 |
|---|---|---|
| country | 两位国家代码 | us、cn |
| media | 媒体类型 | apple-music、itunes-music、podcasts、apps、books、movies |
| feed | 排行榜类型 | 见下表 |
| genre | 分类 ID 或 all | all、1、21 等 |
| limit | 返回数量,最大 200 | 10、50、100 |
| format | 返回格式 | json、jsonp |
apple-music / itunes-music:
top-albums, top-songs, top-music-videos, new-releases, hot-tracks
podcasts:
top-podcasts, top-episodes
apps:
top-free-apps, top-paid-apps, top-grossing-apps, new-apps-we-love, top-free-iPad-apps, top-paid-iPad-apps
books:
top-free-books, top-paid-books
movies:
top-movies, top-rentals
# Apple Music 热门歌曲
curl "https://rss.itunes.apple.com/api/v1/us/apple-music/top-songs/all/10/json"
# 热门免费应用
curl "https://rss.itunes.apple.com/api/v1/us/apps/top-free-apps/all/25/json"
# 热门播客
curl "https://rss.itunes.apple.com/api/v1/us/podcasts/top-podcasts/all/10/json"
# 中国区 Apple Music 热门专辑
curl "https://rss.itunes.apple.com/api/v1/cn/apple-music/top-albums/all/10/json"
# 特定分类的热门歌曲 (Pop = 14)
curl "https://rss.itunes.apple.com/api/v1/us/apple-music/top-songs/14/10/json"
{
"resultCount": 1,
"results": [
{
"wrapperType": "track",
"kind": "song",
"artistId": 909253,
"collectionId": 1488095359,
"trackId": 1488095629,
"artistName": "Artist Name",
"collectionName": "Album Name",
"trackName": "Song Title",
"collectionCensoredName": "Album Name",
"trackCensoredName": "Song Title",
"artistViewUrl": "https://music.apple.com/us/artist/...",
"collectionViewUrl": "https://music.apple.com/us/album/...",
"trackViewUrl": "https://music.apple.com/us/song/...",
"previewUrl": "https://audio-ssl.itunes.apple.com/...",
"artworkUrl30": "https://is1-ssl.mzstatic.com/.../30x30bb.jpg",
"artworkUrl60": "https://is1-ssl.mzstatic.com/.../60x60bb.jpg",
"artworkUrl100": "https://is1-ssl.mzstatic.com/.../100x100bb.jpg",
"releaseDate": "2020-01-01T08:00:00Z",
"collectionExplicitness": "notExplicit",
"trackExplicitness": "notExplicit",
"discCount": 1,
"discNumber": 1,
"trackCount": 12,
"trackNumber": 1,
"trackTimeMillis": 234000,
"country": "USA",
"currency": "USD",
"primaryGenreName": "Pop",
"isStreamable": true,
"collectionArtistId": 909253,
"collectionArtistName": "Artist Name"
}
]
}
| 字段 | 说明 |
|---|---|
wrapperType | 结果类型: track, collection, artist, audiobook |
kind | 子类型: song, feature-movie, podcast, software 等 |
trackId | 曲目/项目唯一 ID |
collectionId | 专辑/合集 ID |
artistId | 艺术家 ID |
trackName | 曲目名称 |
collectionName | 专辑名称 |
artistName | 艺术家名称 |
artworkUrl30/60/100 | 封面图 URL (不同尺寸) |
previewUrl | 30 秒预览 URL |
trackPrice | 曲目价格 |
collectionPrice | 专辑价格 |
releaseDate | 发行日期 (ISO 8601) |
trackTimeMillis | 曲目时长 (毫秒) |
primaryGenreName | 主要分类 |
isStreamable | 是否可在 Apple Music 流播放 |
trackViewUrl | iTunes Store 链接 |
country | 商店国家 |
currency | 货币代码 |
track (歌曲/视频):
trackNumber, trackCount, discNumber, discCount, trackTimeMillis, previewUrl, isStreamable
collection (专辑):
collectionPrice, collectionExplicitness, copyright, contentAdvisoryRating
artist (艺术家):
artistLinkUrl, primaryGenreName, artistType
software (应用):
averageUserRating, userRatingCount, sellerName, fileSizeBytes, minimumOsVersion, screenshotUrls, ipadScreenshotUrls
API 返回的封面 URL 默认为小尺寸,替换尺寸参数即可获得更大图片:
// 原始 URL
const url100 = "https://is1-ssl.mzstatic.com/image/thumb/.../100x100bb.jpg";
// 替换为 600x600 高清
const url600 = url100.replace("100x100bb", "600x600bb");
| 尺寸 | URL 后缀 |
|---|---|
| 30x30 | 30x30bb |
| 60x60 | 60x60bb |
| 100x100 | 100x100bb |
| 200x200 | 200x200bb |
| 300x300 | 300x300bb |
| 600x600 | 600x600bb (推荐) |
| 1200x1200 | 1200x1200bb (非官方,部分内容可用) |
在搜索或查询 URL 中追加 at 参数可追踪推广来源:
https://itunes.apple.com/search?term=beatles&at=10l4d7
使用 limit + offset 实现分页:
第 1 页: limit=25&offset=0
第 2 页: limit=25&offset=25
第 3 页: limit=25&offset=50
最大 limit 为 200。
搜索词必须进行 URL 编码,空格编码为 + 或 %20:
# 正确
term=queen+bohemian+rhapsody
term=queen%20bohemian%20rhapsody
# 错误
term=queen bohemian rhapsody
import urllib.parse
import urllib.request
import json
from typing import Any
BASE_URL = "https://itunes.apple.com"
def search(
term: str,
*,
media: str | None = None,
entity: str | None = None,
limit: int = 25,
country: str = "US",
lang: str | None = None,
) -> dict[str, Any]:
params: dict[str, str | int] = {"term": term, "limit": limit, "country": country}
if media:
params["media"] = media
if entity:
params["entity"] = entity
if lang:
params["lang"] = lang
url = f"{BASE_URL}/search?{urllib.parse.urlencode(params)}"
with urllib.request.urlopen(url) as resp:
return json.loads(resp.read())
def lookup(
id: str | None = None,
*,
amg_artist_id: str | None = None,
entity: str | None = None,
limit: int = 25,
country: str = "US",
) -> dict[str, Any]:
params: dict[str, str | int] = {"limit": limit, "country": country}
if id:
params["id"] = id
elif amg_artist_id:
params["amgArtistId"] = amg_artist_id
if entity:
params["entity"] = entity
url = f"{BASE_URL}/lookup?{urllib.parse.urlencode(params)}"
with urllib.request.urlopen(url) as resp:
return json.loads(resp.read())
def get_artwork_url(url_100: str, size: int = 600) -> str:
return url_100.replace("100x100bb", f"{size}x{size}bb")
# 使用示例
result = search("Taylor Swift", media="music", entity="song", limit=5)
for track in result.get("results", []):
print(f"{track['trackName']} - {track['artistName']}")
print(f" 封面: {get_artwork_url(track['artworkUrl100'])}")
print(f" 时长: {track['trackTimeMillis'] / 1000:.1f}s")
const BASE_URL = "https://itunes.apple.com";
interface SearchParams {
term: string;
media?: string;
entity?: string;
limit?: number;
country?: string;
lang?: string;
offset?: number;
}
async function search(params: SearchParams) {
const url = new URL(`${BASE_URL}/search`);
Object.entries(params).forEach(([key, value]) => {
if (value !== undefined) url.searchParams.set(key, String(value));
});
const resp = await fetch(url);
return resp.json();
}
function getArtworkUrl(url100: string, size: number = 600): string {
return url100.replace("100x100bb", `${size}x${size}bb`);
}
// 使用示例
const result = await search({
term: "Radiohead",
media: "music",
entity: "album",
limit: 5,
});
console.log(result.results);
| 场景 | 推荐方法 |
|---|---|
| 搜索歌曲 | /search?media=music&entity=song |
| 搜索专辑 | /search?media=music&entity=album |
| 搜索艺术家 | /search?media=music&entity=musicArtist |
| 搜索应用 | /search?entity=software |
| 搜索播客 | /search?entity=podcast |
| 获取专辑曲目 | /lookup?id={albumId}&entity=song |
| 获取艺术家专辑 | /lookup?id={artistId}&entity=album |
| 批量查询 | /lookup?id=id1,id2,id3 |
| 获取排行榜 | RSS Feed Generator |
| 获取分类 | Genre API |
| 获取高清封面 | 替换 artworkUrl 中的尺寸参数 |
limit 参数最大值为 200country 参数影响返回的价格、可用性、分类等数据id 参数支持逗号分隔的批量 ID,最多 200 个entity 参数必须与 media 参数兼容,不兼容的组合会返回空结果isStreamable 字段表示内容是否在 Apple Music 上可流播放format 参数仅支持 json 和 jsonpWhat SKILL.md sets; muted values are Claude Code's defaults
/hocgin-game-dev-skills:apple-itunes-apifrom game-dev-skills
Claude Code refuses to install this plugin
Claude Code refuses to add this marketplace: The name 'agent-skills' is reserved for official Anthropic marketplaces and can only be used with GitHub sources from the 'anthropics' organization.
Claude Code refuses to add this marketplace: The name 'agent-skills' is reserved for official Anthropic marketplaces and can only be used with GitHub sources from the 'anthropics' organization.
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
38 skills in this plugin
/appicon-design从一张或多张 App Icon 案例图中提取设计语言(配色角色、造型语言、材质、光影、质感、细节密度),剥离参考图自身的主体 / 角色 / 布局等 IP,保存为可命名、可复用的「风格主题模板」(设计 DNA + 多版式变体 + 参考 IP 排除),再根据项目名称、类型与核心功能,按指定风格或自动匹配风格,生成原创、不撞脸参考图、符合 iOS App Icon 规范、可直接用于 GPT-Image / Midjourney / SD 等模型的完整提示词(主体描述 + 风格约束 + 版式 + 原创性约束 + 负面约束)。当用户需要设计 App 图标、iOS/macOS 应用图标、备用图标(Alternate App Icon),或想把案例图片沉淀为新的 App Icon 风格时使用。/appstore-product-description按固定格式生成 App Store「产品描述」(Description)中文文案:一句话主张 + 导语 + 若干【功能块】+ 开始使用 + 收尾金句,末尾自动拼接固定的「订阅取消说明」与「隐私协议 & 服务协议」模板(协议链接由用户提供)。当用户需要撰写、改写、更新 App Store 产品描述 / 应用介绍 / 描述文案,或要为新 App 套用统一描述格式时使用。/article-tech-write科技资讯聚合类文章写作,专注于将多条科技新闻/技术动态整合为一篇结构紧凑、风格统一的综合报道Other plugins' skills for the same job