### JSON Format Output Example Source: https://transcriptapi.com/docs/mcp Example of the structured JSON output for a YouTube transcript, containing transcript segments with text, start time, and duration, along with optional metadata. ```json { "transcript": [ { "text": "First line of transcript", "start": 0.0, "duration": 3.5 }, { "text": "Second line of transcript", "start": 3.5, "duration": 3.7 } ], "metadata": { "title": "Video Title Here", "author_name": "Channel Name", "author_url": "https://www.youtube.com/@ChannelName", "thumbnail_url": "https://i.ytimg.com/vi/VIDEO_ID/hqdefault.jpg" } } ``` -------------------------------- ### Fetch YouTube Playlist Videos (cURL Examples) Source: https://transcriptapi.com/docs/api Examples of how to call the playlist videos endpoint using cURL, demonstrating requests with a playlist ID, playlist URL, and for fetching the next page using a continuation token. ```curl # First page (using playlist ID) curl -X GET "https://transcriptapi.com/api/v2/youtube/playlist/videos?playlist=PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf" \ -H "Authorization: Bearer YOUR_API_KEY" ``` ```curl # First page (using playlist URL) curl -X GET "https://transcriptapi.com/api/v2/youtube/playlist/videos?playlist=https://www.youtube.com/playlist?list=PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf" \ -H "Authorization: Bearer YOUR_API_KEY" ``` ```curl # Next page curl -X GET "https://transcriptapi.com/api/v2/youtube/playlist/videos?continuation=4qmFsgKlARIYVVV1QVhGa2dz..." \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Search Endpoint cURL Example Source: https://transcriptapi.com/docs/api Example of how to call the YouTube search endpoint using cURL, including query parameters and authorization header. ```bash curl -X GET "https://transcriptapi.com/api/v2/youtube/search?q=python+tutorial&type=video&limit=10" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Resolve Channel cURL Example Source: https://transcriptapi.com/docs/api Example of how to use cURL to call the resolve channel endpoint with a handle as input. ```bash curl -X GET "https://transcriptapi.com/api/v2/youtube/channel/resolve?input=@TED" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Transcript JSON Response Example Source: https://transcriptapi.com/docs/api This is an example of the structured JSON response when fetching a transcript with default settings. ```json { "video_id": "dQw4w9WgXcQ", "language": "en", "transcript": [ { "text": "Never gonna give you up", "start": 0.0, "duration": 4.12 }, { "text": "Never gonna let you down", "start": 4.12, "duration": 3.85 } ] } ``` -------------------------------- ### Text Format Output Example Source: https://transcriptapi.com/docs/mcp Example of the markdown-formatted text output for a YouTube transcript, including an optional metadata header and timestamped transcript lines. ```text # Metadata ## Title: Video Title Here ## Author: Channel Name ## Author URL: https://www.youtube.com/@ChannelName ## Thumbnail: https://i.ytimg.com/vi/VIDEO_ID/hqdefault.jpg # Transcript [0.0s] First line of transcript [3.5s] Second line of transcript [7.2s] Third line of transcript ``` -------------------------------- ### Rate Limit Headers Example Source: https://transcriptapi.com/docs/api Illustrates the format of rate limit information provided in response headers, including the total limit, remaining requests, and the reset time. ```http X-RateLimit-Limit: 200 X-RateLimit-Remaining: 195 X-RateLimit-Reset: 1678901234 ``` -------------------------------- ### Node.js: Fetch YouTube Transcript Source: https://transcriptapi.com/docs/api Node.js example using fetch to retrieve YouTube transcripts. Includes error handling for common API responses and options for metadata and format. ```javascript // Using native fetch (Node.js 18+) or install node-fetch for older versions const API_KEY = 'YOUR_API_KEY'; const BASE_URL = 'https://transcriptapi.com/api/v2'; async function getTranscript(videoUrl, options = {}) { const { format = 'json', includeTimestamp = true, sendMetadata = false } = options; const params = new URLSearchParams({ video_url: videoUrl, format: format, include_timestamp: includeTimestamp, send_metadata: sendMetadata }); try { const response = await fetch( `${BASE_URL}/youtube/transcript?${params}`, { headers: { 'Authorization': `Bearer ${API_KEY}` } } ); if (!response.ok) { const error = await response.json(); if (response.status === 402) { console.error('Payment required:', error.detail.message); console.error('Action:', error.detail.action_url); } else if ([408, 429, 503].includes(response.status)) { // Retryable errors - implement backoff const retryAfter = response.headers.get('Retry-After') || '5'; console.error(`Retryable error (${response.status}). Retry after ${retryAfter} seconds`); } else if (response.status === 404) { console.error('Video not found or has no transcript available'); } else { console.error('API Error:', error.detail); } throw new Error(error.detail); } const data = await response.json(); // Process transcript based on format if (format === 'json' && includeTimestamp) { data.transcript.forEach(segment => { console.log(`[${segment.start}s] ${segment.text}`); }); } return data; } catch (error) { console.error('Error fetching transcript:', error); throw error; } } // Example usage with async/await (async () => { try { // Basic usage const transcript = await getTranscript('dQw4w9WgXcQ'); console.log('Video ID:', transcript.video_id); // With metadata const withMetadata = await getTranscript( 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', { sendMetadata: true } ); if (withMetadata.metadata) { console.log('Title:', withMetadata.metadata.title); console.log('Author:', withMetadata.metadata.author_name); } // Text format without timestamps const plainText = await getTranscript('dQw4w9WgXcQ', { format: 'text', includeTimestamp: false }); console.log('Plain text:', plainText.transcript); } catch (error) { // Error already logged } })(); ``` -------------------------------- ### Browser JavaScript: Fetch YouTube Transcript Source: https://transcriptapi.com/docs/api Browser-based JavaScript example using the Fetch API to get YouTube transcripts. It includes detailed error handling for various HTTP status codes and network issues. ```javascript // Browser JavaScript with Fetch API const API_KEY = 'YOUR_API_KEY'; const BASE_URL = 'https://transcriptapi.com/api/v2'; async function getYouTubeTranscript(videoUrl, options = {}) { const { format = 'json', includeTimestamp = true, sendMetadata = false } = options; const params = new URLSearchParams({ video_url: videoUrl, format: format, include_timestamp: includeTimestamp, send_metadata: sendMetadata }); try { const response = await fetch( `${BASE_URL}/youtube/transcript?${params}`, { method: 'GET', headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' } } ); if (!response.ok) { const error = await response.json(); // Handle specific error cases switch (response.status) { case 401: throw new Error('Invalid API key'); case 402: // Show payment required UI window.location.href = error.detail.action_url; break; case 404: throw new Error('Video not found or has no transcript'); case 408: case 503: // Retryable - temporary failure throw new Error('Temporary failure. Please retry in a few seconds.'); case 429: const retryAfter = response.headers.get('Retry-After'); throw new Error(`Rate limited. Retry after ${retryAfter}s`); default: throw new Error(error.detail || 'API request failed'); } } return await response.json(); } catch (error) { console.error('Transcript fetch error:', error); // Display user-friendly error if (error.message.includes('Failed to fetch')) { throw new Error('Network error. Please check your connection.'); } throw error; } } // Example: Display transcript in DOM async function displayTranscript(videoUrl) { const container = document.getElementById('transcript-container'); ``` -------------------------------- ### GET /youtube/search Source: https://transcriptapi.com/docs/api Searches YouTube videos or channels. ```APIDOC ## GET /youtube/search ### Description Search YouTube videos or channels. ### Method GET ### Endpoint /youtube/search ### Parameters #### Query Parameters - **query** (string) - Required - The search query. - **max_results** (integer) - Optional - The maximum number of results to return. ### Response #### Success Response (200) - **items** (array) - An array of search results. - **title** (string) - The title of the video or channel. - **url** (string) - The URL of the video or channel. - **thumbnail** (string) - The URL of the thumbnail. - **type** (string) - The type of result (video or channel). ### Request Example ``` curl -X GET "https://transcriptapi.com/api/v2/youtube/search?query=example+search&max_results=10" \ -H "Authorization: Bearer YOUR_API_KEY" ``` ``` -------------------------------- ### Search YouTube for Videos Source: https://transcriptapi.com/docs/mcp/chatgpt Use this prompt to search YouTube for specific topics and get a summary of the top results. Specify your search query. ```text Search YouTube for "quantum computing explained" and tell me what the top results cover. ``` -------------------------------- ### GET /youtube/channel/videos Source: https://transcriptapi.com/docs/api Retrieves a paginated list of videos uploaded by a YouTube channel. ```APIDOC ## GET /youtube/channel/videos ### Description Paginated channel uploads. Accepts @handle, URL, or UC... ID. ### Method GET ### Endpoint /youtube/channel/videos ### Parameters #### Query Parameters - **channel** (string) - Required - The channel identifier (@handle, URL, or UC... ID). - **page_token** (string) - Optional - Token for the next page of results. - **results_per_page** (integer) - Optional - Number of results per page. Default: 50. ### Response #### Success Response (200) - **items** (array) - An array of video items. - **title** (string) - The title of the video. - **url** (string) - The URL of the video. - **thumbnail** (string) - The URL of the thumbnail. - **next_page_token** (string) - Token for the next page of results, if available. ### Request Example ``` curl -X GET "https://transcriptapi.com/api/v2/youtube/channel/videos?channel=@MrBeast&results_per_page=10" \ -H "Authorization: Bearer YOUR_API_KEY" ``` ``` -------------------------------- ### GET /youtube/playlist/videos Source: https://transcriptapi.com/docs/api Retrieves a paginated list of videos within a YouTube playlist. ```APIDOC ## GET /youtube/playlist/videos ### Description Paginated playlist videos. Accepts URL or playlist ID. ### Method GET ### Endpoint /youtube/playlist/videos ### Parameters #### Query Parameters - **playlist_url_or_id** (string) - Required - The playlist URL or ID. - **page_token** (string) - Optional - Token for the next page of results. - **results_per_page** (integer) - Optional - Number of results per page. Default: 50. ### Response #### Success Response (200) - **items** (array) - An array of video items within the playlist. - **title** (string) - The title of the video. - **url** (string) - The URL of the video. - **thumbnail** (string) - The URL of the thumbnail. - **next_page_token** (string) - Token for the next page of results, if available. ### Request Example ``` curl -X GET "https://transcriptapi.com/api/v2/youtube/playlist/videos?playlist_url_or_id=PL...&results_per_page=10" \ -H "Authorization: Bearer YOUR_API_KEY" ``` ``` -------------------------------- ### GET /youtube/channel/resolve Source: https://transcriptapi.com/docs/api Resolves a YouTube channel @handle or URL to its channel ID. ```APIDOC ## GET /youtube/channel/resolve ### Description Resolve a YouTube channel @handle or URL to its channel ID. ### Method GET ### Endpoint /youtube/channel/resolve ### Parameters #### Query Parameters - **handle_or_url** (string) - Required - The channel @handle or URL. ### Response #### Success Response (200) - **channel_id** (string) - The resolved channel ID. ### Request Example ``` curl -X GET "https://transcriptapi.com/api/v2/youtube/channel/resolve?handle_or_url=@MrBeast" \ -H "Authorization: Bearer YOUR_API_KEY" ``` ``` -------------------------------- ### GET /youtube/channel/latest Source: https://transcriptapi.com/docs/api Retrieves the latest 15 videos from a YouTube channel via RSS feed. ```APIDOC ## GET /youtube/channel/latest ### Description Latest 15 videos via RSS. Accepts @handle, URL, or UC... ID. ### Method GET ### Endpoint /youtube/channel/latest ### Parameters #### Query Parameters - **channel** (string) - Required - The channel identifier (@handle, URL, or UC... ID). ### Response #### Success Response (200) - **rss_feed** (string) - The RSS feed content containing the latest videos. ### Request Example ``` curl -X GET "https://transcriptapi.com/api/v2/youtube/channel/latest?channel=@MrBeast" \ -H "Authorization: Bearer YOUR_API_KEY" ``` ``` -------------------------------- ### GET /youtube/transcript Source: https://transcriptapi.com/docs/api Extracts the transcript for a given YouTube video. ```APIDOC ## GET /youtube/transcript ### Description Extracts the transcript for a given YouTube video. ### Method GET ### Endpoint /youtube/transcript ### Parameters #### Query Parameters - **video_url** (string) - Required - The YouTube video URL or video ID to fetch transcripts for. Accepted formats: Full YouTube URL, Short YouTube URL, Video ID only. - **format** (string) - Optional - The output format for the transcript response. Values: `json`, `text`. Default: `json`. - **include_timestamp** (boolean) - Optional - Whether to include timestamps in the transcript output. Default: `true`. - **send_metadata** (boolean) - Optional - Whether to include video metadata in the response. Default: `false`. ### Request Example ``` curl -X GET "https://transcriptapi.com/api/v2/youtube/transcript?video_url=dQw4w9WgXcQ" \ -H "Authorization: Bearer YOUR_API_KEY" ``` ### Response #### Success Response (200) - **video_id** (string) - The ID of the video. - **language** (string) - The language of the transcript. - **transcript** (array) - An array of transcript segments. - **text** (string) - The text of the transcript segment. - **start** (number) - The start time of the transcript segment in seconds. - **duration** (number) - The duration of the transcript segment in seconds. #### Response Example ```json { "video_id": "dQw4w9WgXcQ", "language": "en", "transcript": [ { "text": "Never gonna give you up", "start": 0.0, "duration": 4.12 }, { "text": "Never gonna let you down", "start": 4.12, "duration": 3.85 } ] } ``` ``` -------------------------------- ### GET /youtube/channel/search Source: https://transcriptapi.com/docs/api Searches for videos within a specific YouTube channel. ```APIDOC ## GET /youtube/channel/search ### Description Search within a YouTube channel. Accepts @handle, URL, or UC... ID. ### Method GET ### Endpoint /youtube/channel/search ### Parameters #### Query Parameters - **channel** (string) - Required - The channel identifier (@handle, URL, or UC... ID). - **query** (string) - Required - The search query within the channel. - **max_results** (integer) - Optional - The maximum number of results to return. ### Response #### Success Response (200) - **items** (array) - An array of video results within the channel. - **title** (string) - The title of the video. - **url** (string) - The URL of the video. - **thumbnail** (string) - The URL of the thumbnail. ### Request Example ``` curl -X GET "https://transcriptapi.com/api/v2/youtube/channel/search?channel=@MrBeast&query=giveaway&max_results=5" \ -H "Authorization: Bearer YOUR_API_KEY" ``` ``` -------------------------------- ### Python: Get YouTube Transcript Source: https://transcriptapi.com/docs/api Basic Python usage to fetch a YouTube transcript by video ID. Handles optional metadata retrieval. ```python if __name__ == "__main__": # Basic usage get_transcript("dQw4w9WgXcQ") # With metadata data = get_transcript( "https://www.youtube.com/watch?v=dQw4w9WgXcQ", send_metadata=True ) if data and "metadata" in data: print(f"Title: {data['metadata']['title']}") print(f"Author: {data['metadata']['author_name']}") ``` -------------------------------- ### Get YouTube Transcript as Markdown with Metadata Source: https://transcriptapi.com/docs/mcp Fetches the transcript for a given YouTube video URL in markdown format, including metadata like title and author. This is the default behavior. ```javascript // Get transcript as markdown with metadata (default) get_youtube_transcript({ video_url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ" }) ``` -------------------------------- ### Text Transcript with Timestamps Source: https://transcriptapi.com/docs/api A plain text response format for transcripts that includes the start time for each segment. ```text { "video_id": "dQw4w9WgXcQ", "language": "en", "transcript": "[0.0s] Never gonna give you up\n[4.12s] Never gonna let you down\n[7.97s] Never gonna run around and desert you" } ``` -------------------------------- ### Get YouTube Transcript Source: https://transcriptapi.com/docs/api Fetches the transcript of a YouTube video. Supports various formats and timestamp inclusion. ```APIDOC ## GET /api/v2/youtube/transcript ### Description Fetches the transcript of a YouTube video. Supports various formats and timestamp inclusion. ### Method GET ### Endpoint /api/v2/youtube/transcript ### Parameters #### Query Parameters - **video_url** (string) - Required - The URL or ID of the YouTube video. - **format** (string) - Optional - The desired output format ('json' or 'text'). Defaults to 'json'. - **include_timestamp** (boolean) - Optional - Whether to include timestamps in the transcript. Defaults to true. - **send_metadata** (boolean) - Optional - Whether to include metadata in the response. Defaults to false. ### Request Example ```bash curl -X GET "https://transcriptapi.com/api/v2/youtube/transcript?video_url=dQw4w9WgXcQ" \ -H "Authorization: Bearer YOUR_API_KEY" ``` ### Response #### Success Response (200) - **transcript** (object or string) - The transcript data, format depends on the 'format' parameter. #### Response Example (JSON with timestamps) ```json { "transcript": [ { "start": "0.123s", "text": "This is the first segment." }, { "start": "1.456s", "text": "This is the second segment." } ] } ``` #### Response Example (Text without timestamps) ``` This is the first segment. This is the second segment. ``` ``` -------------------------------- ### MCP Error Response Format Source: https://transcriptapi.com/docs/mcp Errors are returned in a JSON format that AI assistants can easily interpret. This example shows a typical error message related to insufficient credits. ```json { "content": "Unable to fetch transcript: Payment required. You have no credits remaining. Please purchase more credits at https://transcriptapi.com/dashboard/billing" } ``` -------------------------------- ### 402 Payment Required - No Active Plan Source: https://transcriptapi.com/docs/api Specific error format for payment issues when no active plan is found. Includes a message, reason, and a URL to guide the user to billing. ```json { "detail": { "message": "You don't have an active paid plan yet.", "reason": "no_active_paid_plan", "action_label": "Go to billing to choose a plan", "action_url": "https://transcriptapi.com/billing" } } ``` -------------------------------- ### Get YouTube Transcript (Browser) Source: https://transcriptapi.com/docs/api This function retrieves a YouTube video transcript using the browser's Fetch API. It handles various options and provides detailed error feedback suitable for web applications. ```APIDOC ## GET /youtube/transcript ### Description Retrieves the transcript for a given YouTube video URL using the browser's Fetch API. ### Method GET ### Endpoint `/youtube/transcript` ### Parameters #### Query Parameters - **video_url** (string) - Required - The URL or ID of the YouTube video. - **format** (string) - Optional - The desired output format ('json' or 'text'). Defaults to 'json'. - **include_timestamp** (boolean) - Optional - Whether to include timestamps for each transcript segment. Defaults to true. - **send_metadata** (boolean) - Optional - Whether to include video metadata (title, author) in the response. Defaults to false. ### Request Example ```javascript const API_KEY = 'YOUR_API_KEY'; const BASE_URL = 'https://transcriptapi.com/api/v2'; async function getYouTubeTranscript(videoUrl, options = {}) { const { format = 'json', includeTimestamp = true, sendMetadata = false } = options; const params = new URLSearchParams({ video_url: videoUrl, format: format, include_timestamp: includeTimestamp, send_metadata: sendMetadata }); try { const response = await fetch( `${BASE_URL}/youtube/transcript?${params}`, { method: 'GET', headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' } } ); if (!response.ok) { const error = await response.json(); // Handle specific error cases... throw new Error(error.detail || 'API request failed'); } return await response.json(); } catch (error) { console.error('Transcript fetch error:', error); throw error; } } // Example usage getYouTubeTranscript('dQw4w9WgXcQ', { sendMetadata: true }) .then(data => console.log(data)) .catch(error => console.error(error)); ``` ### Response #### Success Response (200) - **video_id** (string) - The ID of the video. - **transcript** (array) - An array of transcript segments. Each segment may contain 'start', 'end', and 'text' fields if `include_timestamp` is true, or just 'text' if false. - **metadata** (object) - Optional. Contains 'title' and 'author_name' if `send_metadata` is true. #### Response Example ```json { "video_id": "dQw4w9WgXcQ", "transcript": [ { "start": "0.0s", "end": "5.0s", "text": "Hello there!" } ], "metadata": { "title": "Example Video Title", "author_name": "Example Author" } } ``` ``` -------------------------------- ### Get Latest YouTube Channel Videos via RSS Source: https://transcriptapi.com/docs/api Retrieve the latest 15 videos from a YouTube channel using its RSS feed. This method provides exact publish timestamps and view counts and is free, with no credits charged. The channel can be specified by @handle, URL, or channel ID. ```http GET /youtube/channel/latest ``` ```json { "channel": { "channelId": "UCAuUUnT6oDeKwE6v1NGQxug", "title": "TED", "author": "TED", "url": "https://www.youtube.com/channel/UCAuUUnT6oDeKwE6v1NGQxug", "published": "2006-12-18T00:00:00Z" }, "results": [ { "videoId": "abc123xyz00", "title": "Latest Video Title", "channelId": "UCAuUUnT6oDeKwE6v1NGQxug", "author": "TED", "published": "2026-01-30T16:00:00Z", "updated": "2026-01-31T02:00:00Z", "link": "https://www.youtube.com/watch?v=abc123xyz00", "description": "Full video description...", "thumbnail": {"url": "https://i1.ytimg.com/vi/abc123xyz00/hqdefault.jpg", "width": "480", "height": "360"}, "viewCount": "2287630", "starRating": {"average": "4.92", "count": "45000", "min": "1", "max": "5"} } ], "result_count": 15 } ``` ```curl curl -X GET "https://transcriptapi.com/api/v2/youtube/channel/latest?channel=@TED" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### list_channel_videos Source: https://transcriptapi.com/docs/mcp List all videos in a channel with pagination (~100 per page). Costs 1 credit per page. ```APIDOC ## list_channel_videos ### Description List all videos in a channel with pagination (~100 per page). Costs 1 credit per page. ### Parameters #### Query Parameters - **channel** (string) - Required (first call) - Channel identifier: `@handle`, URL, or `UC...` ID - **continuation** (string) - Required (subsequent calls) - Pagination token from previous response *Provide either `channel` (first call) or `continuation` (next pages) — not both.* ### Request Example (First Call) ```javascript list_channel_videos({ channel: "@TED" }) ``` ### Response (First Call) #### Success Response (200) - **content.results** (array) - List of videos (~100 per page), each containing video_id, title, view_count, and published. - **content.continuation_token** (string) - Token for fetching the next page of results. - **content.has_more** (boolean) - Indicates if there are more results available. ### Response Example (First Call) ```json { "content": { "results": [ { "video_id": "ghi789", "title": "How AI could empower any business", "view_count": "800K views", "published": "2024-05-10" } ], "continuation_token": "Ehl...", "has_more": true } } ``` ### Request Example (Next Page) ```javascript list_channel_videos({ continuation: "Ehl..." }) ``` ``` -------------------------------- ### List All Videos in a Channel with Pagination Source: https://transcriptapi.com/docs/mcp List videos from a channel, supporting pagination. Provide the channel identifier for the first call or a continuation token for subsequent pages. This consumes one credit per page. ```javascript // First call — start listing list_channel_videos({ channel: "@TED" }) ``` ```javascript // Next page — use continuation token list_channel_videos({ continuation: "Ehl..." }) ``` -------------------------------- ### Summarize YouTube Video Transcript Source: https://transcriptapi.com/docs/mcp/chatgpt Use this prompt to fetch a YouTube video's transcript and have ChatGPT summarize its content. Ensure the video URL is correctly provided. ```text Fetch the transcript and summarize this TED talk for me: https://www.youtube.com/watch?v=UF8uR6Z6KLc ``` -------------------------------- ### cURL Request with All Parameters Source: https://transcriptapi.com/docs/api A cURL request demonstrating how to use all available parameters for fetching a YouTube transcript. ```curl # With all parameters curl -X GET "https://transcriptapi.com/api/v2/youtube/transcript?video_url=dQw4w9WgXcQ&format=json&include_timestamp=true&send_metadata=true" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### list_playlist_videos Source: https://transcriptapi.com/docs/mcp List videos in a YouTube playlist with pagination (~100 per page). Costs 1 credit per page. ```APIDOC ## list_playlist_videos ### Description List videos in a YouTube playlist with pagination (~100 per page). Costs 1 credit per page. ### Parameters #### Query Parameters - **playlist** (string) - Required (first call) - Playlist URL or ID starting with `PL`, `UU`, `LL`, `FL`, or `OL` - **continuation** (string) - Required (subsequent calls) - Pagination token from previous response *Provide either `playlist` (first call) or `continuation` (next pages) — not both.* ### Request Example (First Call) ```javascript list_playlist_videos({ playlist: "PLOGi5-fAu8bFIs_Lbp-MNwPKpPjBJGUzr" }) ``` ### Response (First Call) #### Success Response (200) - **content.results** (array) - List of videos (~100 per page), each containing video_id, title, channel, and published. - **content.continuation_token** (string) - Token for fetching the next page of results. - **content.has_more** (boolean) - Indicates if there are more results available. ### Response Example (First Call) ```json { "content": { "results": [ { "video_id": "jkl012", "title": "Introduction to Machine Learning", "channel": "TED-Ed", "published": "2024-02-15" } ], "continuation_token": "Qmx...", "has_more": true } } ``` ### Request Example (Next Page) ```javascript list_playlist_videos({ continuation: "Qmx..." }) ``` ``` -------------------------------- ### Browse YouTube Channel and Summarize Videos Source: https://transcriptapi.com/docs/mcp/chatgpt Retrieve the latest videos from a specified YouTube channel and summarize a set number of the most recent ones. Use the channel handle (e.g., @natgeo). ```text Show me the latest videos from @natgeo and summarize the 3 most recent ones. ``` -------------------------------- ### Process YouTube Playlist Source: https://transcriptapi.com/docs/mcp/chatgpt List all videos within a given YouTube playlist URL. Additionally, fetch the transcript for the first video and create study notes from it. ```text List the videos in this playlist: https://www.youtube.com/playlist?list=PLOGi5-fAu8bFIs_Lbp-MNwPKpPjBJGUzr Get the transcript for the first video and create study notes. ``` -------------------------------- ### Get YouTube Transcript Source: https://transcriptapi.com/docs/api Use this endpoint to extract transcripts from YouTube videos. Requires an API key for authentication. ```curl curl -X GET "https://transcriptapi.com/api/v2/youtube/transcript?video_url=dQw4w9WgXcQ" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Display YouTube Transcript and Metadata Source: https://transcriptapi.com/docs/api Fetches and displays the transcript and metadata for a given YouTube video URL. Handles loading states and errors. Requires a container element in the HTML to render the output. ```javascript const container = document.getElementById('transcript-container'); // Assuming you have a container with this ID const videoUrl = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'; // Example video URL async function displayTranscript(videoId) { container.innerHTML = 'Loading transcript...'; try { const data = await getYouTubeTranscript(videoUrl, { sendMetadata: true }); // Display metadata if available if (data.metadata) { container.innerHTML = `

