# Flickr 用户内容 API (flickr.user_posts)

- Canonical page: [https://everyinfra.com/flickr-api/user_posts](https://everyinfra.com/flickr-api/user_posts?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "flickr", "action": "user_posts", "params": {...}}
- Price: $0.024 per call ($24 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 10, max 50 per call
- Mode: sync; add "mode": "async" for slow tasks

Flickr 用户内容按 `user_id` 列出一位用户发布的照片和视频，每条带标题、图片链接、媒体类型、标签、作者名、拍摄时间和上传时间。它回答「这位摄影师发过什么、拍的是什么」，适合在搜索里找到有意思的作者之后，把他的作品逐一看完，或者按上传时间跟进他的更新。

`user_id` 要用 Flickr 的 NSID，形如 12345678@N04，可以从关键词搜索结果的作者 ID 取；昵称、个人主页短名和整条链接都不行。这一页默认的媒体范围是全部，默认按上传时间从新到旧排序。每次默认返回 10 条，上限 50 条。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| user_id | not declared | yes | not declared | Flickr 用户 NSID，例如 12345678@N04，可从搜索结果的 author_id 获取；不是显示昵称、个人主页短名或整条 URL。 |
| author_id | not declared | no | not declared | user_id 的低优先级兼容输入，值同样须为 Flickr NSID（形如 12345678@N04，可从搜索结果的 author_id 取得），不是可读用户名。公开 user_posts 请求仍须提供 user_id，且 user_id 会优先于 author_id。 |
| media_type | not declared | no | not declared | 媒体范围：photos 仅照片、videos 仅视频、all 全部。search 默认 photos，user_posts 默认 all；这个参数不表示是否下载原始文件。 |
| sort | not declared | no | not declared | 照片/视频排序：relevance 相关度；interestingness-desc / interestingness-asc 趣味度从高到低/从低到高；date-posted-desc / date-posted-asc 上传时间从新到旧/从旧到新；date-taken-desc / date-taken-asc 拍摄时间从新到旧/从旧到新。search 默认 relevance，user_posts 默认 date-posted-desc；拍摄与上传日期不能混用。 |
| username | not declared | no | not declared | user_id 的兼容输入，同样要传 Flickr NSID，而不是可读用户名；公开 user_posts 请求仍需包含必填 user_id。 |
| limit | integer (1–50) | no | 10 | 这次调用最多返回的条数，整数，1–50；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| image_url | 图片链接。多图能力可能返回 image_urls 数组。 |
| media_type | 媒体类型（照片/视频）。 |
| author_name | 作者昵称（显示名）。 |
| author_id | 作者在原平台的唯一 ID。 |
| tags | 标签数组。无标签时为空数组，不是 null。 |
| taken_at | 拍摄时间，来自照片 EXIF，**与上传时间不同**，可能为 null。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| 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": "flickr",
  "action": "user_posts",
  "params": {
    "user_id": "35067687@N04"
  }
}'
```

```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": "flickr",
        "action": "user_posts",
        "params": {
            "user_id": "35067687@N04",
        },
    },
    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; the list keeps the first 2 of 10. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "flickr",
  "action": "user_posts",
  "results": [
    {
      "id": "•••",
      "url": "https://www.flickr.com/photos/nasahqphoto/55541281672/",
      "title": "Republic of Albania Signs Artemis Accords (NHQ202609210012)",
      "image_url": "https://live.staticflickr.com/65535/55541281672_37da73d6be_b.jpg",
      "media_type": "image",
      "author_name": "•••",
      "author_id": "35067687@N04",
      "tags": [
        "albania",
        "ferithoxha",
        "connortomlinson"
      ],
      "taken_at": "2026-09-21T12:14:24-08:00",
      "posted_at": "2026-09-21T17:12:35+00:00",
      "platform": "flickr"
    },
    {
      "id": "•••",
      "url": "https://www.flickr.com/photos/nasahqphoto/55542695765/",
      "title": "Republic of Albania Signs Artemis Accords (NHQ202609210011)",
      "image_url": "https://live.staticflickr.com/65535/55542695765_4a1300f6c6_b.jpg",
      "media_type": "image",
      "author_name": "•••",
      "author_id": "35067687@N04",
      "tags": [
        "albania",
        "marywjacksonnasaheadquartersbuilding",
        "nasadeputyaministrator"
      ],
      "taken_at": "2026-09-21T12:13:46-08:00",
      "posted_at": "2026-09-21T17:12:21+00:00",
      "platform": "flickr"
    }
  ],
  "count": 10,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `user_id` 能填用户名吗？

不能。要填 Flickr 的用户 NSID，例如 12345678@N04，它可以从搜索结果的作者 ID 里拿到，示例里的 NSID 是 35067687@N04。`username` 这个参数名看着像昵称，其实也只收 NSID，不是可读的用户名。

### `user_id`、`author_id`、`username` 同时传会怎样？

`user_id` 是公开的必填参数，优先级最高；`author_id` 和 `username` 只是兼容写法，同样只收 NSID，同时出现时以 `user_id` 为准。所以请求里始终要带 `user_id`。

### 怎么按时间顺序读一个人的作品？

默认按上传时间从新到旧，也可以改成从旧到新，或者按拍摄时间排。`taken_at` 来自 EXIF，可能为 null，所以按拍摄时间排序前要想好没有拍摄时间的照片怎么处理；上传时间和拍摄时间的排序不能混用。`tags` 是标签数组，没有标签时是空数组，不是 null。

## Also

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