Get homepage

Introduction

POST /v1/generations with Authorization: Bearer <ANYCAP_API_KEY>. Use type=social, model for the platform and input.operation for the query. Parameters and examples follow.

PlatformQuerymodelinput.operation
InstagramUser profileinstagramprofile
InstagramPostsinstagramposts
XiaohongshuUser profilexiaohongshuuser_info
DouyinPostsdouyindouyin_user_posts

Instagram · User profile

Read a public Instagram profile by username. Send type: social, model: instagram and the username in input.

1. Look up a profile

BASH
curl -X POST https://api.anycap.io/v1/generations \  -H "Authorization: Bearer $ANYCAP_API_KEY" \  -H "Content-Type: application/json" \  -H "Idempotency-Key: 6c3c1a5e-6f43-4b2f-9c1e-1c2b3a4d5e6f" \  -d '{    "type": "social",    "model": "instagram",    "input": {      "operation": "profile",      "username": "xuezhiqian"    }  }'

input.operation is optional and defaults to profile. The username accepts letters, numbers, periods and underscores, up to 64 characters; do not include the leading @. Discovery is GET /v1/generations/models?type=social.

2. Result

A successful lookup returns HTTP 200 with type: social and call. call.profile is a bounded snapshot: platform, id, username, nickname, avatar, bio, verification and privacy flags, optional external URL/category, follower/following/post counts when reported, and, when the source returns them, up to 12 recent public posts with cover image and interaction counters. The current profile route reports counts only, so recent_posts is usually empty; absent counters stay absent, and the preview is not a paged content list.

JSON
{  "type": "social",  "call": {    "id": "6c3c1a5e-6f43-4b2f-9c1e-1c2b3a4d5e6f",    "state": "succeeded",    "operation": "profile",    "username": "xuezhiqian",    "amount_microcredits": "9000000",    "charged_microcredits": "9000000",    "created_at": "2026-10-26T10:00:00Z",    "profile": {      "platform": "instagram",      "id": "336339725",      "username": "xuezhiqian",      "nickname": "JOKER 薛之谦",      "verified": true,      "private": false,      "follower_count": 571280,      "content_count": 216,      "recent_posts": [        {          "id": "4010591197571821503",          "cover_url": "https://...",          "digg_count": 29648        }      ]    },    "completed_at": "2026-10-26T10:00:00Z",    "media_downloads": [      {        "field": "profile.recent_posts[0].cover_url",        "source_url": "https://...",        "download_url": "https://api.anycap.io/v1/social-media/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",        "expires_at": "2026-10-26T12:00:00Z",        "status": "ready"      }    ]  }}

call.media_downloads adds Anycap download links while preserving the original third-party URLs. Only status=ready entries can be downloaded without an API key. Links expire 2 hours after call.completed_at, as shown in expires_at; reading the result does not renew them.

StateHTTPMeaningAction
succeeded200The profile was normalized and the customer charge settled.Read call.profile.
started / unknown202The lookup is running or its outcome is unconfirmed; keep the same call id.Keep call.id; do not submit a new lookup. Use the original connection key with GET /v1/generations/{id} to re-read the recorded call.
error.code404 / 502 / 503A definitive lookup, upstream or configuration failure; the customer is not charged.404 profile_not_found: check the username. 503 capability_unavailable: the capability is paused or not configured. 502 upstream_error: the lookup definitively failed. The same key returns that failure; use a new key only to start a new lookup.

The same idempotency key replays the recorded result, even after the source is paused. Read results with the original connection key.

Instagram · Posts

Read one page of an Instagram account posts list by username. Send type: social, model: instagram and input.operation: posts with the username.

Request

BASH
curl -X POST https://api.anycap.io/v1/generations \  -H "Authorization: Bearer $ANYCAP_API_KEY" \  -H "Content-Type: application/json" \  -H "Idempotency-Key: 7a1e4c9d-3b62-4f80-a5d1-8c2e6b9f0a34" \  -d '{"type":"social","model":"instagram","input":{"operation":"posts","username":"instagram","count":12}}'
FieldValueNote
type
Valuesocial
NoteRequired
model
Valueinstagram
NoteRequired
input.operation
Valueposts
NoteRequired; selects one posts page
input.username
ValueInstagram username
NoteRequired; letters, numbers, periods and underscores, up to 64 characters; do not include @
input.count
Value1–20
NoteOptional; requested page size. The supplier returns its own page size (currently 12)
input.max_id
ValueNext page cursor
NoteOptional; use the previous response's next_max_id for the next page
Idempotency-Key
ValueUnique key
NoteRecommended; a new fetch uses a new key, a retry keeps the original

The connection key must be authorized for social.instagram.posts. An unauthorized key returns 503 capability_unavailable before any upstream call and is not charged. Each page is a separate execution and is charged separately.

