Overview

VidNavigator is the ultimate video to text solution for extracting unlimited subtitles / captions from online videos, giving you all the essential information at your fingertips! Need full transcripts, timestamps, or video metadata? We’ve got it all. This JSON output is presented in both JSON, ready for instant integration into AI-powered application. One of the core features of VidNavigator is its ability to extract accurate, timestamped transcripts from a wide range of supported online video platforms. This guide will walk you through the process of retrieving a transcript using our SDKs.

Prerequisites

  • A valid VidNavigator API key.
  • The Python or JavaScript SDK installed in your project.

Retrieving a Transcript

Using the Python SDK

from vidnavigator import VidNavigatorClient, VidNavigatorError

client = VidNavigatorClient()

try:
    result = client.get_transcript(
        video_url="https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    )
    print("Video Title:", result.data.video_info.title)
    # Each item in the transcript is a segment with text, start, and end times
    for segment in result.data.transcript:
        print(f"[{segment.start:.2f}s - {segment.end:.2f}s] {segment.text}")
except VidNavigatorError as e:
    print(f"An error occurred: {e.message}")

Using the JavaScript SDK

const { VidNavigatorClient, VidNavigatorError } = require('vidnavigator');

const client = new VidNavigatorClient({
  apiKey: process.env.VIDNAVIGATOR_API_KEY,
});

async function getTranscript() {
  try {
    const { video_info, transcript } = await client.getTranscript({
      video_url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    });
    console.log("Video Title:", video_info.title);
    // Each item in the transcript is an object with text, start, and end properties
    transcript.forEach(segment => {
      console.log(`[${segment.start.toFixed(2)}s - ${segment.end.toFixed(2)}s] ${segment.text}`);
    });
  } catch (error) {
    if (error instanceof VidNavigatorError) {
      console.error(`An error occurred: ${error.message}`);
    } else {
      console.error("An unexpected error occurred:", error);
    }
  }
}

getTranscript();

When a Transcript Isn’t Available

Sometimes a platform doesn’t expose captions we can fetch directly (e.g., many Instagram Reels). In that case, the /transcript endpoint will return an error such as 404 transcript_not_available.
When this happens you can fall back to the /transcribe endpoint, which runs speech-to-text to generate a fresh transcript.

Python SDK – transcribe_video

from vidnavigator import VidNavigatorClient

client = VidNavigatorClient()

result = client.transcribe_video(
    video_url="https://www.instagram.com/reel/C86ZvEaqRmo/"
)
print("Transcript length:", len(result.data.transcript))
print("First line:", result.data.transcript[0].text)

JavaScript SDK – transcribeVideo

const { VidNavigatorClient } = require('vidnavigator');

const client = new VidNavigatorClient({
  apiKey: process.env.VIDNAVIGATOR_API_KEY,
});

async function transcribe() {
  const { transcript } = await client.transcribeVideo({
    video_url: "https://www.instagram.com/reel/C86ZvEaqRmo/",
  });
  console.log(`Transcript has ${transcript.length} segments`);
  console.log("First line:", transcript[0].text);
}

transcribe();

Next Steps

Now that you have the transcript, you can: