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
getTranscript()
getTranscript()
Returns a promise that resolves to an object with:
video_info: AVideoInfoobject.transcript: An array ofTranscriptSegmentobjects.
transcribeVideo()
transcribeVideo()
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.analyzeVideo()
analyzeVideo()
Returns a promise that resolves to an object with:
video_info: AVideoInfoobject.transcript: An array ofTranscriptSegmentobjects.transcript_analysis: AnAnalysisResultobject.
searchVideos()
searchVideos()
Returns a promise that resolves to an object with:
results: An array ofVideoSearchResultobjects.total_found: The total number of results found.
Files Data Models
getFiles()
getFiles()
Returns a promise resolving to an object with:
files: An array ofFileInfoobjects.total_count: The total number of files.has_more: A boolean indicating if more pages are available.
getFile()
getFile()
Returns a promise resolving to an object with:
file_info: AFileInfoobject.transcript: An optional array ofTranscriptSegmentobjects.
uploadFile()
uploadFile()
Returns a promise resolving to an object with:
file_id: The ID of the uploaded file.file_info: AFileInfoobject.transcript: An optional array ofTranscriptSegmentobjects ifwait_for_completionis true.
searchFiles()
searchFiles()
Returns a promise resolving to an object with:
results: An array ofFileSearchResultobjects.
Exceptions
The JavaScript SDK throws customError 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.
VidNavigatorError
VidNavigatorError
AuthenticationError
AuthenticationError
Raised for
401 Unauthorized errors when the API key is missing or invalid.BadRequestError
BadRequestError
Raised for
400 Bad Request errors, typically due to invalid parameters.AccessDeniedError
AccessDeniedError
Raised for
403 Forbidden errors, indicating insufficient permissions.NotFoundError
NotFoundError
Raised for
404 Not Found errors when a resource does not exist.RateLimitExceededError
RateLimitExceededError
Raised for
429 Too Many Requests errors when you have exceeded your rate limit.PaymentRequiredError
PaymentRequiredError
Raised for
402 Payment Required errors when you have exceeded your usage quota.ServerError
ServerError
Raised for
5xx server-side errors.