Response

JSON
{  "type": "social",  "call": {    "id": "7a1e4c9d-3b62-4f80-a5d1-8c2e6b9f0a34",    "state": "succeeded",    "operation": "posts",    "username": "instagram",    "count": 12,    "amount_microcredits": "11000000",    "charged_microcredits": "11000000",    "created_at": "2026-10-28T03:54:20Z",    "posts": {      "items": [        {          "id": "4017275189435174347_25025320",          "shortcode": "DfAOoAXRg3L",          "media_type": "video",          "description": "An original, straight from the studio 🎶",          "cover_url": "https://instagram.fbne9-1.fna.fbcdn.net/v/...jpg",          "play_url": "https://instagram.fbne9-1.fna.fbcdn.net/v/...mp4",          "duration_ms": 22933,          "width": 720,          "height": 1280,          "created_at": 1793116773,          "author": {            "id": "25025320",            "username": "instagram",            "nickname": "Instagram"          },          "play_count": 36914700,          "digg_count": 149208,          "comment_count": 5178        }      ],      "next_max_id": "3997798548002238943_25025320",      "has_more": true    },    "completed_at": "2026-10-28T03:54:20Z",    "media_downloads": [      {        "field": "posts.items[0].cover_url",        "source_url": "https://instagram.fbne9-1.fna.fbcdn.net/v/...jpg",        "download_url": "https://api.anycap.io/v1/social-media/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",        "expires_at": "2026-10-28T05:54:20Z",        "status": "ready"      }    ]  }}

call.posts.items contains one entry per post: id, shortcode, media_type (image, video or carousel), caption, cover, ordered image_urls for carousels, play_url for video, dimensions, publish time, author and the counters Instagram returned. Missing counters, dimensions and duration are omitted. call.posts.next_max_id is opaque; pass it unchanged as input.max_id with a new idempotency key, and has_more is false when the platform did not report more posts.

call.media_downloads adds Anycap download links while preserving the original third-party URLs. Only status=ready entries can be downloaded without an API key. Links expire 2 hours after call.completed_at, as shown in expires_at; reading the result does not renew them.

Errors

HTTPBodyWhat to do
200call.state=succeededRead call.posts; charge settled.
202call.state=started / unknownKeep call.id and read GET /v1/generations/{id} with the original connection key. Do not submit a new fetch.
402error.code=insufficient_creditsAdd credits and retry. Nothing was submitted or charged.
404 / 502 / 503error.codeNo customer charge. Codes: profile_not_found, posts_not_found, upstream_error, capability_unavailable (paused, not configured, or key not authorized).

Xiaohongshu · User profile

Read a public Xiaohongshu profile by user id or share link through the Xiaohongshu app interface (app/v2/get_user_info). The result carries the nickname, avatar, bio, Xiaohongshu account number (red_id), location, verification text, follower/following/note counts, liked/collected totals and the profile share link. When both input.user_id and a link are sent, the user id wins.

Request

BASH
curl -X POST https://api.anycap.io/v1/generations \  -H "Authorization: Bearer $ANYCAP_API_KEY" \  -H "Content-Type: application/json" \  -H "Idempotency-Key: 2f9c5b1e-4d7a-4c2e-8b61-0a3d5e7f9c24" \  -d '{"type":"social","model":"xiaohongshu","input":{"operation":"user_info","user_id":"61b46d790000000010008153"}}'
FieldValueNote
type
Valuesocial
NoteRequired
model
Valuexiaohongshu
NoteRequired
input.operation
Valueuser_info
NoteRequired; selects the user route
input.user_id
Value24-character user id
NoteOptional; takes precedence over a link
input.url
ValueProfile or share link
Notexiaohongshu.com/user/profile/..., xhslink.com and xhslink.cn links
input.share_text
ValueShare link alias
NoteSame value as input.url; send only one of the two
Idempotency-Key
ValueUnique key
NoteRecommended; new key per fetch, same key on retry

Response

JSON
{  "type": "social",  "call": {    "id": "2f9c5b1e-4d7a-4c2e-8b61-0a3d5e7f9c24",    "state": "succeeded",    "operation": "user_info",    "user_id": "61b46d790000000010008153",    "amount_microcredits": "2000000",    "charged_microcredits": "2000000",    "created_at": "2026-11-02T03:10:00Z",    "user": {      "id": "61b46d790000000010008153",      "nickname": "JeremyLin林书豪",      "avatar_url": "https://sns-avatar-qc.rednotecdn.com/avatar/example.jpg",      "description": "职业篮球运动员",      "red_id": "1429907658",      "ip_location": "Beijing",      "verify_content": "运动员",      "follower_count": 194980,      "following_count": 7,      "note_count": 338,      "liked_count": 548830,      "collected_count": 48600,      "share_link": "https://www.xiaohongshu.com/user/profile/61b46d790000000010008153"    }  }}

