API Documentation

Use the YouTube to Doc API to programmatically convert YouTube videos into documentation.

Getting Started

The YouTube to Doc API allows you to extract video information, transcripts, and generate documentation from YouTube videos programmatically.

Base URL

http://youtube-to-doc-pt-br-production.up.railway.app/

Endpoints

POST /

Process a YouTube video and generate documentation.

Request Body (Form Data)

Parameter Type Required Description
input_text string Yes YouTube video URL
max_transcript_length integer No Maximum transcript length (default: 10000)
include_comments boolean No Include video comments (default: false)
language string No Transcript language (default: "pt-BR")
translate_if_needed boolean No When true and language=pt/pt-BR, translates non-PT transcript to pt-BR
clean_transcript boolean No Normalize transcript line breaks into readable paragraphs (default: true)
GET /video/{video_id}

Get a processing form for a specific YouTube video.

Path Parameters

Parameter Type Description
video_id string YouTube video ID (11 characters)

Examples

cURL Example

curl -X POST "http://youtube-to-doc-pt-br-production.up.railway.app/" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "input_text=https://www.youtube.com/watch?v=dQw4w9WgXcQ" \
  -d "max_transcript_length=5000" \
  -d "language=pt-BR" \
  -d "translate_if_needed=true" \
  -d "clean_transcript=true"

Python Example

import requests

url = "http://youtube-to-doc-pt-br-production.up.railway.app/"
data = {
    "input_text": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "max_transcript_length": 5000,
    "language": "pt-BR",
    "include_comments": False,
    "translate_if_needed": True,
    "clean_transcript": True
}

response = requests.post(url, data=data)
print(response.text)

Rate Limits

Rate Limits

  • Main endpoint: 10 requests per minute per IP
  • Video-specific endpoint: 5 requests per minute per IP

Error Handling

When an error occurs, the API will return an HTML response with error information displayed in the user interface. Common error scenarios include:

Invalid YouTube URL: The provided URL is not a valid YouTube video URL.
Video not available: The video is private, deleted, or region-restricted.
Transcript not available: No transcript is available for the video in the requested language.
Rate limit exceeded: Too many requests have been made from your IP address.