Skip to main content

Installation

Install the SDK from npm or yarn:

Initialization

Initialize the client with your API key. You can find your key in the Developer Dashboard.

Online Videos

Get Video Transcript

Transcribe a Video

Analyze a Video

Search for Videos


Files

Upload a File

List Files

Get File Info

Get Temporary File URL to view it in the browser

Retry File Processing

Cancel File Processing

Delete a File

Analyze an Uploaded File

Search Uploaded Files


System

Get API Usage

Health Check


Data Models

The SDK returns structured data objects that correspond to the API’s JSON responses. Here are the main data models:

Online Videos Data Models

Returns a promise that resolves to an object with:
  • video_info: A VideoInfo object.
  • transcript: An array of TranscriptSegment objects.
Returns a promise that resolves to the same structure as getTranscript() above. Use this when a transcript is not already available and you need speech-to-text processing.
Returns a promise that resolves to an object with:
  • video_info: A VideoInfo object.
  • transcript: An array of TranscriptSegment objects.
  • transcript_analysis: An AnalysisResult object.
Returns a promise that resolves to an object with:
  • results: An array of VideoSearchResult objects.
  • total_found: The total number of results found.

Files Data Models

Returns a promise resolving to an object with:
  • files: An array of FileInfo objects.
  • total_count: The total number of files.
  • has_more: A boolean indicating if more pages are available.
Returns a promise resolving to an object with:
  • file_info: A FileInfo object.
  • transcript: An optional array of TranscriptSegment objects.
Returns a promise resolving to an object with:
  • file_id: The ID of the uploaded file.
  • file_info: A FileInfo object.
  • transcript: An optional array of TranscriptSegment objects if wait_for_completion is true.
Returns a promise resolving to an object with:
  • results: An array of FileSearchResult objects.

Exceptions

The JavaScript SDK throws custom Error objects when an API request fails. All custom errors inherit from the base VidNavigatorError. You should use try...catch blocks to handle errors gracefully and can use instanceof to check for specific error types.
The base exception for all SDK-related errors. It contains the following properties:
  • status_code: The HTTP status code of the response.
  • error_code: The error code from the API response.
  • error_message: The error message from the API response.
  • details: Any additional details provided by the API.
Raised for 401 Unauthorized errors when the API key is missing or invalid.
Raised for 400 Bad Request errors, typically due to invalid parameters.
Raised for 403 Forbidden errors, indicating insufficient permissions.
Raised for 404 Not Found errors when a resource does not exist.
Raised for 429 Too Many Requests errors when you have exceeded your rate limit.
Raised for 402 Payment Required errors when you have exceeded your usage quota.
Raised for 5xx server-side errors.

More Information

For the complete source code and more examples, visit the npm package or the GitHub repository.