YouTube Timestamps Generator API
Overview
Section titled “Overview”The YouTube Timestamps Generator API uses advanced AI technology to automatically create chapter timestamps for YouTube videos. The AI analyzes video transcripts to identify natural topic changes and major sections, generating timestamps with descriptive titles and descriptions in the video’s original language.
Base URL: https://youtube-timestamps-generator-api.p.rapidapi.com
Features
Section titled “Features”- AI-Driven timestamp generation using advanced technology
- Intelligent topic detection and segmentation
- Descriptive titles and descriptions for each chapter
- Automatic language detection and matching
- Maximum video duration: 1 hour (60 minutes) for all plans
- Fast processing with optimized AI prompts
- Works with regular videos AND YouTube Shorts
- YouTube-ready description format
- Multiple API key rotation for reliability
Authentication
Section titled “Authentication”All requests must include your RapidAPI key in the headers:
x-rapidapi-key: YOUR_RAPIDAPI_KEYx-rapidapi-host: youtube-timestamps-generator-api.p.rapidapi.comQuick Start Examples
Section titled “Quick Start Examples”Example 1: Long Video (15 min)
Section titled “Example 1: Long Video (15 min)”curl -X POST "https://youtube-timestamps-generator-api.p.rapidapi.com/generate?url=https://www.youtube.com/watch?v=z_bX3runikk" \ -H "x-rapidapi-host: youtube-timestamps-generator-api.p.rapidapi.com" \ -H "x-rapidapi-key: YOUR_RAPIDAPI_KEY"Response:
{ "success": true, "video_id": "z_bX3runikk", "video_title": "Matthew McConaughey's Concerns Over AI", "video_duration": 914, "detected_language": "en", "language_name": "English", "processing_time_ms": 48515, "timestamps": [ { "time": "0:00", "seconds": 0, "title": "AI as a Potential Governor/President", "description": "Joe Rogan introduces the idea of advanced AI potentially taking over governance due to perceived human emotional volatility and past political scandals." }, { "time": "0:32", "seconds": 32, "title": "Human-AI Evolution: Integration vs. Obsolescence", "description": "The discussion shifts to whether AI can improve human existence or if it will lead to humanity's obsolescence as the next step in evolution." } ], "youtube_description_format": "0:00 AI as a Potential Governor/President\n0:32 Human-AI Evolution: Integration vs. Obsolescence\n...", "total_chapters": 9}Example 2: YouTube Short (34 sec)
Section titled “Example 2: YouTube Short (34 sec)”curl -X POST "https://youtube-timestamps-generator-api.p.rapidapi.com/generate?url=https://www.youtube.com/shorts/ivTdEQ6wseU" \ -H "x-rapidapi-host: youtube-timestamps-generator-api.p.rapidapi.com" \ -H "x-rapidapi-key: YOUR_RAPIDAPI_KEY"Endpoints
Section titled “Endpoints”API Information
Section titled “API Information”GET /Get API information and usage instructions.
Response:
{ "name": "YouTube Timestamps Generator API", "version": "1.0.0", "description": "Generate Timestamps from any YouTube URL.", "endpoints": { "POST /generate": "Generate timestamps from YouTube URL (use query parameter: ?url=VIDEO_URL)", "GET /health": "Health check" }, "example": { "method": "POST", "endpoint": "/generate?url=https://www.youtube.com/watch?v=z_bX3runikk" }}Health Check
Section titled “Health Check”GET /healthCheck if the API is operational.
Response:
{ "status": "ok", "timestamp": 1704067200000}Generate Timestamps
Section titled “Generate Timestamps”POST /generateGenerate AI-Driven chapter timestamps from a YouTube video.
Query Parameters Required
All parameters must be sent as query parameters in the URL, not in the request body.
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Full YouTube video URL |
Successful Response (200 OK):
{ "success": true, "video_id": "z_bX3runikk", "video_title": "Matthew McConaughey's Concerns Over AI", "video_duration": 914, "detected_language": "en", "language_name": "English", "processing_time_ms": 4567, "timestamps": [ { "time": "0:00", "seconds": 0, "title": "Introduction", "description": "Opening scene" } ], "youtube_description_format": "0:00 Introduction\n...", "total_chapters": 8}Response Fields:
| Field | Type | Description |
|---|---|---|
success | boolean | Whether the request was successful |
video_id | string | YouTube video ID |
video_title | string | Title of the video |
video_duration | integer | Video duration in seconds |
detected_language | string | Detected language code |
language_name | string | Full language name |
processing_time_ms | integer | Processing time in milliseconds |
timestamps | array | Array of timestamp objects |
youtube_description_format | string | Ready-to-paste YouTube description format |
total_chapters | integer | Number of chapters generated |
Supported YouTube URL Formats
Section titled “Supported YouTube URL Formats”The API accepts various YouTube URL formats:
https://www.youtube.com/watch?v=VIDEO_IDhttps://youtu.be/VIDEO_IDhttps://www.youtube.com/shorts/VIDEO_IDhttps://www.youtube.com/embed/VIDEO_IDhttps://www.youtube.com/v/VIDEO_ID
Language Support
Section titled “Language Support”Common language codes:
en- Englishes- Spanishfr- Frenchde- Germanit- Italianpt- Portugueseja- Japaneseko- Koreanzh- Chineseru- Russian
Error Responses
Section titled “Error Responses”400 Bad Request
Section titled “400 Bad Request”Missing URL:
{ "error": "URL is required as query parameter: ?url=VIDEO_URL"}Invalid YouTube URL:
{ "error": "Invalid YouTube URL"}403 Forbidden
Section titled “403 Forbidden”Not from RapidAPI:
{ "error": "Forbidden - Access only through RapidAPI"}500 Internal Server Error
Section titled “500 Internal Server Error”No Captions Available:
{ "success": false, "error": "Could not fetch subtitles: No captions available for this video", "video_id": "z_bX3runikk", "suggestion": "Make sure the video has captions/subtitles enabled."}Pricing Plans
Section titled “Pricing Plans”- Price: $1.99/month
- Monthly Requests: 100 (Hard Limit)
- Rate Limit: 10 requests/hour
- Price: $7.99/month
- Monthly Requests: 1,000 (Hard Limit)
- Rate Limit: 40 requests/hour
- Price: $24.99/month
- Monthly Requests: 5,000 (Hard Limit)
- Rate Limit: 80 requests/hour
- Price: $99.99/month
- Monthly Requests: 20,000 (Hard Limit)
- Rate Limit: 150 requests/hour
Best Practices
Section titled “Best Practices”1. Use Query Parameters
Section titled “1. Use Query Parameters”Always pass parameters in the URL as query parameters:
const videoUrl = 'https://www.youtube.com/watch?v=z_bX3runikk';const apiUrl = `https://youtube-timestamps-generator-api.p.rapidapi.com/generate?url=${encodeURIComponent(videoUrl)}`;2. Copy-Paste to YouTube
Section titled “2. Copy-Paste to YouTube”The youtube_description_format field provides timestamps in YouTube’s required format. Simply copy and paste into your video description.
Code Examples
Section titled “Code Examples”JavaScript (Fetch)
Section titled “JavaScript (Fetch)”async function generateTimestamps(videoUrl) { const apiUrl = `https://youtube-timestamps-generator-api.p.rapidapi.com/generate?url=${encodeURIComponent(videoUrl)}`;
const response = await fetch(apiUrl, { method: 'POST', headers: { 'x-rapidapi-key': 'YOUR_RAPIDAPI_KEY', 'x-rapidapi-host': 'youtube-timestamps-generator-api.p.rapidapi.com' } });
const data = await response.json();
if (data.success) { console.log(`Generated ${data.total_chapters} chapters`); console.log(data.youtube_description_format); return data; } else { throw new Error(data.error); }}
generateTimestamps('https://www.youtube.com/watch?v=z_bX3runikk') .then(result => console.log(result.timestamps)) .catch(error => console.error(error));Python (Requests)
Section titled “Python (Requests)”import requestsfrom urllib.parse import urlencode, quote
def generate_timestamps(video_url): base_url = 'https://youtube-timestamps-generator-api.p.rapidapi.com/generate' params = {'url': video_url}
headers = { 'x-rapidapi-key': 'YOUR_RAPIDAPI_KEY', 'x-rapidapi-host': 'youtube-timestamps-generator-api.p.rapidapi.com' }
url = f"{base_url}?{urlencode(params, quote_via=quote)}" response = requests.post(url, headers=headers) data = response.json()
if data.get('success'): print(f"Generated {data['total_chapters']} chapters") print(data['youtube_description_format']) return data else: raise Exception(data.get('error'))
result = generate_timestamps('https://www.youtube.com/watch?v=z_bX3runikk')Node.js (Axios)
Section titled “Node.js (Axios)”const axios = require('axios');
async function generateTimestamps(videoUrl) { const encodedUrl = encodeURIComponent(videoUrl); const url = `https://youtube-timestamps-generator-api.p.rapidapi.com/generate?url=${encodedUrl}`;
const response = await axios.post(url, null, { headers: { 'x-rapidapi-key': 'YOUR_RAPIDAPI_KEY', 'x-rapidapi-host': 'youtube-timestamps-generator-api.p.rapidapi.com' } });
if (response.data.success) { console.log(`Generated ${response.data.total_chapters} chapters`); return response.data; }}
generateTimestamps('https://www.youtube.com/shorts/ivTdEQ6wseU') .then(result => console.log(result.youtube_description_format)) .catch(console.error);<?php
function generateTimestamps($videoUrl) { $encodedUrl = urlencode($videoUrl); $url = "https://youtube-timestamps-generator-api.p.rapidapi.com/generate?url={$encodedUrl}";
$headers = [ 'x-rapidapi-key: YOUR_RAPIDAPI_KEY', 'x-rapidapi-host: youtube-timestamps-generator-api.p.rapidapi.com' ];
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch); curl_close($ch);
$data = json_decode($response, true);
if ($data['success']) { echo "Generated {$data['total_chapters']} chapters\n"; echo $data['youtube_description_format']; return $data; } else { throw new Exception($data['error']); }}
$result = generateTimestamps('https://www.youtube.com/watch?v=z_bX3runikk');?>require 'net/http'require 'json'require 'uri'
def generate_timestamps(video_url) encoded_url = URI.encode_www_form_component(video_url) url = URI("https://youtube-timestamps-generator-api.p.rapidapi.com/generate?url=#{encoded_url}")
http = Net::HTTP.new(url.host, url.port) http.use_ssl = true
request = Net::HTTP::Post.new(url) request['x-rapidapi-key'] = 'YOUR_RAPIDAPI_KEY' request['x-rapidapi-host'] = 'youtube-timestamps-generator-api.p.rapidapi.com'
response = http.request(request) data = JSON.parse(response.body)
if data['success'] puts "Generated #{data['total_chapters']} chapters" puts data['youtube_description_format'] return data else raise StandardError, data['error'] endend
result = generate_timestamps('https://www.youtube.com/watch?v=z_bX3runikk')Support
Section titled “Support”Need help?
- Email: support@cliperly.com
Terms of Use
Section titled “Terms of Use”By using this API, you agree to:
- Use the service only through RapidAPI
- Not exceed your plan’s rate limits
- Comply with YouTube’s Terms of Service
- Use AI-generated timestamps responsibly
Last updated: October 2025