> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.reka.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.reka.ai/_mcp/server.

# Search Videos

POST https://vision-agent.api.reka.ai/v2/search
Content-Type: application/json

Reference: https://docs.reka.ai/vision/api-reference/search/search-videos

## Authentication

- `X-Api-Key` header (required) — API key authentication via X-Api-Key header
- `Authorization` header (bearer token, required) — Bearer token authentication via Authorization header

## Request

### Headers

- `X-Enable-Overwrite-Metering` (string, optional, nullable)

### Body (application/json)

This endpoint expects a V2SearchRequest.

- `query` (string, required) — Search query — natural language for semantic, literal text for text
- `strategy` (enum, optional) — 'semantic' (embedding similarity) or 'text' (literal substring match)
  - Allowed values: `semantic`, `text`
- `fields` (list of enum, optional, nullable) — Which data to search. For text: 'transcript', 'captions' (default: both). Ignored for semantic.
  - Allowed values: `transcript`, `captions`
- `video_ids` (list of string, optional, nullable) — Scope to specific video IDs
- `group_ids` (list of string, optional, nullable) — Scope to videos in specific groups
- `threshold` (enum, optional) — Confidence filter: high, medium, low, none. Only affects semantic strategy.
  - Allowed values: `high`, `medium`, `low`, `none`
- `rerank` (boolean, optional, default: false) — Apply embedding-based reranking (semantic only, slightly slower)
- `filter` (SearchFilter, optional, nullable) — Metadata filters (duration, width, height)
- `datetime_from` (datetime, optional, nullable) — Start of an explicit UTC datetime range for semantic search
- `datetime_to` (datetime, optional, nullable) — End of an explicit UTC datetime range for semantic search
- `timestamp_from` (double, optional, nullable) — Start of an explicit in-video timestamp range in seconds
- `timestamp_to` (double, optional, nullable) — End of an explicit in-video timestamp range in seconds
- `page_limit` (integer, optional, default: 10) — Results per page (max 50)
- `page_token` (string, optional, nullable) — Pagination token from a previous response
- `include_report` (boolean, optional, default: false) — Generate LLM summary of results (semantic only)

## Response

### 200

Successful Response

- `data` (list of V2SearchResult, required)
- `search_pool` (SearchPool, required)
- `next_page_token` (string, optional, nullable)
- `report` (string, optional, nullable) — LLM-generated summary (when include_report=true, semantic only)

## Types

### SearchFilter

Metadata filters applied to search results.

- `id` (list of string, optional, nullable) — Filter to specific video IDs (same as top-level video_ids)
- `duration` (NumberFilter, optional, nullable) — Filter by video duration in seconds
- `width` (NumberFilter, optional, nullable) — Filter by video width in pixels
- `height` (NumberFilter, optional, nullable) — Filter by video height in pixels

### V2SearchResult

- `video_id` (string, required) — Video this moment is from
- `score` (double, required) — Relevance score in [0, 1]. Text matches are binary; 1.0 is a sentinel.
- `rank` (integer, required) — Position in results (1 = most relevant)
- `video_name` (string, optional, nullable) — Video display name
- `start` (double, optional, nullable) — Start time in seconds
- `end` (double, optional, nullable) — End time in seconds
- `caption` (string, optional, nullable) — AI description of the visual content
- `transcript` (string, optional, nullable) — Spoken words in this segment
- `thumbnail_url` (string, optional, nullable) — Preview frame URL (not yet available)
- `video_url` (string, optional, nullable) — Presigned URL to the parent video

### SearchPool

- `video_count` (integer, required) — Number of videos searched
- `total_duration` (double, required) — Total duration searched (seconds)

### NumberFilter

Numeric range filter with optional bounds.

- `gte` (double, optional, nullable)
- `lte` (double, optional, nullable)

## Examples

**Request**

```json
{
  "query": "person giving a presentation with charts"
}
```

**Response**

```json
{
  "data": [
    {
      "video_id": "string",
      "score": 0.5,
      "rank": 1,
      "video_name": "string",
      "start": 1.1,
      "end": 1.1,
      "caption": "string",
      "transcript": "string",
      "thumbnail_url": "string",
      "video_url": "string"
    }
  ],
  "search_pool": {
    "video_count": 1,
    "total_duration": 1.1
  },
  "next_page_token": "string",
  "report": "string"
}
```

**SDK Code**

```python
import requests

url = "https://vision-agent.api.reka.ai/v2/search"

payload = { "query": "person giving a presentation with charts" }
headers = {
    "X-Api-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://vision-agent.api.reka.ai/v2/search';
const options = {
  method: 'POST',
  headers: {'X-Api-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"query":"person giving a presentation with charts"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://vision-agent.api.reka.ai/v2/search"

	payload := strings.NewReader("{\n  \"query\": \"person giving a presentation with charts\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-Api-Key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://vision-agent.api.reka.ai/v2/search")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"query\": \"person giving a presentation with charts\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://vision-agent.api.reka.ai/v2/search")
  .header("X-Api-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"query\": \"person giving a presentation with charts\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://vision-agent.api.reka.ai/v2/search', [
  'body' => '{
  "query": "person giving a presentation with charts"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Api-Key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://vision-agent.api.reka.ai/v2/search");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Api-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"query\": \"person giving a presentation with charts\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-Api-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["query": "person giving a presentation with charts"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://vision-agent.api.reka.ai/v2/search")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```