Skip to content

Quick Start Guide

This guide will help you make your first API call in under 5 minutes. Let’s get started!

Before you begin, you’ll need:

  1. A RapidAPI account (free to create)
  2. An active subscription to one of our APIs
  3. Your RapidAPI key

  1. Go to RapidAPI and sign in
  2. Subscribe to one of our APIs (start with the free tier!)
  3. Navigate to the API’s Endpoints page
  4. Find your API Key in the header parameters section
  5. Copy the key - you’ll need it for all requests

Your key will look like this:

x-rapidapi-key: a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6

Select the API that best fits your needs:

Best for: Extracting subtitles in various formats

Terminal window
curl -X POST "https://youtube-subtitles-downloader-api.p.rapidapi.com/download?url=https://www.youtube.com/watch?v=z_bX3runikk&format=srt&language=en" \
-H "x-rapidapi-key: YOUR_RAPIDAPI_KEY" \
-H "x-rapidapi-host: youtube-subtitles-downloader-api.p.rapidapi.com"

Best for: AI-Driven video summaries

Terminal window
curl -X POST "https://youtube-summarizer-api1.p.rapidapi.com/summarize?url=https://www.youtube.com/watch?v=z_bX3runikk&type=brief&language=en" \
-H "x-rapidapi-key: YOUR_RAPIDAPI_KEY" \
-H "x-rapidapi-host: youtube-summarizer-api1.p.rapidapi.com"

Best for: Automatic chapter creation

Terminal window
curl -X POST "https://youtube-timestamps-generator-api.p.rapidapi.com/generate?url=https://www.youtube.com/watch?v=z_bX3runikk" \
-H "x-rapidapi-key: YOUR_RAPIDAPI_KEY" \
-H "x-rapidapi-host: youtube-timestamps-generator-api.p.rapidapi.com"

Let’s make a simple request using different methods:

