API Documentation

Learn how to integrate Subtube API into your application.

Quick Start

curl -X GET "https://subtube.app/api/v1/transcribe/?videoUrl=https://www.youtube.com/watch?v=dQw4w9WgXcQ" \
  -H "Authorization: Bearer YOUR_API_KEY"
const videoUrl = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ';
const url = `https://subtube.app/api/v1/transcribe/?videoUrl=${encodeURIComponent(videoUrl)}`;

const response = await fetch(url, {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
  }
});

const data = await response.json();
console.log(data);
import requests
from urllib.parse import urlencode

video_url = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'
params = {'videoUrl': video_url}
url = f'https://subtube.app/api/v1/transcribe/?{urlencode(params)}'

headers = {
    'Authorization': 'Bearer YOUR_API_KEY'
}

response = requests.get(url, headers=headers)
print(response.json())
<?php
$videoUrl = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ';
$url = 'https://subtube.app/api/v1/transcribe/?videoUrl=' . urlencode($videoUrl);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer YOUR_API_KEY'
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
print_r($data);

📝 Don't have an API key yet? Create one here

Response

{
  "success": true,
  "videoId": "dQw4w9WgXcQ",
  "language": "en",
  "isAutoGenerated": false,
  "subtitles": [
    {
      "start": 0.0,
      "end": 2.5,
      "text": "First subtitle line"
    },
    {
      "start": 2.5,
      "end": 5.0,
      "text": "Second subtitle line"
    }
  ]
}

Error Codes

CodeDescription
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
403Forbidden - API key is inactive or revoked
404Not Found - Video not found or subtitles unavailable
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Something went wrong on our end

Need Help?

If you have questions or need assistance, check out our request history to debug issues or contact support.