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

# TikTok

> Fetch transcripts from any public TikTok video with one REST call.

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

Full share URLs (`/@user/video/<id>`) and `vm.tiktok.com` short links both resolve cleanly.

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.transcriptmagic.com/api/tiktok/transcript \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"url":"https://www.tiktok.com/@user/video/7212345678901234567"}'
  ```

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

  response = requests.post(
      "https://api.transcriptmagic.com/api/tiktok/transcript",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      json={"url": "https://www.tiktok.com/@user/video/7212345678901234567"},
  )

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

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.transcriptmagic.com/api/tiktok/transcript", {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ url: "https://www.tiktok.com/@user/video/7212345678901234567" }),
  });

  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://www.tiktok.com/@user/video/7212345678901234567",
  	})

  	req, _ := http.NewRequest("POST",
  		"https://api.transcriptmagic.com/api/tiktok/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"`
  		VideoUrls  *struct {
  			Sd        string `json:"sd"`
  			Hd        string `json:"hd"`
  			Thumbnail string `json:"thumbnail"`
  		} `json:"videoUrls,omitempty"`
  	}
  	json.NewDecoder(resp.Body).Decode(&data)
  	fmt.Println(data.Transcript)
  }
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://api.transcriptmagic.com/api/tiktok/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.tiktok.com/@user/video/7212345678901234567',
  ]));

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

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

## Response

```json theme={null}
{
  "transcript": "Okay so today I'm going to show you\nthe easiest pasta recipe\nyou'll ever make...",
  "videoUrls": {
    "sd": "https://...mp4",
    "hd": null,
    "thumbnail": "https://...jpg"
  },
  "credits": 996
}
```

`transcript` is a plain string with newlines between spoken lines — there is no per-line timing in the TikTok response, and no `title` field. `videoUrls` is included whenever the upstream exposes a downloadable video URL; it is omitted when none is available.

## Supported URL formats

| Format                     | Example                                            |
| -------------------------- | -------------------------------------------------- |
| Full share URL             | `https://www.tiktok.com/@user/video/<19-digit id>` |
| `vm.tiktok.com` short link | `https://vm.tiktok.com/<code>`                     |

## FAQ

<AccordionGroup>
  <Accordion title="Do private TikTok videos work?">
    No. The API can only fetch transcripts for publicly viewable videos. Private accounts and videos behind a follow-gate aren't supported.
  </Accordion>

  <Accordion title="What if the video has no spoken audio?">
    If the upstream returns a video URL but no captions, you'll get a 200 with `transcript: ""` and a `videoUrls` object — and you'll be charged 1 credit. If the upstream returns no captions and no video URL, you'll get a `404` with `error: "No transcript available for this video"` and you won't be charged.
  </Accordion>

  <Accordion title="Does it work on TikTok Lives?">
    Live streams aren't supported. Once a Live is saved as a regular video and is publicly viewable, it works like any other URL.
  </Accordion>

  <Accordion title="Will the short `vm.tiktok.com` URLs work directly?">
    Yes. We resolve them server-side — you don't need to expand the link before calling the API.
  </Accordion>

  <Accordion title="Does the response include the video title or author?">
    No — the TikTok response shape is intentionally lean: `transcript`, optional `videoUrls`, and `credits`. If you need the author handle, parse it from the URL you submitted.
  </Accordion>
</AccordionGroup>