Terminal window
curl -X POST "https://youtube-subtitles-downloader-api.p.rapidapi.com/download?url=https://www.youtube.com/watch?v=z_bX3runikk&format=srt&language=en" \
-H "x-rapidapi-key: YOUR_RAPIDAPI_KEY" \
-H "x-rapidapi-host: youtube-subtitles-downloader-api.p.rapidapi.com"
async function testAPI() {
const videoUrl = encodeURIComponent('https://www.youtube.com/watch?v=z_bX3runikk');
const url = `https://youtube-subtitles-downloader-api.p.rapidapi.com/download?url=${videoUrl}&format=srt&language=en`;
const response = await fetch(url, {
method: 'POST',
headers: {
'x-rapidapi-key': 'YOUR_RAPIDAPI_KEY',
'x-rapidapi-host': 'youtube-subtitles-downloader-api.p.rapidapi.com'
}
});
const data = await response.json();
console.log(data);
}
testAPI();
import requests
from urllib.parse import urlencode, quote
video_url = 'https://www.youtube.com/watch?v=z_bX3runikk'
base_url = 'https://youtube-subtitles-downloader-api.p.rapidapi.com/download'
params = {
'url': video_url,
'format': 'srt',
'language': 'en'
}
headers = {
'x-rapidapi-key': 'YOUR_RAPIDAPI_KEY',
'x-rapidapi-host': 'youtube-subtitles-downloader-api.p.rapidapi.com'
}
url = f"{base_url}?{urlencode(params, quote_via=quote)}"
response = requests.post(url, headers=headers)
print(response.json())
<?php
$videoUrl = urlencode('https://www.youtube.com/watch?v=z_bX3runikk');
$url = "https://youtube-subtitles-downloader-api.p.rapidapi.com/download?url={$videoUrl}&format=srt&language=en";
$headers = [
'x-rapidapi-key: YOUR_RAPIDAPI_KEY',
'x-rapidapi-host: youtube-subtitles-downloader-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);
echo $response;
?>

{
"success": true,
"video_id": "z_bX3runikk",
"video_title": "Matthew McConaughey's Concerns Over AI",
"video_duration": 914,
"language": "en",
"format": "srt",
"total_segments": 469,
"total_characters": 15409,
"processing_time_ms": 1234,
"subtitles": "1\n00:00:00,000 --> 00:00:02,500\nIn this episode..."
}
{
"error": "Invalid YouTube URL"
}

Problem: Your API key is incorrect or not properly formatted.

Solution:

  1. Double-check your API key from RapidAPI
  2. Ensure you’re using the correct header name: x-rapidapi-key
  3. Verify you’ve subscribed to the API on RapidAPI

Problem: You’ve made too many requests in the current time window.

Solution:

  1. Check your plan’s rate limits
  2. Implement request throttling
  3. Consider upgrading to a higher plan

Problem: The URL format is not recognized.

Solution: Use complete YouTube URLs in these formats:

  • https://www.youtube.com/watch?v=VIDEO_ID
  • https://youtu.be/VIDEO_ID
  • https://www.youtube.com/shorts/VIDEO_ID

Problem: The video doesn’t have subtitles/captions.

Solution:

  • Verify the video has captions on YouTube
  • Try a different video for testing
  • Check if captions are available in your requested language

Now that you’ve made your first successful request, here’s what to do next:

Each API has multiple features and options. Check out:

  • Different output formats (for Subtitles API)
  • Various summary types (for Summarizer API)
  • Timestamp customization (for Timestamps API)

Implement robust error handling in your application:

async function safeAPICall(url, options) {
try {
const response = await fetch(url, options);
if (!response.ok) {
const error = await response.json();
throw new Error(error.error || 'API request failed');
}
return await response.json();
} catch (error) {
console.error('API Error:', error.message);
throw error;
}
}

Save API calls and improve performance with caching:

const cache = new Map();
const CACHE_DURATION = 3600000;
async function cachedAPICall(cacheKey, apiCall) {
const cached = cache.get(cacheKey);
if (cached && Date.now() - cached.timestamp < CACHE_DURATION) {
return cached.data;
}
const data = await apiCall();
cache.set(cacheKey, { data, timestamp: Date.now() });
return data;
}

Keep track of your API usage to avoid hitting limits:

let requestCount = 0;
let resetTime = Date.now() + 3600000;
function canMakeRequest(maxRequests) {
if (Date.now() > resetTime) {
requestCount = 0;
resetTime = Date.now() + 3600000;
}
return requestCount < maxRequests;
}
async function rateLimitedRequest(apiCall, maxRequests = 100) {
if (!canMakeRequest(maxRequests)) {
throw new Error('Rate limit would be exceeded');
}
requestCount++;
return await apiCall();
}

Example 1: Build a Subtitle Downloader Tool

Section titled “Example 1: Build a Subtitle Downloader Tool”
async function downloadSubtitles(videoUrl, format = 'srt') {
const encodedUrl = encodeURIComponent(videoUrl);
const url = `https://youtube-subtitles-downloader-api.p.rapidapi.com/download?url=${encodedUrl}&format=${format}&language=en`;
const response = await fetch(url, {
method: 'POST',
headers: {
'x-rapidapi-key': 'YOUR_RAPIDAPI_KEY',
'x-rapidapi-host': 'youtube-subtitles-downloader-api.p.rapidapi.com'
}
});
const data = await response.json();
if (data.success) {
const blob = new Blob([data.subtitles], { type: 'text/plain' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = `subtitles.${format}`;
a.click();
}
}
async function getVideoSummary(videoUrl, summaryType = 'brief') {
const encodedUrl = encodeURIComponent(videoUrl);
const url = `https://youtube-summarizer-api1.p.rapidapi.com/summarize?url=${encodedUrl}&type=${summaryType}&language=en`;
const response = await fetch(url, {
method: 'POST',
headers: {
'x-rapidapi-key': 'YOUR_RAPIDAPI_KEY',
'x-rapidapi-host': 'youtube-summarizer-api1.p.rapidapi.com'
}
});
const data = await response.json();
if (data.success) {
return {
title: data.video_title,
summary: data.summary,
language: data.language_name,
duration: data.video_duration
};
}
}
async function generateChapters(videoUrl) {
const encodedUrl = encodeURIComponent(videoUrl);
const url = `https://youtube-timestamps-generator-api.p.rapidapi.com/generate?url=${encodedUrl}`;
const response = await fetch(url, {
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) {
return {
chapters: data.timestamps,
youtubeFormat: data.youtube_description_format,
totalChapters: data.total_chapters
};
}
}

These videos are verified to work with all APIs:

  • Long video: https://www.youtube.com/watch?v=z_bX3runikk (15 min)
  • YouTube Short: https://www.youtube.com/shorts/ivTdEQ6wseU (34 sec)
  1. Short Videos (< 5 minutes)
  2. Medium Videos (5-30 minutes)
  3. Long Videos (30+ minutes, based on your plan)
  4. Different Languages
  5. YouTube Shorts

Before making requests, verify the API is operational:

async function checkAPIHealth(apiHost) {
const response = await fetch(`https://${apiHost}/health`, {
headers: {
'x-rapidapi-key': 'YOUR_RAPIDAPI_KEY',
'x-rapidapi-host': apiHost
}
});
return await response.json();
}
console.log(await checkAPIHealth('youtube-subtitles-downloader-api.p.rapidapi.com'));

Process multiple videos concurrently:

async function processMultipleVideos(urls) {
const promises = urls.map(url => downloadSubtitles(url));
const results = await Promise.allSettled(promises);
return results.map((result, index) => ({
url: urls[index],
success: result.status === 'fulfilled',
data: result.status === 'fulfilled' ? result.value : null,
error: result.status === 'rejected' ? result.reason : null
}));
}

Queue requests to respect rate limits:

class APIQueue {
constructor(maxConcurrent = 5, delayMs = 1000) {
this.queue = [];
this.active = 0;
this.maxConcurrent = maxConcurrent;
this.delayMs = delayMs;
}
async add(apiCall) {
while (this.active >= this.maxConcurrent) {
await new Promise(resolve => setTimeout(resolve, 100));
}
this.active++;
try {
const result = await apiCall();
await new Promise(resolve => setTimeout(resolve, this.delayMs));
return result;
} finally {
this.active--;
}
}
}
const queue = new APIQueue(5, 1000);
const result = await queue.add(() => downloadSubtitles(videoUrl));

Before contacting support, verify:

  • You have an active RapidAPI subscription
  • Your API key is correct and properly formatted
  • You’re using the correct API host in headers
  • The YouTube URL is valid and complete
  • The video has captions/subtitles available
  • You haven’t exceeded your rate limits
  • You’re sending parameters as query parameters in the URL
  • Required parameters are properly URL-encoded

If you’re stuck, we’re here to help:

support@cliperly.com


Now that you’re up and running:

  1. Read the full documentation for your chosen API
  2. Explore advanced features and options
  3. Build something awesome!
  4. Share your project with the community

Ready to dive deeper?


Happy coding!