API Documentation
YouTube Video Details API
Comprehensive API documentation and usage examples
API Overview
Version 2.0.0 - Get comprehensive YouTube video details with multi-language caption support
Base URL
http://localhost:3000Authentication
Token-based
Format
JSON
Available Endpoints
GET
/api/video-details/:videoIdGet comprehensive details for a YouTube video including metadata, thumbnails, and optional multi-language captions.
Parameters:
videoId (required)YouTube video IDtoken (required)API authentication tokenincludeCaptions (optional)Include captions (default: false)lang (optional)Language code filter (omit for all languages)GET
/healthHealth check endpoint to verify API status. No authentication required.
GET
/API information and comprehensive documentation endpoint.
Authentication
The API uses token-based authentication. You can provide your token in two ways:
Query Parameter
?token=your-secret-token-hereAuthorization Header
Authorization: Bearer your-secret-token-hereUsage Examples
Basic Video Details
http://localhost:3000/api/video-details/dQw4w9WgXcQ?token=your-token
With English Captions
http://localhost:3000/api/video-details/dQw4w9WgXcQ?includeCaptions=true&lang=en&token=your-token
All Available Languages
http://localhost:3000/api/video-details/dQw4w9WgXcQ?includeCaptions=true&token=your-token
Spanish Captions Only
http://localhost:3000/api/video-details/dQw4w9WgXcQ?includeCaptions=true&lang=es&token=your-token
Key Features
Video Metadata
- • Title, description, and thumbnails
- • View counts and duration
- • Channel information
- • Keywords and tags
Caption Features
- • Multi-language caption support
- • Returns ALL available languages
- • Language filtering capability
- • Auto-generated caption detection
- • Detailed timing information
Response Format
{
"videoId": "dQw4w9WgXcQ",
"includeCaptions": true,
"videoDetails": {
"title": "Rick Astley - Never Gonna Give You Up",
"description": "The official video...",
"videoId": "dQw4w9WgXcQ",
"thumbnail": {
"thumbnails": [
{
"url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg",
"width": 1280,
"height": 720
}
]
},
"viewCount": "1675000000",
"author": "Rick Astley",
"channelId": "UCuAXFkgsw1L7xaCfnd5JJOw"
},
"captionsInfo": {
"included": true,
"success": true,
"requestedLanguage": "en",
"captionTracks": [
{
"language": "English",
"languageCode": "en",
"isAutoGenerated": false,
"subtitles": [
{
"start": "18.64",
"dur": "3.24",
"text": "We're no strangers to love"
},
{
"start": "22.64",
"dur": "4.32",
"text": "You know the rules and so do I"
}
]
},
{
"language": "Spanish (Latin America)",
"languageCode": "es-419",
"isAutoGenerated": false,
"subtitles": [...]
}
],
"availableLanguages": [
{
"language": "English",
"languageCode": "en",
"isAutoGenerated": false,
"subtitleCount": 61
},
{
"language": "Spanish (Latin America)",
"languageCode": "es-419",
"isAutoGenerated": false,
"subtitleCount": 60
}
],
"returnedLanguages": [
{
"language": "English",
"languageCode": "en",
"isAutoGenerated": false,
"subtitleCount": 61
}
],
"message": "Found captions in 2 languages: English (en), Spanish (Latin America) (es-419)"
}
}