call.user.counts are omitted when the platform does not report them. call.user_id is present when the caller sent an id; call.url is present when the caller sent a link. The data source returns its own account number as red_id; share_link is the profile link it publishes.

Validate the user id before calling. The data source answers an unknown id with a normal 200 response that carries a service-error message and still charges the lookup, so a wrong id can consume the supplier call without a customer charge.

Errors

HTTPBodyWhat to do
200call.state=succeededRead call.user; charge settled.
202call.state=started / unknownKeep call.id and read GET /v1/generations/{id} with the original connection key. Do not submit a new fetch.
402error.code=insufficient_creditsAdd credits and retry. Nothing was submitted or charged.
404 / 502 / 503error.codeNo customer charge. Codes: user_not_found, upstream_error, capability_unavailable.

Douyin · Posts

List a Douyin user's homepage posts through the Douyin app data source (app/v3/fetch_user_post_videos; the supplier reports the web route as unstable). Send input.sec_user_id, an optional input.count (1-20, default 20), an optional input.filter_type (0 default order, 3 hottest) and, after the first page, the previous page's douyin_posts.max_cursor as input.max_cursor. Each page is a separate synchronous execution with its own price.

Request

BASH
curl -X POST https://api.anycap.io/v1/generations \  -H "Authorization: Bearer $ANYCAP_API_KEY" \  -H "Content-Type: application/json" \  -H "Idempotency-Key: 3b7e9c1d-5f2a-4d8b-9c6e-1a4f7b2d8e35" \  -d '{"type":"social","model":"douyin","input":{"operation":"douyin_user_posts","sec_user_id":"MS4wLjABAAAANXSltcLCzDGmdNFI2Q_QixVTr67NiYzjKOIP5s03CAE","count":20,"filter_type":"0"}}'
FieldValueNote
type
Valuesocial
NoteRequired
model
Valuedouyin
NoteRequired
input.operation
Valuedouyin_user_posts
NoteRequired; selects the homepage posts route
input.sec_user_id
Valuesec_user_id
NoteRequired; the user id shown in the Douyin homepage URL
input.count
Value1-20
NoteOptional, default 20
input.filter_type
Value0 or 3
NoteOptional, default 0; 3 sorts by popularity
input.max_cursor
ValueOpaque cursor
NoteOptional; 0 or omitted for the first page, then the previous page's douyin_posts.max_cursor
Idempotency-Key
ValueUnique key
NoteRecommended; new key per page, same key on retry

Response

JSON
{  "type": "social",  "call": {    "id": "3b7e9c1d-5f2a-4d8b-9c6e-1a4f7b2d8e35",    "state": "succeeded",    "operation": "douyin_user_posts",    "sec_user_id": "MS4wLjABAAAANXSltcLCzDGmdNFI2Q_QixVTr67NiYzjKOIP5s03CAE",    "filter_type": "0",    "amount_microcredits": "2000000",    "charged_microcredits": "2000000",    "created_at": "2026-11-02T07:30:00Z",    "douyin_posts": {      "items": [        {          "id": "7372484719365098803",          "description": "你对我的好我一直记得",          "cover_url": "https://p3-pc-sign.douyinpic.com/example-cover.jpg",          "play_url": "https://v3-web.douyinvod.com/example-video.mp4",          "duration_ms": 8010,          "width": 1920,          "height": 1080,          "created_at": 1716540374,          "author": {            "id": "95823111667",            "username": "L99612",            "nickname": "萧萧不吃辣",            "avatar_url": "https://p3-pc.douyinpic.com/example-avatar.jpg"          },          "digg_count": 312986,          "comment_count": 4071,          "share_count": 79966,          "collect_count": 19911        }      ],      "max_cursor": "1773738949000",      "has_more": true    }  }}

call.douyin_posts.items uses the same normalized post fields as the single-video operation; call.douyin_posts.max_cursor is opaque and only valid for the same user, and has_more is false on the last page. Each page has its own call and charge; pass the cursor back to read the next page.

The public capability uses the app interface, not the web route, because the supplier marks the web route unstable. If you need the web route's own filter fields, call the supplier directly; Anycap does not silently switch routes because every attempt is billable.

Errors

HTTPBodyWhat to do
200call.state=succeededRead call.douyin_posts.items; charge settled.
202call.state=started / unknownKeep call.id and read GET /v1/generations/{id} with the original connection key. Do not submit a new fetch.
402error.code=insufficient_creditsAdd credits and retry. Nothing was submitted or charged.
404 / 502 / 503error.codeNo customer charge. Codes: posts_not_found, upstream_error, capability_unavailable.