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

# Tweet translation API for X posts in any language

> Translate one public tweet into the language you pick with X's own translation. Get the text, source language, and links with offsets. 1 credit per call.

<Panel>
  <Tabs defaultTabIndex={0} sync={false}>
    <Tab title="200" id="response-x-tweet-translation-200">
      ```json theme={null}
      {
        "translation": {
          "tweetId": "2102882545427714266",
          "language": "tr",
          "sourceLanguage": "en",
          "text": "Artemis Anlaşmaları’na Hoş Geldiniz, Hırvatistan https://t.co/Xe1nm2pkSX",
          "entities": {
            "urls": [
              {
                "url": "https://t.co/Xe1nm2pkSX",
                "expanded_url": "https://go.nasa.gov/3VcvAQn",
                "display_url": "go.nasa.gov/3VcvAQn",
                "indices": [
                  49
                ]
              }
            ]
          }
        }
      }
      ```
    </Tab>

    <Tab title="400" id="response-x-tweet-translation-400">
      ```json theme={null}
      {
        "error": "invalid_input",
        "message": "Invalid input. Check the request body."
      }
      ```
    </Tab>

    <Tab title="401" id="response-x-tweet-translation-401">
      ```json theme={null}
      {
        "error": "unauthenticated",
        "message": "Authentication required. Provide a valid API key or bearer token."
      }
      ```
    </Tab>

    <Tab title="402" id="response-x-tweet-translation-402">
      ```json theme={null}
      {
        "error": "insufficient_credits",
        "message": "Insufficient credits. Top up or subscribe to continue."
      }
      ```
    </Tab>

    <Tab title="404" id="response-x-tweet-translation-404">
      ```json theme={null}
      {
        "error": "tweet_not_found",
        "message": "Tweet not found. Check the tweet ID."
      }
      ```
    </Tab>

    <Tab title="424" id="response-x-tweet-translation-424">
      ```json theme={null}
      {
        "error": "x_api_unavailable",
        "message": "X data source temporarily unavailable. Try again later."
      }
      ```
    </Tab>

    <Tab title="429" id="response-x-tweet-translation-429">
      ```json theme={null}
      {
        "error": "rate_limit_exceeded",
        "message": "Too many requests. Try again later.",
        "retryAfter": 60
      }
      ```
    </Tab>

    <Tab title="502" id="response-x-tweet-translation-502">
      ```json theme={null}
      {
        "error": "x_api_unavailable",
        "message": "X data source temporarily unavailable. Try again later."
      }
      ```
    </Tab>

    <Tab title="503" id="response-x-tweet-translation-503">
      ```json theme={null}
      {
        "error": "x_api_unavailable",
        "message": "Xquik is busy right now. Retry shortly."
      }
      ```
    </Tab>
  </Tabs>
</Panel>

<blockquote className="agent-llms-directive">
  For the complete documentation index, see <a href="/llms.txt">llms.txt</a>.
</blockquote>

