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

# Twitch

> Fetch transcripts from public Twitch clips.

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

Public Twitch **clips** are supported — both `clips.twitch.tv` links and `twitch.tv/{channel}/clip/{slug}` links work. Clips that don't have captions (most of them) are transcribed with AI automatically, so you get a transcript either way.

<Warning>
  **Clips only.** VODs (`twitch.tv/videos/…`), past broadcasts, highlights, live streams, and channel pages are not supported and return `400 Invalid URL`.
</Warning>

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.transcriptmagic.com/api/twitch/transcript \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"url":"https://www.twitch.tv/northernlion/clip/SlickPoorChimpanzeeANELE-HW-sgtr9W_t9E5xB"}'
  ```

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

  response = requests.post(
      "https://api.transcriptmagic.com/api/twitch/transcript",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      json={"url": "https://www.twitch.tv/northernlion/clip/SlickPoorChimpanzeeANELE-HW-sgtr9W_t9E5xB"},
  )

  data = response.json()
  print(data["transcript"])         # plain string
  print(data["transcript_source"])  # "native" or "ai"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.transcriptmagic.com/api/twitch/transcript", {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ url: "https://www.twitch.tv/northernlion/clip/SlickPoorChimpanzeeANELE-HW-sgtr9W_t9E5xB" }),
  });

  const data = await response.json();
  console.log(data.transcript);        // plain string
  console.log(data.transcript_source); // "native" or "ai"
  ```

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

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

  func main() {
  	body, _ := json.Marshal(map[string]string{
  		"url": "https://www.twitch.tv/northernlion/clip/SlickPoorChimpanzeeANELE-HW-sgtr9W_t9E5xB",
  	})

  	req, _ := http.NewRequest("POST",
  		"https://api.transcriptmagic.com/api/twitch/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"`
  		TranscriptSource string `json:"transcript_source"`
  	}
  	json.NewDecoder(resp.Body).Decode(&data)
  	fmt.Println(data.Transcript)
  }
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://api.transcriptmagic.com/api/twitch/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://www.twitch.tv/northernlion/clip/SlickPoorChimpanzeeANELE-HW-sgtr9W_t9E5xB',
  ]));

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

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

## Response

```json theme={null}
{
  "success": true,
  "id": "4008068818",
  "url": "https://www.twitch.tv/northernlion/clip/SlickPoorChimpanzeeANELE-HW-sgtr9W_t9E5xB",
  "transcript": "Okay chat, watch this. No way that just happened...",
  "transcript_source": "ai",
  "credits": 994
}
```

<ResponseField name="transcript" type="string" required>
  The clip transcript as a plain string. No per-line timing.
</ResponseField>

<ResponseField name="transcript_source" type="string">
  `"native"` when the clip had captions, `"ai"` when it was transcribed with AI. Both cost the same.
</ResponseField>

<ResponseField name="id" type="string">
  Platform clip ID (numeric string for Twitch, e.g. `"4008068818"`).
</ResponseField>

<ResponseField name="url" type="string">
  The clip URL that was transcribed.
</ResponseField>

<ResponseField name="credits" type="integer" required>
  Your remaining credit balance after this call.
</ResponseField>

There is no title, thumbnail, timestamps, or `videoUrls` field in the Twitch response.

## Supported URL formats

| Format | Example |
| - | - |
| `clips.twitch.tv` link | `https://clips.twitch.tv/{slug}` |
| Channel clip page | `https://www.twitch.tv/{channel}/clip/{slug}` |
| Mobile clip page | `https://m.twitch.tv/clip/{slug}` |

`www.` and `m.` prefixes on `twitch.tv` are accepted, and query strings are ignored. Every form is normalized to `https://clips.twitch.tv/{slug}` server-side, so they all share one cached transcript. VOD (`/videos/…`), channel, and embed URLs are rejected with `400 Invalid URL. Please provide a valid Twitch clip URL.`

## FAQ

<AccordionGroup>
  <Accordion title="Can I transcribe a VOD or a live stream?">
    No — this endpoint is for **clips only**. VODs, past broadcasts, and live streams are rejected with `400 Invalid URL. Please provide a valid Twitch clip URL.` Clip the part you need on Twitch, then send the clip URL.
  </Accordion>

  <Accordion title="What if the clip has no captions?">
    Most clips don't, and that's fine — they're transcribed with AI automatically. `transcript_source` tells you which path was used. AI-transcribed clips take a little longer to return.
  </Accordion>

  <Accordion title="How much does it cost?">
    1 credit per clip, whether the transcript came from captions or AI. Errors and cache hits are free.
  </Accordion>

  <Accordion title="Do subscriber-only or deleted clips work?">
    No. Only publicly viewable clips can be transcribed. Deleted or unavailable clips return `404 No transcript available for this video`. You won't be charged.
  </Accordion>

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


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