API v1

Transcriptly API v1 retrieves video metadata and published closed caption tracks from public YouTube videos.

  • Dedicated YouTube Integration: Accepts standard youtube.com/watch?v= and short youtu.be/ links.
  • Need More Platforms?: For TikTok, Instagram, X (Twitter), Facebook, or AI audio transcription when captions are missing, see API v2.

Last updated: December 2, 2026

Getting started

Send requests to this base URL using HTTPS. Authenticate all calls using the X-API-Key header.

https://transcriptly.org/api/v1
X-API-Key: your_api_key_here

Credit Pricing & Quotas

  • /video-info: Costs 1 credit per successful response.
  • /transcript: Costs 1 credit per successful caption track, or 1 credit if the video has no captions (HTTP 404).
  • Rate Limit: 120 requests per hour per account, shared across v1 and v2 endpoints. Response headers include X-RateLimit-* information.

Workflow

  1. Inspect available tracks: Call POST /video-info to inspect the video duration and discover available caption languages (costs 1 credit).
  2. Select target language: Have your user or application choose a preferred language code (e.g. en, es).
  3. Fetch caption track: Call POST /transcript with that language to retrieve timestamped text segments (costs 1 credit).

Tip: If you already know the video has your desired language or wish to default to the primary track, you can skip /video-info and call /transcript directly.

Get video information

POST/video-info

Returns video details, author information, duration, and the caption languages available for the video.

Request

{
  "url": "https://www.youtube.com/watch?v=VIDEO_ID"
}
FieldTypeRequirementDescription
urlstringRequiredYouTube video URL (youtube.com/watch?v= or youtu.be/).

Response

{
  "code": 200,
  "message": "success",
  "data": {
    "videoDetails": {
      "title": "string",
      "description": "string",
      "author": "string",
      "authorUrl": "string",
      "thumbnailUrl": "string",
      "lengthSeconds": 0
    },
    "availableLanguages": [
      { "code": "en", "name": "English", "isGenerated": false }
    ]
  }
}
FieldTypeDescription
data.videoDetails.titlestringVideo title.
data.videoDetails.descriptionstringFull video description.
data.videoDetails.authorstringChannel name.
data.videoDetails.authorUrlstringChannel URL, if available.
data.videoDetails.thumbnailUrlstringThumbnail image URL.
data.videoDetails.lengthSecondsnumberTotal video duration in seconds.
data.availableLanguages[].codestringISO language code (e.g. en, es).
data.availableLanguages[].namestringReadable language name.
data.availableLanguages[].isGeneratedbooleanIndicates whether the caption track was auto-generated by YouTube (legacy field).

availableLanguages comes from video metadata and is only a hint. An empty list does not mean captions are missing. To confirm whether captions exist, call POST /transcript. A definitive "no captions" result is HTTP 404 with body code 404.

Get transcript

POST/transcript

Retrieves published closed caption segments for a specific language. This endpoint returns pre-existing captions and does not generate AI transcripts.

Request

{
  "url": "https://www.youtube.com/watch?v=VIDEO_ID",
  "language": "en"
}
FieldTypeRequirementDescription
urlstringRequiredYouTube video URL.
languagestringOptionalOptional ISO language code. If omitted, the default caption track is returned.

Response: Captions Available (HTTP 200)

{
  "code": 200,
  "message": "success",
  "data": {
    "language": "en",
    "languageName": "English",
    "segments": [
      {
        "id": 0,
        "text": "string",
        "startMs": 0,
        "endMs": 1200,
        "startTimeText": "0:00"
      }
    ],
    "availableLanguages": [
      { "code": "en", "name": "English", "isGenerated": false }
    ]
  }
}
FieldTypeDescription
data.languagestringLanguage code of the returned captions.
data.languageNamestringReadable name of the returned language.
data.segments[].textstringCaption line content.
data.segments[].startMsnumberStart time offset in milliseconds.
data.segments[].endMsnumberEnd time offset in milliseconds.
data.segments[].startTimeTextstringFormatted timestamp string (e.g. '0:00').
data.availableLanguagesarrayOther caption tracks available for this video.

Response: No Captions (HTTP 404)

This is the definitive "no captions" signal: HTTP 404 with body code 404. Do not rely on an empty language list from /video-info. Consumes 1 credit. A missing video instead returns body code 4007 and does not consume credits.

{
  "code": 404,
  "message": "No transcript available for this video",
  "data": {
    "availableLanguages": []
  }
}

Code examples

cURL

curl -X POST https://transcriptly.org/api/v1/transcript \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key_here" \
  -d '{"url":"https://www.youtube.com/watch?v=VIDEO_ID","language":"en"}'

JavaScript / TypeScript

const response = await fetch('https://transcriptly.org/api/v1/transcript', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-Key': 'your_api_key_here'
  },
  body: JSON.stringify({
    url: 'https://www.youtube.com/watch?v=VIDEO_ID',
    language: 'en'
  })
})

const transcript = await response.json()
console.log(transcript.data.segments)

Python

import requests

response = requests.post(
    "https://transcriptly.org/api/v1/transcript",
    headers={"X-API-Key": "your_api_key_here"},
    json={
        "url": "https://www.youtube.com/watch?v=VIDEO_ID",
        "language": "en",
    },
)
print(response.json()["data"]["segments"])

Errors

All error responses return standard JSON envelopes with status codes, application error codes, and descriptive messages.

HTTPBody codeMeaning
400400Invalid JSON body, or url parameter is missing.
4004001The provided URL is not a valid YouTube video link. No credits consumed.
401401Missing or invalid API key in X-API-Key header.
4024005Free plan accounts cannot fetch captions for YouTube videos exceeding 60 minutes. No credits consumed.
4034003Insufficient account credits to complete the request.
404404Video has no closed captions. 1 credit consumed.
4044007YouTube video not found, deleted, or private. No credits consumed.
429429Hourly rate limit exceeded (120 requests/hour). Inspect Retry-After header.
5005001Upstream YouTube extraction failed. No credits consumed.