${data.metadata.title}

By: ${data.metadata.author_name}

`; } // Display transcript const transcriptHtml = data.transcript .map(segment => `
[${segment.start}s] ${segment.text}
`) .join(''); container.innerHTML += `
${transcriptHtml}
`; } catch (error) { container.innerHTML = `
Error: ${error.message}
`; } } // Usage displayTranscript('dQw4w9WgXcQ'); ``` -------------------------------- ### List Videos in a YouTube Playlist with Pagination Source: https://transcriptapi.com/docs/mcp List videos from a YouTube playlist, supporting pagination. Provide the playlist URL or ID for the first call or a continuation token for subsequent pages. This consumes one credit per page. ```javascript // First call — start listing list_playlist_videos({ playlist: "PLOGi5-fAu8bFIs_Lbp-MNwPKpPjBJGUzr" }) ``` ```javascript // Next page — use continuation token list_playlist_videos({ continuation: "Qmx..." }) ``` -------------------------------- ### get_channel_latest_videos Source: https://transcriptapi.com/docs/mcp Get the ~15 most recent videos from a YouTube channel via RSS. Free — no credits consumed. ```APIDOC ## get_channel_latest_videos ### Description Get the ~15 most recent videos from a YouTube channel via RSS. Free — no credits consumed. ### Parameters #### Query Parameters - **channel** (string) - Required - Channel identifier: `@handle`, channel URL, or `UC...` ID ### Accepted Input Formats * Handle: `@TED` * URL: `https://www.youtube.com/@TED` * Channel ID: `UCsT0YIqwnpJCM-mx7-gSA4Q` ### Request Example ```javascript get_channel_latest_videos({ channel: "@TED" }) ``` ### Response #### Success Response (200) - **content.channel** (object) - Information about the channel, including name and URL. - **content.results** (array) - List of the most recent videos, each containing video_id, title, published, and thumbnail. ### Response Example ```json { "content": { "channel": { "name": "TED", "url": "https://www.youtube.com/channel/UCsT0YIqwnpJCM-mx7-gSA4Q" }, "results": [ { "video_id": "xyz789", "title": "The next breakthrough in AI", "published": "2024-06-01", "thumbnail": "https://i.ytimg.com/vi/xyz789/hqdefault.jpg" } ] } } ``` ``` -------------------------------- ### List Paginated Videos from YouTube Channel Source: https://transcriptapi.com/docs/api Retrieve videos uploaded to a channel, paginated at approximately 100 videos per page. Use the `channel` parameter for the first page and the `continuation` token from the previous response for subsequent pages. Only one of `channel` or `continuation` should be provided per request. ```http GET /youtube/channel/videos ``` ```json { "results": [ { "videoId": "abc123xyz00", "title": "Latest Video", "channelId": "UCAuUUnT6oDeKwE6v1NGQxug", "channelTitle": "TED", "channelHandle": "@TED", "lengthText": "15:22", "viewCountText": "3.2M views 2 weeks ago", "thumbnails": [...], "index": "0" } ], "playlist_info": { "title": "Uploads from TED", "numVideos": "5200", "description": "", "ownerName": "TED", "viewCount": null }, "continuation_token": "4qmFsgKlARIYVVV1QVhGa2dz...", "has_more": true } ``` ```curl # First page (using @handle) curl -X GET "https://transcriptapi.com/api/v2/youtube/channel/videos?channel=@TED" \ -H "Authorization: Bearer YOUR_API_KEY" # First page (using channel URL) curl -X GET "https://transcriptapi.com/api/v2/youtube/channel/videos?channel=https://www.youtube.com/@TED" \ -H "Authorization: Bearer YOUR_API_KEY" # Next page curl -X GET "https://transcriptapi.com/api/v2/youtube/channel/videos?continuation=4qmFsgKlARIYVVV1QVhGa2dz..." \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### JSON Transcript without Timestamps Source: https://transcriptapi.com/docs/api A JSON response format for transcripts that omits the start time and duration for each text segment. ```json { "video_id": "dQw4w9WgXcQ", "language": "en", "transcript": [ { "text": "Never gonna give you up" }, { "text": "Never gonna let you down" } ] } ``` -------------------------------- ### Rate Limits Source: https://transcriptapi.com/docs/api Information on API rate limits and how to handle them. ```APIDOC ## Rate Limits All API keys are subject to the following rate limits: * **300 requests per minute** per API key ### Rate Limit Headers Each response includes rate limit information in the headers: | Header | Description | | ------------------------- | --------------------------------------- | | `X-RateLimit-Limit` | Total allowed requests in the window | | `X-RateLimit-Remaining` | Remaining requests in the window | | `X-RateLimit-Reset` | UTC epoch seconds when the window resets| | `Retry-After` | Seconds until you can retry (only on 429)| **Example Headers:** ``` X-RateLimit-Limit: 200 X-RateLimit-Remaining: 195 X-RateLimit-Reset: 1678901234 ``` ### Best Practices 1. **Implement exponential backoff** on 429 errors 2. **Respect the `Retry-After` header** value 3. **Cache responses** when appropriate to reduce API calls 4. **Don’t retry failed requests** more than 2 times within 3 seconds 5. **Monitor rate limit headers** to avoid hitting limits ``` -------------------------------- ### List Videos in a YouTube Playlist Source: https://transcriptapi.com/docs/api Fetches a paginated list of videos from a YouTube playlist. Provide either a playlist URL or ID. Use the continuation token for subsequent pages. ```http GET /youtube/playlist/videos ``` ```json { "results": [ { "videoId": "abc123xyz00", "title": "Playlist Video", "channelId": "UCAuUUnT6oDeKwE6v1NGQxug", "channelTitle": "TED", "channelHandle": "@TED", "lengthText": "10:05", "viewCountText": "1.5M views 6 months ago", "thumbnails": [...], "index": "0" } ], "playlist_info": { "title": "Best Tech of 2025", "numVideos": "47", "description": "My picks for the best tech this year", "ownerName": "TED", "viewCount": "5000000" }, "continuation_token": "4qmFsgKlARIYVVV1QVhGa2dz...", "has_more": true } ``` -------------------------------- ### 402 Payment Required - Insufficient Credits Source: https://transcriptapi.com/docs/api Specific error format for payment issues when credits are insufficient. Includes a message, reason, and a URL for topping up credits. ```json { "detail": { "message": "You have an active plan, but you've run out of credits.", "reason": "insufficient_credits", "action_label": "Top up credits", "action_url": "https://transcriptapi.com/top-up" } } ``` -------------------------------- ### Get Latest Videos from a YouTube Channel Source: https://transcriptapi.com/docs/mcp Retrieve the most recent videos from a YouTube channel using its identifier. This operation is free and does not consume credits. ```javascript get_channel_latest_videos({ channel: "@TED" }) ``` -------------------------------- ### Configure MCP Client with API Key Source: https://transcriptapi.com/docs/mcp Add your API key to the MCP client configuration. This key is sent as a Bearer token with each request. ```json { "mcpServers": { "transcriptapi": { "url": "https://transcriptapi.com/mcp", "apiKey": "sk_your_api_key_here" } } } ``` -------------------------------- ### Get YouTube Transcript as JSON without Metadata Source: https://transcriptapi.com/docs/mcp Fetches the transcript for a given YouTube video ID in JSON format, excluding metadata. Requires specifying the video ID and format. ```javascript // Get JSON format without metadata get_youtube_transcript({ video_url: "dQw4w9WgXcQ", format: "json", send_metadata: false }) ``` -------------------------------- ### Get YouTube Transcript as Plain Text without Timestamps Source: https://transcriptapi.com/docs/mcp Fetches the transcript for a given YouTube video ID as plain text, excluding timestamps and metadata. Useful for concise text extraction. ```javascript // Get plain text without timestamps get_youtube_transcript({ video_url: "dQw4w9WgXcQ", format: "text", include_timestamp: false, send_metadata: false }) ``` -------------------------------- ### Get YouTube Transcript (Node.js) Source: https://transcriptapi.com/docs/api This function retrieves a YouTube video transcript using Node.js. It supports various options like format, timestamp inclusion, and metadata. Error handling for common API responses is included. ```APIDOC ## GET /youtube/transcript ### Description Retrieves the transcript for a given YouTube video URL. ### Method GET ### Endpoint `/youtube/transcript` ### Parameters #### Query Parameters - **video_url** (string) - Required - The URL or ID of the YouTube video. - **format** (string) - Optional - The desired output format ('json' or 'text'). Defaults to 'json'. - **include_timestamp** (boolean) - Optional - Whether to include timestamps for each transcript segment. Defaults to true. - **send_metadata** (boolean) - Optional - Whether to include video metadata (title, author) in the response. Defaults to false. ### Request Example ```javascript const API_KEY = 'YOUR_API_KEY'; const BASE_URL = 'https://transcriptapi.com/api/v2'; async function getTranscript(videoUrl, options = {}) { const { format = 'json', includeTimestamp = true, sendMetadata = false } = options; const params = new URLSearchParams({ video_url: videoUrl, format: format, include_timestamp: includeTimestamp, send_metadata: sendMetadata }); try { const response = await fetch(`${BASE_URL}/youtube/transcript?${params}`, { headers: { 'Authorization': `Bearer ${API_KEY}` } }); if (!response.ok) { const error = await response.json(); // Handle errors... throw new Error(error.detail); } const data = await response.json(); return data; } catch (error) { console.error('Error fetching transcript:', error); throw error; } } // Basic usage getTranscript('dQw4w9WgXcQ'); // With metadata getTranscript('https://www.youtube.com/watch?v=dQw4w9WgXcQ', { sendMetadata: true }); ``` ### Response #### Success Response (200) - **video_id** (string) - The ID of the video. - **transcript** (array) - An array of transcript segments. Each segment may contain 'start', 'end', and 'text' fields if `include_timestamp` is true, or just 'text' if false. - **metadata** (object) - Optional. Contains 'title' and 'author_name' if `send_metadata` is true. #### Response Example ```json { "video_id": "dQw4w9WgXcQ", "transcript": [ { "start": "0.0s", "end": "5.0s", "text": "Hello there!" }, { "start": "5.5s", "end": "10.0s", "text": "This is an example transcript." } ], "metadata": { "title": "Example Video Title", "author_name": "Example Author" } } ``` ``` -------------------------------- ### Base URL for API Requests Source: https://transcriptapi.com/docs/api All API requests should be directed to this base URL. ```http https://transcriptapi.com/api/v2 ```