> ## Documentation Index
> Fetch the complete documentation index at: https://getanyapi.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Twitter Tweet

> Sell twitter.tweet on AnyAPI: the request your endpoint receives, the response it must return, and what the real-request check judges.

Fetch a single Twitter/X tweet by URL with its full text and engagement counts (likes, retweets, replies, quotes, bookmarks, views).

This page is the seller-facing summary of one catalog API, `twitter.tweet`. The transport rules that apply to every API a seller serves - signed requests, the response envelope, timeouts, and body limits - are on [the operator endpoint contract](https://getanyapi.com/docs/sell/operator-endpoint-contract.md).

## The price you compete with

AnyAPI publishes this API from **\$0.22 per 1,000 requests**. That is the price a buyer sees today, so it is the price your endpoint has to come in under to win traffic.

## The request your endpoint receives

| Field | Type | Required | What it means |
| - | - | - | - |
| `requireFields` | array | no | Optional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example `videoUrl` or `width`, and it is served only by a source that returns every one of them. Fields you do not name are still returned whenever the serving source has them. This can raise your price: when the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. A named field can still be absent on a tweet that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge. |
| `url` | string | yes | Canonical x.com or twitter.com status URL with a numeric tweet ID, including /i/web/status and media-share variants. |

> [accordion] Full input JSON Schema
>
> ```json theme={"dark"}
> {
>   "$schema": "https://json-schema.org/draft/2020-12/schema",
>   "$id": "https://getanyapi.com/schemas/twitter.tweet.input.json",
>   "example": {
>     "url": "https://x.com/SpaceX/status/1732824684683784516"
>   },
>   "title": "Twitter tweet input",
>   "type": "object",
>   "additionalProperties": false,
>   "required": [
>     "url"
>   ],
>   "properties": {
>     "url": {
>       "type": "string",
>       "pattern": "^https?://(?:(?:www|mobile)\\.)?(?:x\\.com|twitter\\.com)/(?:[A-Za-z0-9_]+|i/web)/status/[0-9]+(?:/(?:photo|video)/[0-9]+)?/?(?:[?#].*)?$",
>       "description": "Canonical x.com or twitter.com status URL with a numeric tweet ID, including /i/web/status and media-share variants."
>     },
>     "requireFields": {
>       "type": "array",
>       "uniqueItems": true,
>       "items": {
>         "type": "string",
>         "enum": [
>           "height",
>           "videoUrl",
>           "width"
>         ]
>       },
>       "description": "Optional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example `videoUrl` or `width`, and it is served only by a source that returns every one of them. Fields you do not name are still returned whenever the serving source has them. This can raise your price: when the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. A named field can still be absent on a tweet that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge."
>     }
>   }
> }
> ```

## The response your endpoint must return

| Field | Type | Always present | What it means |
| - | - | - | - |
| `data` | null or object | yes | |
| `data.authorHandle` | string | no | Handle of the account that posted. |
| `data.authorId` | string | yes | |
| `data.authorImage` | string | no | Avatar image URL of the account that posted. |
| `data.authorName` | string | no | Display name of the account that posted. |
| `data.authorVerified` | boolean | no | Whether the posting account carries an X blue verification badge. |
| `data.bookmarks` | integer | yes | |
| `data.conversationId` | string | no | Id of the conversation the post belongs to, as a string. |
| `data.createdUtc` | number | yes | UTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds. |
| `data.id` | string | yes | |
| `data.inReplyToId` | string or null | no | Id of the post this post directly replies to, as a string, or null when the post is not a reply. |
| `data.lang` | string | no | Two-letter language code X detected for the post. |
| `data.likes` | integer | yes | |
| `data.media` | array | no | Photo, video, and GIF attachments on the post. Empty when the post has none. |
| `data.media[].height` | integer | no | Pixel height of the media item, when the lane reports it. |
| `data.media[].type` | string | yes | One of photo, video, or gif. |
| `data.media[].url` | string | yes | Image URL. For a video or GIF this is the poster/thumbnail frame. X media URLs on pbs.twimg.com are publicly fetchable without authentication; append ?name=orig for the full-resolution original. |
| `data.media[].videoUrl` | string | no | Playable video file URL. Present only for video and gif items. |
| `data.media[].width` | integer | no | Pixel width of the media item, when the lane reports it. |
| `data.quotes` | integer | yes | |
| `data.replies` | integer | yes | |
| `data.retweets` | integer | yes | |
| `data.text` | string | yes | |
| `data.views` | integer or null | yes | View count, or null when X does not report one for this tweet. Distinct from 0, which means the tweet has no views. |
| `found` | boolean | yes | |

Extra fields are kept, missing declared fields fail.

> [accordion] Full output JSON Schema
>
> ```json theme={"dark"}
> {
>   "$schema": "https://json-schema.org/draft/2020-12/schema",
>   "$id": "https://getanyapi.com/schemas/twitter.tweet.output.json",
>   "title": "Twitter tweet output",
>   "x-anyapi-result-list": false,
>   "type": "object",
>   "additionalProperties": false,
>   "required": [
>     "found",
>     "data"
>   ],
>   "properties": {
>     "found": {
>       "type": "boolean"
>     },
>     "data": {
>       "oneOf": [
>         {
>           "type": "null"
>         },
>         {
>           "type": "object",
>           "required": [
>             "id",
>             "text",
>             "authorId",
>             "likes",
>             "retweets",
>             "replies",
>             "quotes",
>             "bookmarks",
>             "views",
>             "createdUtc"
>           ],
>           "properties": {
>             "id": {
>               "x-anyapi-must-populate": true,
>               "type": "string"
>             },
>             "text": {
>               "x-anyapi-must-populate": true,
>               "type": "string"
>             },
>             "authorId": {
>               "x-anyapi-must-populate": true,
>               "type": "string"
>             },
>             "likes": {
>               "type": "integer"
>             },
>             "retweets": {
>               "type": "integer"
>             },
>             "replies": {
>               "type": "integer"
>             },
>             "quotes": {
>               "type": "integer"
>             },
>             "bookmarks": {
>               "type": "integer"
>             },
>             "views": {
>               "type": [
>                 "integer",
>                 "null"
>               ],
>               "description": "View count, or null when X does not report one for this tweet. Distinct from 0, which means the tweet has no views."
>             },
>             "createdUtc": {
>               "x-anyapi-must-populate": true,
>               "type": "number",
>               "description": "UTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds."
>             },
>             "media": {
>               "type": "array",
>               "description": "Photo, video, and GIF attachments on the post. Empty when the post has none.",
>               "items": {
>                 "type": "object",
>                 "required": [
>                   "type",
>                   "url"
>                 ],
>                 "properties": {
>                   "type": {
>                     "type": "string",
>                     "description": "One of photo, video, or gif."
>                   },
>                   "url": {
>                     "x-anyapi-domain": "twimg.com",
>                     "type": "string",
>                     "format": "uri",
>                     "description": "Image URL. For a video or GIF this is the poster/thumbnail frame. X media URLs on pbs.twimg.com are publicly fetchable without authentication; append ?name=orig for the full-resolution original."
>                   },
>                   "videoUrl": {
>                     "x-anyapi-domain": "twimg.com",
>                     "type": "string",
>                     "format": "uri",
>                     "description": "Playable video file URL. Present only for video and gif items."
>                   },
>                   "width": {
>                     "type": "integer",
>                     "description": "Pixel width of the media item, when the lane reports it."
>                   },
>                   "height": {
>                     "type": "integer",
>                     "description": "Pixel height of the media item, when the lane reports it."
>                   }
>                 }
>               }
>             },
>             "lang": {
>               "type": "string",
>               "description": "Two-letter language code X detected for the post."
>             },
>             "conversationId": {
>               "type": "string",
>               "description": "Id of the conversation the post belongs to, as a string."
>             },
>             "inReplyToId": {
>               "type": [
>                 "string",
>                 "null"
>               ],
>               "description": "Id of the post this post directly replies to, as a string, or null when the post is not a reply."
>             },
>             "authorName": {
>               "type": "string",
>               "description": "Display name of the account that posted."
>             },
>             "authorHandle": {
>               "type": "string",
>               "description": "Handle of the account that posted."
>             },
>             "authorImage": {
>               "x-anyapi-domain": "twimg.com",
>               "type": "string",
>               "description": "Avatar image URL of the account that posted."
>             },
>             "authorVerified": {
>               "type": "boolean",
>               "description": "Whether the posting account carries an X blue verification badge."
>             }
>           }
>         }
>       ]
>     }
>   }
> }
> ```

## Fields that must never come back empty

* `authorId`
* `createdUtc`
* `id`
* `text`

The repository marks these fields as ones every source must be able to fill. An empty value is only correct when the entity itself genuinely has nothing there.

## Not found, and how it differs from empty

When the entity does not exist, answer 2xx with the not-found shape:

```json theme={"dark"}
{
  "found": false,
  "data": null
}
```

An empty list is not a not-found: when the entity exists and has nothing to return, answer 2xx with `found: true` and an empty `media` array.

This output schema declares no `reason` field, so `found: false` is the whole not-found answer.

## Example request

```json theme={"dark"}
{
  "url": "https://x.com/SpaceX/status/1732824684683784516"
}
```

The registration tests send this example to your endpoint, with the API's other test inputs. After that, the real-request check sends your endpoint real past customer inputs, and an AI reviewer compares each answer with AnyAPI's own answer to the same input.

## Next

* [The operator endpoint contract](https://getanyapi.com/docs/sell/operator-endpoint-contract.md) for signing, budgets, and the real-request check.
* [Every API open to sellers](https://getanyapi.com/docs/sell/apis/index.md).
* Want to sell an API that is not on that list? Email [support@getanyapi.com](mailto:support@getanyapi.com).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.