Twitter / X Tweet API
Read a public tweet by ID or full X / Twitter status URL, including author and available media.
Read a public tweet by ID or full X / Twitter status URL, including author and available media.
Open product page and API TesterEndpoint and authentication
POST https://api.goanyapi.com/api/v1/twitter/tweet/detailResults return synchronously, without tasks or polling. Authenticate using Authorization: Bearer YOUR_API_KEY and send a JSON request body. There are no Path or Query parameters.
Input parameters
| Parameter | Location | Type | Required | Default | Constraints and meaning |
|---|---|---|---|---|---|
| Authorization | Header | string | Yes | — | Bearer YOUR_API_KEY |
| Content-Type | Header | string | Yes | application/json | application/json |
| url | JSON body | string | Yes | — | Tweet numeric ID or full https://x.com/<user>/status/<id> / https://twitter.com/<user>/status/<id> URL. URL parsing is local and adds no separate charge. Short links and other resource types are unsupported. maxLength=2048 |
Use the same resource parameter for a raw identifier or supported full resource URL; no prerequisite ID lookup is needed. URL parsing adds no request or separate charge. Short links and other resource types are unsupported.
Tweet numeric ID or full https://x.com/<user>/status/<id> / https://twitter.com/<user>/status/<id> URL. URL parsing is local and adds no separate charge. Short links and other resource types are unsupported.
Request example
POST /api/v1/twitter/tweet/detail
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"url": "https://x.com/ChineseWSJ/status/2121105805487305093"
}Output fields
Success returns HTTP 200. Business results are in data.result. Null, empty strings, empty arrays and missing business fields are preserved; zero is a valid statistic. Empty display fields do not invalidate an otherwise successful request.
| Field | Type | Meaning |
|---|---|---|
| code | string | ok on success; error code otherwise |
| message | string | Status message |
| data.result | object / null | Business data; null is preserved |
| data.creditsUsed | integer | Credits charged using current configuration |
| data.remainingCredits | number | Balance after settlement |
| data.result.author | object | Public business field; may be null, empty or absent |
| data.result.author.name | string | Public business field; may be null, empty or absent |
| data.result.author.screen_name | string | Public business field; may be null, empty or absent |
| data.result.author.id | string | Public business field; may be null, empty or absent |
| data.result.url | string | Public business field; may be null, empty or absent |
| data.result.created_at | string | Public business field; may be null, empty or absent |
| data.result.views | string | Public business field; may be null, empty or absent |
| data.result.text | string | Public business field; may be null, empty or absent |
| data.result.counts | object | Public business field; may be null, empty or absent |
| data.result.counts.bookmark_count | integer | Public business field; may be null, empty or absent |
| data.result.counts.favorite_count | integer | Public business field; may be null, empty or absent |
| data.result.counts.quote_count | integer | Public business field; may be null, empty or absent |
| data.result.counts.retweet_count | integer | Public business field; may be null, empty or absent |
| data.result.counts.reply_count | integer | Public business field; may be null, empty or absent |
| data.result.card | object | Public business field; may be null, empty or absent |
| data.result.card.name | string | Public business field; may be null, empty or absent |
| data.result.card.title | string | Public business field; may be null, empty or absent |
| data.result.card.image | object | Public business field; may be null, empty or absent |
| data.result.card.image.alt | string | Public business field; may be null, empty or absent |
| data.result.card.image.url | string | Public business field; may be null, empty or absent |
| data.result.card.image.width | integer | Public business field; may be null, empty or absent |
| data.result.card.image.height | integer | Public business field; may be null, empty or absent |
| data.result.card.url | string | Public business field; may be null, empty or absent |
| data.result.card.domain | string | Public business field; may be null, empty or absent |
| data.result.card.description | string | Public business field; may be null, empty or absent |
| data.result.quoted | null (observed) | Public business field; may be null, empty or absent |
| data.result.media | array | Public business field; may be null, empty or absent |
| data.result.media[].type | string | Public business field; may be null, empty or absent |
| data.result.media[].url | string | Public business field; may be null, empty or absent |
| data.result.media[].expanded_url | string | Public business field; may be null, empty or absent |
| data.result.media[].alt | string | Public business field; may be null, empty or absent |
| data.result.media[].video_info | string | Public business field; may be null, empty or absent |
| data.result.lang | string | Public business field; may be null, empty or absent |
| data.result.links | array | Public business field; may be null, empty or absent |
| data.result.links[].display | null (observed) | Public business field; may be null, empty or absent |
| data.result.links[].tco | null (observed) | Public business field; may be null, empty or absent |
| data.result.links[].expanded | string | Public business field; may be null, empty or absent |
| data.result.id | string | Public business field; may be null, empty or absent |
This endpoint has no pagination parameters.
Real response example
Saved from a real successful response with public business fields. The example omits live data.creditsUsed and data.remainingCredits, which use current configuration and account balance. No list records are omitted. Media URLs may expire. Displaying the example sends no request or charge.
{
"code": "ok",
"message": "ok",
"data": {
"result": {
"id": "2121105805487305093",
"url": "https://x.com/ChineseWSJ/status/2121105805487305093",
"author": {
"name": "华尔街日报中文网",
"screen_name": "ChineseWSJ",
"id": "46574977"
},
"created_at": "2026-11-13T05:00:06.000Z",
"lang": "zh",
"text": "#独家 美国官员称,一名在英国因涉嫌为俄罗斯从事间谍活动而被捕的美国陆军军官是在一次诱捕行动中落网的,预计将于周日或下周一被起诉。https://t.co/1YOCR4oosu",
"counts": {
"bookmark_count": 2,
"favorite_count": 11,
"quote_count": 0,
"reply_count": 1,
"retweet_count": 0
},
"views": "14560",
"media": [],
"card": {
"name": "summary_large_image",
"url": "https://t.co/1YOCR4oosu",
"domain": "cn.wsj.com",
"title": "在英国被捕的美国军官系在诱捕行动中落网",
"description": "美国官员称,泰纳曾在不知情的情况下与英国有关部门交谈,其动机尚不清楚。",
"image": {
"url": "https://pbs.twimg.com/card_img/2120974225313832960/ogy4TJak?format=jpg&name=orig",
"width": 1280,
"height": 640,
"alt": "在英国被捕的美国军官系在诱捕行动中落网"
}
},
"links": [
{
"tco": null,
"expanded": "https://cn.wsj.com/articles/WP-WSJS-0004061648",
"display": null
}
],
"quoted": null
}
}
}Billing
With the current configuration, each successful request costs 1 credit.
Every successful request, including empty results, is settled at the current database-configured rate. Failures are free. Sufficient balance is required before querying; insufficient balance during concurrent settlement returns 402 without delivering unsettled results. URL parsing adds no separate charge.
Status codes and errors
| HTTP | Meaning |
|---|---|
| 200 | Success, including empty results |
| 400 | Invalid JSON or parameters |
| 401 | Invalid authentication |
| 402 | Insufficient credits |
| 429 | Rate limit; wait for Retry-After |
| 502 | Data request failed |
| 503 | API or pricing not configured |
{"code":"invalid_params","message":"Invalid parameter"}