<Callout icon="coins" color="#5c3327">
  **1 credit per call** · [All plans](https://xquik.com/#pricing) from \$0.00012/credit · Direct [MPP](/mpp/machine-payments-protocol): USD 0.00015 per call
</Callout>

Translate tweet returns X's own translation of one public tweet.
You pick the language. The endpoint is `GET /api/v1/x/tweets/{id}/translation`.

<CodeGroup>
  ```bash cURL theme={null}
  curl -G https://xquik.com/api/v1/x/tweets/2102882545427714266/translation \
    --data-urlencode "language=tr" \
    -H "x-api-key: xq_your_api_key_here" | jq
  ```

  ```javascript Node.js theme={null}
  const tweetId = "2102882545427714266";
  const params = new URLSearchParams({ language: "tr" });
  const response = await fetch(`https://xquik.com/api/v1/x/tweets/${tweetId}/translation?${params}`, {
    headers: { "x-api-key": "xq_your_api_key_here" },
  });
  const { translation } = await response.json();
  const translationRow = {
    tweet_id: translation.tweetId,
    source_language: translation.sourceLanguage ?? null,
    language: translation.language,
    text: translation.text,
    links: (translation.entities.urls ?? []).map((link) => link.expanded_url),
  };

  process.stdout.write(`${JSON.stringify(translationRow)}\n`);
  ```

  ```python Python theme={null}
  import json
  import requests

  tweet_id = "2102882545427714266"
  response = requests.get(
      f"https://xquik.com/api/v1/x/tweets/{tweet_id}/translation",
      params={"language": "tr"},
      headers={"x-api-key": "xq_your_api_key_here"},
  )
  translation = response.json()["translation"]
  translation_row = {
      "tweet_id": translation["tweetId"],
      "source_language": translation.get("sourceLanguage"),
      "language": translation["language"],
      "text": translation["text"],
      "links": [link["expanded_url"] for link in translation["entities"].get("urls", [])],
  }
  print(json.dumps(translation_row))
  ```
</CodeGroup>

Use `GET /x/tweets/{id}/translation` when a reader needs a tweet in another language.
The text is X's own translation, as x.com shows it under the post.
Each call costs 1 credit. A refused request costs nothing.

## Translate tweets for a multilingual feed

Read tweets with [Search Tweets](/api-reference/x/search-tweets) or [Get tweet](/api-reference/x/get-tweet).
Most tweets carry `lang`, the language code X detects.
Call this endpoint only for tweets whose `lang` differs from your reader's language.

Store `tweetId`, `language`, and `text` together.
A stored translation saves a second call for the same tweet and language.

`entities` holds the links, mentions, and tags of the translated text.
Their `indices` point into `text`, so you can link them without parsing.

## Path parameters

<ParamField path="id" type="string" required>
  Post ID or URL-encoded post URL, such as `x.com/nasa/status/20`. See [path IDs](/api-reference/overview#path-ids).
</ParamField>

## Query parameters

<ParamField query="language" type="string" required>
  Language code to translate into, such as `en`, `tr`, `pt-br`, or `zh-tw`. Any letter case works, and `pt_BR` reads as `pt-br`. A language name, such as `turkish`, returns `400 invalid_language`.
</ParamField>

## Headers

<ParamField header="x-api-key" type="string">
  Full account key. Sessions and OAuth also work.
</ParamField>

<ParamField header="Authorization" type="string">
  `Bearer xq_your_guest_key_here` authenticates `paid_reads` guest keys. Direct MPP uses the `Payment ...` credential. Get it from the `WWW-Authenticate: Payment` challenge.
</ParamField>

## Response

### 200 OK

<ResponseField name="translation" type="object">
  X's translation of the tweet.
  **Translation object fields.**

  <ResponseField name="tweetId" type="string">
    ID of the translated tweet.
  </ResponseField>

  <ResponseField name="language" type="string">
    Language code of the translated text, in lower case.
  </ResponseField>

  <ResponseField name="sourceLanguage" type="string">
    Language code X detects in the tweet. Omitted when X names none.
  </ResponseField>

  <ResponseField name="text" type="string">
    Translated tweet text.
  </ResponseField>

  <ResponseField name="entities" type="object">
    Links, mentions, and tags with their offsets in the translated text. Empty when the text has none.
  </ResponseField>
</ResponseField>

```json theme={null}
{
  "translation": {
    "tweetId": "2102882545427714266",
    "language": "tr",
    "sourceLanguage": "en",
    "text": "Artemis Anlaşmaları’na Hoş Geldiniz, Hırvatistan https://t.co/Xe1nm2pkSX",
    "entities": {
      "urls": [
        {
          "url": "https://t.co/Xe1nm2pkSX",
          "expanded_url": "https://go.nasa.gov/3VcvAQn",
          "display_url": "go.nasa.gov/3VcvAQn",
          "indices": [49, 72]
        }
      ]
    }
  }
}
```

### 400 Invalid language

```json theme={null}
{
  "error": "invalid_language",
  "message": "Send language as a language code, such as en, tr, pt-br or zh-tw."
}
```

`language` is missing or is not a language code. Send a code, not a language name.

### 400 Invalid tweet ID

```json theme={null}
{ "error": "invalid_tweet_id" }
```

The provided tweet ID is empty or not a valid format.

### 401 Unauthenticated

```json theme={null}
{ "error": "unauthenticated" }
```

Missing or invalid API key. Check the `x-api-key` header value.

### 402 Payment required

Account keys get account options. Guest keys get guest top-up only.
Anonymous calls receive a direct MPP `WWW-Authenticate: Payment` challenge plus a guest wallet creation action.
No checkout starts automatically. Confirm any payment action.

### 404 Tweet not found

```json theme={null}
{ "error": "tweet_not_found" }
```

The tweet does not exist. The author may have deleted it, or the ID is invalid.

### 502 X API unavailable

```json theme={null}
{ "error": "x_api_unavailable" }
```

The read service returned an error. Retry after a short delay.

### 503 Service busy

```json theme={null}
{ "error": "x_api_unavailable" }
```

X returned no translation, or Xquik is busy. Retry after a short delay. The request costs nothing.

### 429 Rate limit exceeded

```json theme={null}
{ "error": "rate_limit_exceeded", "retryAfter": 60 }
```

You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying.

### 424 Dependency failed

```json theme={null}
{ "error": "x_api_unavailable" }
```

The normalized v1 response contract can return 424 when the read service is unavailable.

## Tweet translation API questions

### How do I translate a tweet with an API?

Call `GET /x/tweets/{id}/translation` with the tweet ID and a `language` code.
The response holds the translated text in `translation.text`.

### Which languages can I translate a tweet into?

Send any language code X translates into, such as `en`, `es`, `tr`, `ja`, or `pt-br`.
A code that names no language returns `400 invalid_language` and costs nothing.

### How do I know the tweet's original language?

Read `translation.sourceLanguage`. It holds the language code X detects in the tweet.
The field is absent when X names no language.

### How much does a tweet translation cost?

Each call costs 1 credit. A refused or failed request costs nothing.

### Does this replace X's official API?

No. This page documents Xquik, an independent third-party service.
It does not document X's official API.

<Note>
  **Next steps.** [Get tweet](/api-reference/x/get-tweet) reads the original text and its `lang`, or [Search Tweets](/api-reference/x/search-tweets) finds tweets to translate.
</Note>

<div className="related-api-links">
  <Accordion title="Related tweet, reply & media APIs" icon="link">
    * Tweets: [Get tweet](/api-reference/x/get-tweet) · [Batch tweets](/api-reference/x/batch-tweets) · [Tweet thread](/api-reference/x/tweet-thread) · [Hidden replies](/api-reference/x/tweet-hidden-replies) · [Translate tweet](/api-reference/x/tweet-translation) · [Embed tweet](/api-reference/x/tweet-embed) · [Resolve links](/api-reference/x/resolve-links) · [Tweet subtitles](/api-reference/x/tweet-subtitles) · [X Article](/api-reference/x/get-article)
    * Engagement: [Tweet replies](/api-reference/x/tweet-replies) · [Quote tweets](/api-reference/x/tweet-quotes) · [Likers](/api-reference/x/favoriters) · [Reposters](/api-reference/x/retweeters) · [Check repost](/api-reference/x/tweet-repost-check)
    * Profiles: [User tweets](/api-reference/x/user-tweets) · [Batch user tweets](/api-reference/x/batch-user-tweets) · [User replies](/api-reference/x/user-replies) · [User likes](/api-reference/x/user-likes) · [User media](/api-reference/x/user-media) · [User highlights](/api-reference/x/user-highlights) · [User articles](/api-reference/x/user-articles)
    * Feeds: [List tweets](/api-reference/x/list-tweets) · [Trends](/api-reference/x/trends) · [Trend locations](/api-reference/x/trend-locations) · [Search Spaces](/api-reference/x/search-spaces) · [Get Space](/api-reference/x/get-space) · [Space replay](/api-reference/x/space-replay) · [Get broadcast](/api-reference/x/get-broadcast) · [Hashflags](/api-reference/x/hashflags) · [Search places](/api-reference/x/search-places) · [Download media](/api-reference/x/download-media)
  </Accordion>
</div>


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