TEST SITE: not indexed, not the live website. Placeholder button URLs in use: signup, login, dashboard, playground, api_base.
Docs menu

Quickstart: your first TikTok transcript

Get a key, send one GET request, read the transcript.

  • 2 min read
  • Last verified
Request
curl -s "https://api.example.com/api/v1/tiktok/transcript?url=TIKTOK_VIDEO_URL" \
  -H "Authorization: Bearer $TTA_API_KEY"
Response (illustrative values)
{
  "success": true,
  "video_id": "7683891628230315295",
  "transcript": "First line. Second line.",
  "language_code": "en",
  "segments": [ { "start": 3.22, "end": 4.32, "text": "First line." } ]
}
Draft notice

Owner check needed: endpoint, parameter, limit and error names here come from the planning spec, not from the live service. Confirm them against the real API before launch.

Overview

Get an API key, then send one GET request with a TikTok URL. You get the transcript back as JSON, or as SRT, VTT or text.

  • Get an API key from the dashboard.
  • Send one GET request with a TikTok link.
  • Read JSON with timed segments, or ask for SRT, VTT or TXT.
  • Handle errors by their code; failures cost 0 credits.
  1. Get an API key
  2. Send a request
  3. Read the response
  4. Handle errors

1. Get an API key

Get an API key in the dashboard (log in if you already have one). Copy it when it is shown and keep it on your server. Plans are on the pricing page.

2. Send a request

cURL (asks for VTT)
curl -s "${TTA_API_BASE:-https://api.example.com}/api/v1/tiktok/transcript?url=7000000000000000001&lang=en&format=vtt" \
  -H "Authorization: Bearer $TTA_API_KEY"

url accepts a full TikTok video link, a short link (vm.tiktok.com, vt.tiktok.com, tiktok.com/t/) or the 19-digit video ID. Anything else is rejected with invalid_request.

3. Read the response

Python
import os, requests

API = os.environ.get("TTA_API_BASE", "https://api.example.com")
r = requests.get(
    f"{API}/api/v1/tiktok/transcript",
    params={"url": "https://www.tiktok.com/@gardenclub/video/7000000000000000001", "lang": "en"},
    headers={"Authorization": f"Bearer {os.environ['TTA_API_KEY']}"},
    timeout=60,
)
data = r.json()
if not data["success"]:
    raise SystemExit(f"{data['error']['code']}: {data['error']['message']}")
print(data["transcript_source"], data["language_code"], len(data["segments"]), "segments")
print(data["transcript"])
print("credits left:", data["credits_remaining"])
Captured output from the local mock (not the real API)
captions en 5 segments
Okay, three tips for a small garden. Tip one: measure the sun before you buy seeds. Tip two: raised beds drain better. Tip three: water in the morning. Follow for the full guide.
credits left: 14999

In JSON mode the fields are video_id, transcript, transcript_source, language_code, available_languages and segments (each with start, end and text in seconds). Field names follow the owner’s scraper output; the envelope fields (success, credits_remaining) are to be confirmed.

4. Handle errors

Failed calls return success: false and an error object with code, message and retryable. They cost 0 credits. Example with a bad key:

Captured output from the local mock (not the real API)
unauthorized: Missing or invalid API key.

See the full list in rate limits and errors. Run against the local mock in tools/mock-api, which follows the assumed contract on these pages. It is not the real API, and the output is captured from that mock.

Frequently asked questions

Do I need a TikTok developer account?

No. You need a key for this API only.

What if a video has no captions?

You get a no_transcript error, or a speech-to-text job if that is allowed for the request. Neither is charged until a transcript is returned.

Ready to call it from your code?

Get API key
Get API keyDocs