Overview

VidNavigator’s analysis capabilities allow you to go beyond simple transcription and understand the content of a video at a deeper level. You can get an AI-generated summary, identify key topics and speakers, and even ask specific questions about the video’s content.

Prerequisites

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

Analyzing a Video

Using the Python SDK

from vidnavigator import VidNavigatorClient, VidNavigatorError

client = VidNavigatorClient()

try:
    analysis = client.analyze_video(
        video_url="https://www.youtube.com/watch?v=dQw4w9WgXcQ",
        query="What is the main theme of this song?"
    )
    print("Summary:", analysis.data.transcript_analysis.summary)
    print("Answer to your query:", analysis.data.transcript_analysis.query_answer)
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 analyzeVideo() {
  try {
    const result = await client.analyzeVideo({
      video_url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
      query: "What is the main theme of this song?"
    });
    console.log("Summary:", result.transcript_analysis.summary);
    console.log("Answer to your query:", result.transcript_analysis.query_answer);
  } catch (error) {
    if (error instanceof VidNavigatorError) {
      console.error(`An error occurred: ${error.message}`);
    } else {
      console.error("An unexpected error occurred:", error);
    }
  }
}

analyzeVideo();