YouTubeToText

v2.0

YouTubeToText

For developers: Here's a lightweight REST API for retrieving and querying YouTube video transcripts.

Getting Started

API Base URL

https://api.youtubetotext.com

All API endpoints are available at https://api.youtubetotext.com.

API Endpoints
GET
https://api.youtubetotext.com/list_transcripts/<video_id>

Returns available transcripts for a given video ID.

Response Format:

[
  {
    "language": "English",
    "language_code": "en",
    "is_generated": true,
    "is_translatable": true
  }
]
GET
https://api.youtubetotext.com/full_transcript/<video_id>

Returns the full transcript in a specified language.

Query Parameters:

  • lang (optional): default is "en"
  • meta (optional): "true" to include metadata

Response (with meta=true):

{
  "language": "Japanese",
  "language_code": "ja",
  "source_type": "auto",
  "transcript": [
    {
      "index": 0,
      "text": "...",
      "start": 0,
      "duration": 2.4
    }
  ]
}
GET
https://api.youtubetotext.com/get_lines_at_timestamps/<video_id>

Returns transcript lines that are closest to the given timestamps.

Query Parameters:

  • timestamp (multiple): e.g., `?timestamp=12.3&timestamp=45.6`
POST
https://api.youtubetotext.com/get_lines_at_timestamps/<video_id>

Same as GET, but allows a larger payload via POST request body.

Request Body:

{
  "timestamps": [
    1,
    2.5,
    10.1
  ]
}
GET
https://api.youtubetotext.com/get_lines_in_range/<video_id>

Returns transcript lines within a time window `[start, end]`.

Query Parameters:

  • start (float)
  • end (float)