# Spotify 主页或对象详情 API (spotify.profile)

- Canonical page: [https://everyinfra.com/spotify-api/profile](https://everyinfra.com/spotify-api/profile?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "spotify", "action": "profile", "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`、记录类型 `type`、发行日期 `release_date`、唱片公司 `label`、参与艺人 `artists`、封面 `image_url`、曲目总数 `track_count` 和曲目列表 `tracks`。尽管叫主页，读到的不是用户个人档案，而是专辑或单曲的播放资料。它回答「这条链接指向的东西是谁发行的」，适合把链接批量转成发行信息表。

`type` 是记录类型，取值随能力而定，专辑接口没有这个字段；这个接口也没有专辑类型和版权信息。示例里的 `url` 要替换成实际专辑的完整链接。这个接口只直接接收完整链接。`id` 只在 Spotify 内唯一，别和其他平台的 ID 混用。

## Health

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

## 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 | 名称。用于账号/商品/商家类能力，指该对象本身的名字。 |
| type | 记录类型，取值随能力而定（如 video / image / text）。 |
| release_date | 发行日期。 |
| label | 唱片公司。 |
| artists | 参与艺人列表。 |
| image_url | 图片链接。多图能力可能返回 image_urls 数组。 |
| track_count | 曲目总数。 |
| 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": "profile",
  "params": {
    "url": "https://open.spotify.com/album/<ALBUM_ID>"
  }
}'
```

```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": "profile",
        "params": {
            "url": "https://open.spotify.com/album/<ALBUM_ID>",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "spotify",
  "action": "profile",
  "results": {
    "id": …,
    "url": …,
    "name": …,
    "type": …,
    "release_date": …,
    "label": …,
    "artists": …,
    "image_url": …,
    "track_count": …,
    "tracks": …,
    "platform": …
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 主页接口能读用户的个人档案吗？

不能。接口名里的主页指对象详情，实际读取的是专辑或单曲的发行资料，不是用户个人档案。示例也要求换成实际专辑的完整链接。

### 什么时候用主页接口，什么时候用专辑接口？

手里的链接明确是专辑、并且要专辑类型和版权信息时，用专辑接口。要记录类型 `type`，或者链接可能指向专辑，也可能指向单曲时，用主页接口。两边都只有一个 `url` 参数，但能接受的写法不同，其余字段基本一致。

### `url` 能传 spotify URI 或裸 ID 吗？

这里不行，主页接口只直接接收完整的 open.spotify.com 链接。专辑接口才可以写成 spotify:album:ID 这种形式或者裸 ID。

## 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
