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

# Python SDK

> Install and configure the VideoDB Python SDK

## Installation

```bash theme={null}
pip install videodb
```

<CardGroup cols={2}>
  <Card icon="package" title="PyPI" href="https://pypi.org/project/videodb/">
    View package on PyPI
  </Card>

  <Card icon="github" title="GitHub" href="https://github.com/video-db/videodb-python">
    Source code and issues
  </Card>
</CardGroup>

## Quick Start

```python theme={null}
import videodb

# Connect using environment variable
conn = videodb.connect()

# Or pass API key directly
conn = videodb.connect(api_key="your-api-key")
```

## Environment Variables

| Variable          | Description                                                        |
| :---------------- | :----------------------------------------------------------------- |
| `VIDEODB_API_KEY` | Your API key from [console.videodb.io](https://console.videodb.io) |

```bash theme={null}
export VIDEODB_API_KEY="your-api-key"
```

## Requirements

* Python 3.8 or higher
* Works on Linux, macOS, and Windows

## Basic Usage

```python theme={null}
import videodb

conn = videodb.connect()

# Upload a video
coll = conn.get_collection()
video = coll.upload(url="https://www.youtube.com/watch?v=example")

# Index for search
video.index_spoken_words()

# Search with natural language
results = video.search("key moments")
for shot in results.shots:
    print(f"{shot.start}s: {shot.text}")
```

## Server Side

Use the full SDK on your backend to manage sessions, run AI pipelines, and handle webhooks. Your API key should never be exposed to the browser.

```python theme={null}
# Create a capture session and generate a client token
cap = conn.create_capture_session(end_user_id="user_123")
token = conn.generate_client_token(expires_in=600)
```

## Client Side

For real-time desktop capture, install the Capture SDK on your client application. It uses short-lived tokens instead of your API key.

<Note>
  Desktop capture currently supports **macOS** and **Windows**.
</Note>

```bash theme={null}
pip install "videodb[capture]"
```

<Card icon="monitor" title="Capture SDK Overview" href="/pages/ingest/capture-sdks/overview">
  Learn how to integrate real-time screen, audio, and camera capture into your application
</Card>

## Next Steps

<CardGroup cols={2}>
  <Card icon="rocket" title="Quickstart" href="/pages/getting-started/quickstart">
    Build your first perception-enabled agent
  </Card>

  <Card icon="code" title="API Reference" href="/api-reference/introduction">
    Complete REST API documentation
  </Card>
</CardGroup>
