API Documentation

Integrate YouTube transcript generation and AI summarization into your applications with our powerful REST API.

Quick Start

Get started with the TubeScript AI API in minutes. Our RESTful API provides programmatic access to all transcript generation and summarization features.

Base URL

https://api.tubescript.ai/v1

Authentication

Authorization: Bearer YOUR_API_KEY

Get Your API Key

Sign in and visit your API Dashboard to create and manage your API keys.

POST /transcript/generate

Generate a transcript from a YouTube video URL. The API will first check for existing captions, then use AI transcription if needed.

Request Body

{ "youtube_url": "https://www.youtube.com/watch?v=VIDEO_ID", "format": "json", "include_timestamps": true }

Response

{ "success": true, "video_id": "VIDEO_ID", "title": "Video Title", "duration": "00:10:30", "transcript": [ { "timestamp": "00:00:05.000", "text": "Welcome to this tutorial..." }, { "timestamp": "00:00:12.500", "text": "Today we'll be learning about..." } ] }
{ "success": false, "error": "Invalid YouTube URL provided", "error_code": "INVALID_URL" }
POST /summary/generate

Generate an AI-powered summary from transcript data. Uses advanced AI models for intelligent summarization.

Request Body

{ "transcript": [ { "timestamp": "00:00:05.000", "text": "Welcome to this tutorial..." } ], "summary_type": "detailed", "format": "structured" }

Response

{ "success": true, "summary": { "overview": "This video covers the fundamentals of...", "key_points": [ "First important concept explained", "Second key takeaway from the content" ], "insights": [ "Deep insight about the topic", "Important implication discussed" ], "conclusion": "The video concludes with..." }, "word_count": 1250, "processing_time": "2.3s" }
{ "success": false, "error": "Transcript data is required", "error_code": "MISSING_TRANSCRIPT" }
POST /process/complete

Generate both transcript and summary in a single API call. Most efficient option for complete processing.

Request Body

{ "youtube_url": "https://www.youtube.com/watch?v=VIDEO_ID", "include_transcript": true, "include_summary": true, "summary_type": "detailed" }

Response

{ "success": true, "video_id": "VIDEO_ID", "title": "Video Title", "transcript": [...], "summary": {...}, "processing_time": "5.7s" }

Rate Limits

To ensure fair usage and optimal performance, our API implements rate limiting based on your subscription tier.

Basic Tier

  • • 100 requests per hour
  • • 10 concurrent requests
  • • Videos up to 30 minutes

Pro Tier

  • • 1,000 requests per hour
  • • 50 concurrent requests
  • • Videos up to 2 hours

Enterprise

  • • Unlimited requests
  • • 200 concurrent requests
  • • No video length limit

Error Codes

Code Description HTTP Status
INVALID_URL The provided YouTube URL is invalid 400
VIDEO_NOT_FOUND The YouTube video could not be found 404
TRANSCRIPT_FAILED Failed to generate transcript 500
RATE_LIMIT_EXCEEDED API rate limit exceeded 429
UNAUTHORIZED Invalid or missing API key 401

Code Examples

Python

import requests # Generate transcript url = "http://localhost:8000/api/v1/transcript/generate" headers = { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" } data = { "youtube_url": "https://www.youtube.com/watch?v=VIDEO_ID", "format": "json", "include_timestamps": True } response = requests.post(url, headers=headers, json=data) result = response.json() if result["success"]: print(f"Video Title: {result['title']}") for segment in result["transcript"]: print(f"{segment['timestamp']}: {segment['text']}")

JavaScript

const generateTranscript = async (youtubeUrl) => { const response = await fetch('http://localhost:8000/api/v1/transcript/generate', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ youtube_url: youtubeUrl, format: 'json', include_timestamps: true }) }); const result = await response.json(); if (result.success) { console.log('Video Title:', result.title); result.transcript.forEach(segment => { console.log(`${segment.timestamp}: ${segment.text}`); }); } }; generateTranscript('https://www.youtube.com/watch?v=VIDEO_ID');

cURL

curl -X POST http://localhost:8000/api/v1/transcript/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "youtube_url": "https://www.youtube.com/watch?v=VIDEO_ID", "format": "json", "include_timestamps": true }'

Ready to Get Started?

Sign up for an API key and start integrating TubeScript AI into your applications today.