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:3000

Authentication

Token-based

Format

JSON

Available Endpoints
GET/api/video-details/:videoId

Get comprehensive details for a YouTube video including metadata, thumbnails, and optional multi-language captions.

Parameters:

videoId (required)YouTube video ID
token (required)API authentication token
includeCaptions (optional)Include captions (default: false)
lang (optional)Language code filter (omit for all languages)
GET/health

Health 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-here

Authorization Header

Authorization: Bearer your-secret-token-here
Usage 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)"
  }
}