user_idstring必填
User ID, for example: 63625256886, can be obtained from user profile API
https://api.sandbase.ai/v1/api/threads/web/user-postsReturns a list of posts from a specified Threads account. Accepts a user identifier and an optional pagination cursor to retrieve subsequent pages of data.
[
{
"data": null
}
]选择一个示例,将其输入和结果加载到 playground 中。
Returns a list of text posts from a Threads account. It needs the numeric user_id of the account and takes an optional end_cursor to fetch the next page.
curl -X POST "https://api.sandbase.ai/v1/api/threads/web/user-posts" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"user_id": "63625256886"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
user_id | string | Yes | User ID, for example: 63625256886, can be obtained from user profile API |
end_cursor | string | No | Pagination cursor (optional), used to get next page data |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"mediaData": {
"edges": [
{
"__typename": "XDTUserTextPostsResponseEdge",
"cursor": "",
"node": {
"__typename": "XDTThread",
"id": "4022095224599806479",
"thread_header_context": null,
"thread_items": [
{
"__typename": "XDTThreadItem",
"line_type": "none",
"post": {
"accessibility_caption": "How NATO states on the Black Sea are being drawn into Ukraine war escalation",
"audio": null,
"caption": {
"has_translation": null,
"pk": "18121968424969344",
"text": "How NATO states on the Black Sea are being drawn into Ukraine war escalation reu…"
},
"caption_add_on": null,
"caption_is_edited": false,
"carousel_media": null,
"code": "DfRWkv7EQIP",
"gen_ai_detection_method": {
"detection_method": "NONE"
}
},
"should_show_ephemeral_post_timer": null
}
],
"thread_type": "thread"
}
}
],
"page_info": {
"end_cursor": null,
"has_next_page": false,
"has_previous_page": false,
"start_cursor": null
}
}
}
| Field | Meaning |
|---|---|
mediaData.edges[] | One entry per thread in the account's post list. |
mediaData.edges[].node.id | ID of the thread, returned as a string. |
mediaData.edges[].node.thread_type | Type of the thread. The sample value is thread. |
mediaData.edges[].node.thread_items[].post.caption.text | Text of the post. Long text may be cut, and links appear as short URLs. |
mediaData.edges[].node.thread_items[].post.caption.pk | Numeric ID of the caption, returned as a string. |
mediaData.edges[].node.thread_items[].post.code | Short code of the post. It is the code that identifies the post on Threads. |
mediaData.edges[].node.thread_items[].post.accessibility_caption | Alt-text style description of the post. It is null when none is set. |
mediaData.edges[].node.thread_items[].post.caption_is_edited | true if the caption was edited after posting. |
mediaData.page_info.has_next_page | true if more posts are available on another page. |
mediaData.page_info.end_cursor | Cursor for the next page. It is null when there is no further page. |
user_id from Threads User Profile. The example value is 63625256886.end_cursor from mediaData.page_info as the end_cursor parameter. In the sample response it is null and has_next_page is false.$0.002 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
开始构建
具备统一身份验证和使用情况跟踪的平台 API 端点。
curl -X POST "https://api.sandbase.ai/v1/api/threads/web/user-posts" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"user_id": "example"
}'将您的 SandBase API 密钥设置到服务器环境中。请求使用 Bearer 身份验证。
export SANDBASE_API_KEY="YOUR_API_KEY"请将密钥保存在服务器端。不要在浏览器代码中暴露它。
user_idstring必填User ID, for example: 63625256886, can be obtained from user profile API
end_cursorstringPagination cursor (optional), used to get next page data
这是该 API 保存的示例响应;查看时不会发起实时请求。
[
{
"data": null
}
]探索更多
| API | 价格 | 响应 |
|---|---|---|
Threads User Posts此 API Threads | $0.002 每次调用 | JSON |
Threads | $0.002 每次调用 | JSON |
Threads | $0.002 每次调用 | JSON |
Threads | $0.003 每次调用 | JSON |
Threads | $0.002 每次调用 | JSON |
Threads | $0.002 每次调用 | JSON |
问题
向 https://api.sandbase.ai/v1/api/threads/web/user-posts 发送 POST 请求,在 Authorization 请求头中使用您的 SandBase API key(Bearer),并将参数作为 JSON 请求体传入。您也可以直接在本页的 Playground 中试用,无需编写代码。
每次调用 $0.002。每个组织在每个 UTC 日可获得 100 次免费调用,适用于包括此接口在内的所有符合条件的 SandBase APIs;超过后,每次调用将按此价格从您的 SandBase 余额中扣费。无需订阅。
必填:user_id (string)。 可选:end_cursor (string)。 Parameters 表和本页的 Playground 列出了每个字段。
在同一个 HTTP 请求中返回的 JSON 响应(同步)。 本页的 README 包含一个示例响应。
不需要。Threads User Posts 通过 SandBase 运行,因此一个 SandBase API key 即可覆盖此端点以及目录中的其他所有 API 和模型。您无需单独申请 Threads API 访问权限。