获取完整推文串 (Thread)
根据单条推文 ID 一键拉取该推文所在的完整作者连环推文串(Thread),按序复原长篇内容。
返回 API 接口列表
/Tweets Endpoints
POST
/twitter/tweets/thread_by_idAPI 鉴权
AuthorizationBearer token · header必填TwexAPI 平台的全局身份凭据 (Bearer Token)。所有接口调用均需在 Header 中携带:Authorization: Bearer <YOUR_TWEXAPI_KEY>。可在 TwexAPI 用户控制台获取。
请求体
必填application/jsontweet_idstring必填推文唯一数字 ID
max_itemsinteger返回的推文串中推文的最大数量上限
min 1 · max 200 · default: 40
fieldsstring[] | any指定返回推文对象中的字段白名单;若省略则返回全量字段。
展开属性折叠属性
Any of:
string[]
Array of
stringstringany
any响应结果
200推文串中按发布顺序排列的全部推文对象列表。
any422请求参数校验错误
detailValidationError[]展开属性折叠属性
Array of
ValidationErrorlocstring | integer[]必填展开属性折叠属性
Array of
string | integerAny of:
string
stringinteger
integermsgstring必填响应提示信息(例如 'success')
typestring必填inputanyctxobject⚡交互式测试POST
⚡交互式测试 / Try APIPOSTLive Console
🌐目标服务器:
https://api.twexapi.io● 生产环境就绪
🔍
公开数据读取(仅需 TwexAPI 平台密钥,无需 Twitter Cookie)
本接口为公开推特数据检索/查询,无需任何推特账号或 Cookie!仅需在下方「API 鉴权」中输入您的 TwexAPI 平台密钥 (Bearer Token) 即可直接发起测试。
🔑API 鉴权
📝请求体application/json
📡
暂无响应数据
请在「请求配置」中确认参数后,点击底部的「发送请求」按钮。
请求示例
curl -X POST "https://api.twexapi.io/twitter/tweets/thread_by_id" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"tweet_id": "string",
"max_items": 40,
"fields": [
"string"
]
}'const response = await fetch("https://api.twexapi.io/twitter/tweets/thread_by_id", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"tweet_id": "string",
"max_items": 40,
"fields": [
"string"
]
})
});import requests
response = requests.post(
"https://api.twexapi.io/twitter/tweets/thread_by_id",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"tweet_id": "string",
"max_items": 40,
"fields": [
"string"
]
},
)响应示例
推文串中按发布顺序排列的全部推文对象列表。
{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}