# Spotify 专辑 API (spotify.album)

- Canonical page: [https://everyinfra.com/spotify-api/album](https://everyinfra.com/spotify-api/album?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "spotify", "action": "album", "params": {...}}
- Price: $0.001389 per call ($1.39 per 1,000 requests); failed calls and empty results are not charged
- Returns: single object
- Mode: sync; add "mode": "async" for slow tasks

Spotify 专辑接口按专辑链接 `url` 读取一张专辑的资料：名称 `name`、参与艺人 `artists`、发行日期 `release_date`、唱片公司 `label`、版权信息 `copyright`、曲目总数 `track_count` 和曲目列表 `tracks`。它回答「这张专辑是谁发的、什么时候发、里面有哪些歌」，适合整理唱片目录，或者把搜索结果里的专辑补全成完整资料。

`album_type` 区分 album、single 和 compilation，它和 `copyright` 是主页那一页没有的字段。读完专辑，可以拿 `tracks` 里的曲目和 `track_count` 对一下数。

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=spotify&action=album

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | artist / track / album / playlist 使用对应的 open.spotify.com 链接，也支持在 url 中传 spotify:类型:ID 或裸 ID；目标种类由 action 决定，不要跨类型混用。旧 profile 仅直接接收完整链接，读取专辑/单曲播放资料，不是用户个人档案。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| name | 名称。用于账号/商品/商家类能力，指该对象本身的名字。 |
| album_type | 专辑类型（album/single/compilation）。 |
| artists | 参与艺人列表。 |
| release_date | 发行日期。 |
| label | 唱片公司。 |
| copyright | 版权信息。 |
| track_count | 曲目总数。 |
| image_url | 图片链接。多图能力可能返回 image_urls 数组。 |
| tracks | 曲目列表。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "spotify",
  "action": "album",
  "params": {
    "url": "https://open.spotify.com/album/1XkGORuUX2QGOEIL4EbJKm"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "spotify",
        "action": "album",
        "params": {
            "url": "https://open.spotify.com/album/1XkGORuUX2QGOEIL4EbJKm",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-09-26T08:56:04Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "spotify",
  "action": "album",
  "results": {
    "name": "Favourite Worst Nightmare",
    "album_type": "ALBUM",
    "artists": [
      "Arctic Monkeys"
    ],
    "release_date": "2007-04-22T00:00:00Z",
    "label": "Domino Recording Co",
    "copyright": [
      "2007 Domino Recording Co Ltd"
    ],
    "track_count": 12,
    "image_url": "https://i.scdn.co/image/ab67616d0000b273b1f8da74f225fa1225cdface",
    "tracks": [
      {
        "id": "7f9I5WdyXm5q1XqnSYgQZb",
        "url": "https://open.spotify.com/track/7f9I5WdyXm5q1XqnSYgQZb",
        "name": "Brianstorm",
        "artists": [
          "Arctic Monkeys"
        ],
        "duration_ms": 172866,
        "play_count": 322905244,
        "track_number": 1,
        "disc_number": 1,
        "is_explicit": false,
        "platform": "spotify"
      },
      {
        "id": "5kxVyCgEUND7E2QKG7JmoF",
        "url": "https://open.spotify.com/track/5kxVyCgEUND7E2QKG7JmoF",
        "name": "Teddy Picker",
        "artists": [
          "Arctic Monkeys"
        ],
        "duration_ms": 165000,
        "play_count": 332863584,
        "track_number": 2,
        "disc_number": 1,
        "is_explicit": true,
        "platform": "spotify"
      },
      {
        "id": "5RrHzXKmwVd5BCq4UzyJPd",
        "url": "https://open.spotify.com/track/5RrHzXKmwVd5BCq4UzyJPd",
        "name": "D is for Dangerous",
        "artists": [
          "Arctic Monkeys"
        ],
        "duration_ms": 138106,
        "play_count": 111947199,
        "track_number": 3,
        "disc_number": 1,
        "is_explicit": false,
        "platform": "spotify"
      }
    ],
    "platform": "spotify"
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `url` 可以不用完整链接吗？

可以。除了 open.spotify.com 的链接，也支持 spotify:album:ID 这种写法和裸 ID。目标种类由接口决定：专辑接口要专辑的标识，艺人、歌曲或歌单的标识不能混用。

### `album_type` 有哪些取值？

album、single 和 compilation：正式专辑、单曲发行和合辑。整理唱片目录时，可以先按它把单曲和合辑分出来，再看 `tracks` 和 `track_count`。

### 它和主页那一页差在哪？

专辑接口多 `album_type` 和 `copyright`，主页那一页多一个记录类型字段，其余参数和字段一样。主页那一页只直接接收完整链接，读的是发行资料，不是用户个人档案。

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=spotify
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
