> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vidnavigator.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Uploading and Processing Files

> Learn how to upload your own video and audio files for transcription and analysis.

## Overview

In addition to online videos, VidNavigator allows you to upload and process your own local audio and video files. This is useful for analyzing private content or files that are not publicly available on the web.

## Prerequisites

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

## Organizing Files with Namespaces

You can organize your uploaded files into **namespaces** (like folders). When uploading, pass `namespace_ids` to assign the file to one or more namespaces. You can also manage namespaces later via the [namespace endpoints](/api-reference/endpoint/list-namespaces).

All file responses (list, info, search) now include `namespace_ids` and `namespaces` fields showing which namespaces each file belongs to.

## Billing

Uploading and processing audio/video files consumes `transcription_hour` usage for speech-to-text. 1 credit covers 1 hour of video/audio transcription. Uploaded files also count toward your plan's storage quota.

## Uploading a File

The file upload process is asynchronous by default, meaning the API will return a file ID immediately, and the file will be processed in the background. You can then use the file ID to check the status of the processing and retrieve the results once it's complete.

### Using the Python SDK

```python theme={null}
from vidnavigator import VidNavigatorClient, VidNavigatorError

client = VidNavigatorClient()

try:
    response = client.upload_file("path/to/your/video.mp4")
    print(f"File uploaded successfully. File ID: {response['file_id']}")
except FileNotFoundError:
    print("Error: The file was not found at the specified path.")
except VidNavigatorError as e:
    print(f"An error occurred: {e.message}")
```

### Using the JavaScript SDK

```javascript theme={null}
const { VidNavigatorClient, VidNavigatorError } = require('vidnavigator');
const fs = require('fs');

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

async function uploadFile() {
  const filePath = "path/to/your/video.mp4";
  if (!fs.existsSync(filePath)) {
    console.error("Error: The file was not found at the specified path.");
    return;
  }

  try {
    const response = await client.uploadFile({ filePath });
    console.log(`File uploaded successfully. File ID: ${response.file_id}`);
  } catch (error) {
    if (error instanceof VidNavigatorError) {
      console.error(`An error occurred: ${error.message}`);
    } else {
      console.error("An unexpected error occurred:", error);
    }
  }
}

uploadFile();
```

## Next Steps

Once your file is uploaded and processed, you can:

* [Check its status and retrieve the transcript](/api-reference/endpoint/file-info) using the `getFile` method.
* [Analyze the file's content](/api-reference/endpoint/analyze-file) just like you would with an online video.
* [Extract structured data](/api-reference/endpoint/extract-file) from the transcript using a custom schema.
* [Search the content of your uploaded files](/guides/searching-videos#searching-your-uploaded-files).
* [Organize files into namespaces](/api-reference/endpoint/list-namespaces) for better management.
