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

# X

> Fetch transcripts from public video tweets on X (formerly Twitter).

```http theme={null}
POST https://api.transcriptmagic.com/api/twitter/transcript
```

Public video tweets are supported. Both `x.com` and `twitter.com` `/status/` URLs work. The video must be **under 2 minutes** — X tweets are AI-transcribed, so this endpoint is slower than the others.

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.transcriptmagic.com/api/twitter/transcript \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"url":"https://x.com/TheoVon/status/1916982720317821050"}'
  ```

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

  response = requests.post(
      "https://api.transcriptmagic.com/api/twitter/transcript",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      json={"url": "https://x.com/TheoVon/status/1916982720317821050"},
  )

  data = response.json()
  print(data["transcript"])  # plain string, newline-separated
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.transcriptmagic.com/api/twitter/transcript", {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ url: "https://x.com/TheoVon/status/1916982720317821050" }),
  });

  const data = await response.json();
  console.log(data.transcript); // plain string, newline-separated
  ```

  ```go Go theme={null}
  package main

  import (
  	"bytes"
  	"encoding/json"
  	"fmt"
  	"net/http"
  )

  func main() {
  	body, _ := json.Marshal(map[string]string{
  		"url": "https://x.com/TheoVon/status/1916982720317821050",
  	})

  	req, _ := http.NewRequest("POST",
  		"https://api.transcriptmagic.com/api/twitter/transcript",
  		bytes.NewBuffer(body))
  	req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
  	req.Header.Set("Content-Type", "application/json")

  	resp, _ := http.DefaultClient.Do(req)
  	defer resp.Body.Close()

  	var data struct {
  		Transcript string `json:"transcript"`
  	}
  	json.NewDecoder(resp.Body).Decode(&data)
  	fmt.Println(data.Transcript)
  }
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://api.transcriptmagic.com/api/twitter/transcript');

  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      'Authorization: Bearer YOUR_API_KEY',
      'Content-Type: application/json',
  ]);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
      'url' => 'https://x.com/TheoVon/status/1916982720317821050',
  ]));

  $response = curl_exec($ch);
  curl_close($ch);

  $data = json_decode($response, true);
  echo $data['transcript'];
  ```
</CodeGroup>

## Response

```json theme={null}
{
  "transcript": "Hey everyone, today I want to walk\nyou through how we built the new product line...",
  "credits": 994
}
```

`transcript` is a plain string with newlines between spoken lines — there is no per-line timing in the X response and no `videoUrls` field.

## Supported URL formats

| Format               | Example                                  |
| -------------------- | ---------------------------------------- |
| `x.com` status       | `https://x.com/{user}/status/{id}`       |
| `twitter.com` status | `https://twitter.com/{user}/status/{id}` |

Both the `x.com` and legacy `twitter.com` domains are accepted as long as the URL points at a `/status/{id}` tweet. URLs without a `/status/` path are rejected with `400 Invalid URL`.

## FAQ

<AccordionGroup>
  <Accordion title="Do both x.com and twitter.com URLs work?">
    Yes. Both the `x.com` and the legacy `twitter.com` `/status/` URLs are accepted.
  </Accordion>

  <Accordion title="Is there a length limit?">
    Yes — the video must be **under 2 minutes**. Longer videos can't be transcribed by this endpoint.
  </Accordion>

  <Accordion title="Why is this endpoint slower than the others?">
    X tweets don't ship with captions, so the video is AI-transcribed on demand. That takes longer than the caption-based endpoints — expect a longer round trip, especially near the 2-minute limit.
  </Accordion>

  <Accordion title="Does every tweet work?">
    Only tweets that contain a video. Text, image, and link tweets have nothing to transcribe and are rejected.
  </Accordion>

  <Accordion title="Does the response include timestamps?">
    No. X transcripts are returned as plain text with newlines between lines — there is no per-line timing.
  </Accordion>
</AccordionGroup>
