# VK 用户内容 API (vk.user_posts)

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

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| username | not declared | yes | not declared | user_posts 的公开个人或社区标识，可用短名、club数字ID、数字 owner ID 或 vk.com 主页/wall 链接；不是只接受个人用户昵称。 |
| limit | integer (1–100) | no | 20 | 这次调用最多返回的条数，整数，1–100；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| comment_count | 评论数。null 表示不公开，不等于 0。 |
| repost_count | 转发数（区别于引用转发）。null 表示不公开。 |
| view_count | 浏览/播放数。null 表示不公开，不等于 0。 |
| media_urls | 媒体文件链接。 |
| author_id | 作者在原平台的唯一 ID。 |
| author_name | 作者昵称（显示名）。 |
| author_type | 作者类型（个人/社群）。VK 的内容可由社群发布。 |
| author_url | 作者在原平台的主页链接。 |
| author_avatar | 作者头像。 |
| 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": "vk",
  "action": "user_posts",
  "params": {
    "username": "durov"
  }
}'
```

```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": "vk",
        "action": "user_posts",
        "params": {
            "username": "durov",
        },
    },
    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 20. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "vk",
  "action": "user_posts",
  "results": [
    {
      "id": "1_2442097",
      "url": "https://vk.com/wall1_2442097",
      "text": "Иногда говорят, что Telegram был заблокирован в России, так как “закон есть закон”. Однако Telegram заблокирован в России как раз вопреки главному закону страны – Конституции. Решения судов и законы, противоречащие Конституции, не имеют силы. А это значит, что и сама блокировка T…",
      "posted_at": "2018-05-08T18:59:24+00:00",
      "like_count": 243626,
      "comment_count": 0,
      "repost_count": 14907,
      "view_count": 15921246,
      "author_id": 0,
      "author_name": "•••",
      "author_type": "profile",
      "author_url": "https://vk.com/•••",
      "author_avatar": "https://sun9-20.userapi.com/•••",
      "platform": "vk"
    },
    {
      "id": "1_2431591",
      "url": "https://vk.com/wall1_2431591",
      "text": "Михаил Светов, организатор прошедшего митинга за свободу интернета, объявил конкурс на наиболее вдохновляющую обработку видеоматериалов с митинга. Призовой фонд – 1 биткоин.\n\n#digitalresistance",
      "posted_at": "2018-05-03T13:05:53+00:00",
      "like_count": 26379,
      "comment_count": 0,
      "repost_count": 5692,
      "view_count": 9853539,
      "media_urls": [
        "https://vk.com/video1_456239033"
      ],
      "author_id": 0,
      "author_name": "•••",
      "author_type": "profile",
      "author_url": "https://vk.com/•••",
      "author_avatar": "https://sun9-20.userapi.com/•••",
      "platform": "vk"
    }
  ],
  "count": 20,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

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