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

## Request

```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'];
```

## 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
}
```

**transcript** `string` *required*

The clip transcript as a plain string. No per-line timing.

**transcript\_source** `string`

`"native"` when the clip had captions, `"ai"` when it was transcribed with AI. Both cost the same.

**id** `string`

Platform clip ID (numeric string for Twitch, e.g. `"4008068818"`).

**url** `string`

The clip URL that was transcribed.

**credits** `integer` *required*

Your remaining credit balance after this call.

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

> [accordion] 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] 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] How much does it cost?
>
> 1 credit per clip, whether the transcript came from captions or AI. Errors and cache hits are free.

> [accordion] 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] Does the response include timestamps?
>
> No. Twitch clip transcripts are returned as plain text — there is no per-line timing.


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