> ## 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.

# X / Twitter Post Replies

> Sell twitter.replies on AnyAPI: the request your endpoint receives, the response it must return, and what the live trial grades.

Fetch the replies to any X (Twitter) post URL as structured records: author, text, and engagement. An empty result is valid and does not assert whether the target post exists.

This page is the seller-facing summary of one catalog API, `twitter.replies`. 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.45 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 |
| - | - | - | - |
| `cursor` | string | no | Opaque pagination cursor from a previous response's nextCursor. Omit for the first page; pass it to fetch the next page of replies. |
| `limit` | integer | no | Maximum number of results to return (1-40, default 40). Per-result lanes cost less at lower limits; a backup that bills its native page may cost up to the advertised request price. |
| `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 `nextCursor`, 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. Naming a combination that no single source returns together is refused as invalid input, with no charge. On a paginated walk it applies to the first page only; later pages stay with the source that page chose, at the price it was quoted. |
| `url` | string | yes | Full URL of the X (Twitter) post to fetch replies for (e.g. [https://x.com/nasa/status/1846987139428634858](https://x.com/nasa/status/1846987139428634858)). |

> **Full input JSON Schema**
>
> ```json theme={"dark"}
> {
>   "$schema": "https://json-schema.org/draft/2020-12/schema",
>   "$id": "https://getanyapi.com/schemas/twitter.replies.input.json",
>   "example": {
>     "url": "https://x.com/jack/status/20"
>   },
>   "title": "X / Twitter post replies input",
>   "type": "object",
>   "additionalProperties": false,
>   "required": [
>     "url"
>   ],
>   "properties": {
>     "limit": {
>       "type": "integer",
>       "minimum": 1,
>       "maximum": 40,
>       "description": "Maximum number of results to return (1-40, default 40). Per-result lanes cost less at lower limits; a backup that bills its native page may cost up to the advertised request price."
>     },
>     "url": {
>       "type": "string",
>       "description": "Full URL of the X (Twitter) post to fetch replies for (e.g. https://x.com/nasa/status/1846987139428634858)."
>     },
>     "cursor": {
>       "type": "string",
>       "description": "Opaque pagination cursor from a previous response's nextCursor. Omit for the first page; pass it to fetch the next page of replies."
>     },
>     "requireFields": {
>       "type": "array",
>       "uniqueItems": true,
>       "items": {
>         "type": "string",
>         "enum": [
>           "nextCursor"
>         ]
>       },
>       "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 `nextCursor`, 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. Naming a combination that no single source returns together is refused as invalid input, with no charge. On a paginated walk it applies to the first page only; later pages stay with the source that page chose, at the price it was quoted."
>     }
>   }
> }
> ```

## The response your endpoint must return

| Field | Type | Always present | What it means |
| - | - | - | - |
| `data` | null or object | yes | |
| `data.items` | array | yes | Reply records for the requested post. |
| `data.items[].authorHandle` | string | no | Screen name / handle of the reply's author, without the @ prefix. |
| `data.items[].authorName` | string | no | Display name of the reply's author. Empty when the upstream omits it. |
| `data.items[].conversationId` | string | no | Id of the conversation the reply belongs to, as a string. |
| `data.items[].createdUtc` | number | yes | UTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds. |
| `data.items[].id` | string | yes | The reply's numeric tweet ID, as a string. |
| `data.items[].likeCount` | integer | no | Number of likes on this reply. |
| `data.items[].media` | array | no | Photo, video, and GIF attachments on the post. Empty when the post has none. |
| `data.items[].media[].height` | integer | no | Pixel height of the media item, when the lane reports it. |
| `data.items[].media[].type` | string | yes | One of photo, video, or gif. |
| `data.items[].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.items[].media[].videoUrl` | string | no | Playable video file URL. Present only for video and gif items. |
| `data.items[].media[].width` | integer | no | Pixel width of the media item, when the lane reports it. |
| `data.items[].quoteCount` | integer | no | Number of quote tweets of this reply. |
| `data.items[].replyCount` | integer | no | Number of replies to this reply. |
| `data.items[].repostCount` | integer | no | Number of reposts/retweets of this reply. |
| `data.items[].text` | string | yes | The reply's text. Empty for media-only replies with no text. |
| `data.items[].url` | string | yes | Canonical x.com URL of the reply, with tracking query params stripped. |
| `data.items[].viewCount` | integer or null | no | Number of views of this reply. Null when the source does not report it, as for posts older than X view counts. |
| `data.nextCursor` | string or null | no | Opaque cursor for the next page of replies, or null when there are no more. Pass it back as cursor to continue. |
| `found` | boolean | yes | Whether the provider returned a reply result. An empty items array is valid and may mean the post has no replies or the target could not be resolved. |

Extra fields are kept, missing declared fields fail.

> **Full output JSON Schema**
>
> ```json theme={"dark"}
> {
>   "$schema": "https://json-schema.org/draft/2020-12/schema",
>   "$id": "https://getanyapi.com/schemas/twitter.replies.output.json",
>   "title": "X / Twitter post replies output",
>   "type": "object",
>   "additionalProperties": false,
>   "required": [
>     "found",
>     "data"
>   ],
>   "properties": {
>     "found": {
>       "type": "boolean",
>       "description": "Whether the provider returned a reply result. An empty items array is valid and may mean the post has no replies or the target could not be resolved."
>     },
>     "data": {
>       "oneOf": [
>         {
>           "type": "null"
>         },
>         {
>           "type": "object",
>           "additionalProperties": false,
>           "required": [
>             "items"
>           ],
>           "properties": {
>             "items": {
>               "x-anyapi-must-populate": true,
>               "type": "array",
>               "description": "Reply records for the requested post.",
>               "items": {
>                 "type": "object",
>                 "required": [
>                   "id",
>                   "url",
>                   "text",
>                   "createdUtc"
>                 ],
>                 "properties": {
>                   "id": {
>                     "x-anyapi-must-populate": true,
>                     "type": "string",
>                     "description": "The reply's numeric tweet ID, as a string."
>                   },
>                   "url": {
>                     "x-anyapi-must-populate": true,
>                     "type": "string",
>                     "description": "Canonical x.com URL of the reply, with tracking query params stripped."
>                   },
>                   "text": {
>                     "type": "string",
>                     "description": "The reply's text. Empty for media-only replies with no text."
>                   },
>                   "authorName": {
>                     "type": "string",
>                     "description": "Display name of the reply's author. Empty when the upstream omits it."
>                   },
>                   "authorHandle": {
>                     "type": "string",
>                     "description": "Screen name / handle of the reply's author, without the @ prefix."
>                   },
>                   "replyCount": {
>                     "type": "integer",
>                     "description": "Number of replies to this reply."
>                   },
>                   "repostCount": {
>                     "type": "integer",
>                     "description": "Number of reposts/retweets of this reply."
>                   },
>                   "likeCount": {
>                     "type": "integer",
>                     "description": "Number of likes on this reply."
>                   },
>                   "quoteCount": {
>                     "type": "integer",
>                     "description": "Number of quote tweets of this reply."
>                   },
>                   "viewCount": {
>                     "type": [
>                       "integer",
>                       "null"
>                     ],
>                     "description": "Number of views of this reply. Null when the source does not report it, as for posts older than X view counts."
>                   },
>                   "createdUtc": {
>                     "type": "number",
>                     "description": "UTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds."
>                   },
>                   "conversationId": {
>                     "type": "string",
>                     "description": "Id of the conversation the reply belongs to, as a string."
>                   },
>                   "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": {
>                           "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": {
>                           "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."
>                         }
>                       }
>                     }
>                   }
>                 }
>               }
>             },
>             "nextCursor": {
>               "type": [
>                 "string",
>                 "null"
>               ],
>               "description": "Opaque cursor for the next page of replies, or null when there are no more. Pass it back as cursor to continue."
>             }
>           }
>         }
>       ]
>     }
>   }
> }
> ```

## Fields that must never come back empty

* `id`
* `items`
* `url`

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 `items` 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/jack/status/20"
}
```

The compatibility checks fire the schema's example at your endpoint. After that, your answers are graded against what the currently serving source returned for the same real customer inputs.

## Behavior

* The input is the full post URL, and the numeric post id is read out of its /status/\<id> segment.
* An empty items array is a valid answer and says nothing about whether the post exists, so it is never reported as a failure.
* limit is 1 to 40.
* Every reply carries id, url, text and createdUtc, and text is empty for a reply that is media only.

## Next

* [The operator endpoint contract](https://getanyapi.com/docs/sell/operator-endpoint-contract.md) for signing, budgets, and the live trial.
* [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.