Search within collection
curl --request POST \
--url https://api.videodb.io/collection/{collection_id}/search/ \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"query": "search query",
"index_type": "spoken_word",
"search_type": "semantic",
"score_threshold": 0.2,
"result_threshold": 10,
"stitch": true,
"rerank": false,
"filter": [
{}
]
}
'const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: 'search query',
index_type: 'spoken_word',
search_type: 'semantic',
score_threshold: 0.2,
result_threshold: 10,
stitch: true,
rerank: false,
filter: [{}]
})
};
fetch('https://api.videodb.io/collection/{collection_id}/search/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.videodb.io/collection/{collection_id}/search/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => 'search query',
'index_type' => 'spoken_word',
'search_type' => 'semantic',
'score_threshold' => 0.2,
'result_threshold' => 10,
'stitch' => true,
'rerank' => false,
'filter' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.videodb.io/collection/{collection_id}/search/"
payload := strings.NewReader("{\n \"query\": \"search query\",\n \"index_type\": \"spoken_word\",\n \"search_type\": \"semantic\",\n \"score_threshold\": 0.2,\n \"result_threshold\": 10,\n \"stitch\": true,\n \"rerank\": false,\n \"filter\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.videodb.io/collection/{collection_id}/search/")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"search query\",\n \"index_type\": \"spoken_word\",\n \"search_type\": \"semantic\",\n \"score_threshold\": 0.2,\n \"result_threshold\": 10,\n \"stitch\": true,\n \"rerank\": false,\n \"filter\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.videodb.io/collection/{collection_id}/search/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"search query\",\n \"index_type\": \"spoken_word\",\n \"search_type\": \"semantic\",\n \"score_threshold\": 0.2,\n \"result_threshold\": 10,\n \"stitch\": true,\n \"rerank\": false,\n \"filter\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body$headers=@{}
$headers.Add("x-access-token", "<api-key>")
$headers.Add("Content-Type", "application/json")
$response = Invoke-WebRequest -Uri 'https://api.videodb.io/collection/{collection_id}/search/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"query": "search query",
"index_type": "spoken_word",
"search_type": "semantic",
"score_threshold": 0.2,
"result_threshold": 10,
"stitch": true,
"rerank": false,
"filter": [
{}
]
}'import Foundation
let parameters = [
"query": "search query",
"index_type": "spoken_word",
"search_type": "semantic",
"score_threshold": 0.2,
"result_threshold": 10,
"stitch": true,
"rerank": false,
"filter": [[]]
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.videodb.io/collection/{collection_id}/search/")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"x-access-token": "<api-key>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))using RestSharp;
var options = new RestClientOptions("https://api.videodb.io/collection/{collection_id}/search/");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-access-token", "<api-key>");
request.AddJsonBody("{\n \"query\": \"search query\",\n \"index_type\": \"spoken_word\",\n \"search_type\": \"semantic\",\n \"score_threshold\": 0.2,\n \"result_threshold\": 10,\n \"stitch\": true,\n \"rerank\": false,\n \"filter\": [\n {}\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
using RestSharp;
var options = new RestClientOptions("https://api.videodb.io/collection/{collection_id}/search/");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-access-token", "<api-key>");
request.AddJsonBody("{\n \"query\": \"search query\",\n \"index_type\": \"spoken_word\",\n \"search_type\": \"semantic\",\n \"score_threshold\": 0.2,\n \"result_threshold\": 10,\n \"stitch\": true,\n \"rerank\": false,\n \"filter\": [\n {}\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: 'search query',
index_type: 'spoken_word',
search_type: 'semantic',
score_threshold: 0.2,
result_threshold: 10,
stitch: true,
rerank: false,
filter: [{}]
})
};
fetch('https://api.videodb.io/collection/{collection_id}/search/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.videodb.io/collection/{collection_id}/search/");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-access-token: <api-key>");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"query\": \"search query\",\n \"index_type\": \"spoken_word\",\n \"search_type\": \"semantic\",\n \"score_threshold\": 0.2,\n \"result_threshold\": 10,\n \"stitch\": true,\n \"rerank\": false,\n \"filter\": [\n {}\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.videodb.io/collection/{collection_id}/search/");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-access-token: <api-key>");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"query\": \"search query\",\n \"index_type\": \"spoken_word\",\n \"search_type\": \"semantic\",\n \"score_threshold\": 0.2,\n \"result_threshold\": 10,\n \"stitch\": true,\n \"rerank\": false,\n \"filter\": [\n {}\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"query\": \"search query\",\n \"index_type\": \"spoken_word\",\n \"search_type\": \"semantic\",\n \"score_threshold\": 0.2,\n \"result_threshold\": 10,\n \"stitch\": true,\n \"rerank\": false,\n \"filter\": [\n {}\n ]\n}")
val request = Request.Builder()
.url("https://api.videodb.io/collection/{collection_id}/search/")
.post(body)
.addHeader("x-access-token", "<api-key>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute(){
"success": true,
"data": {
"query": "search query",
"results": [
{
"video_id": "m-12345",
"start": 10.5,
"end": 20.3,
"text": "matched content",
"score": 0.95
}
]
}
}Search Collection
Search across all videos in a collection
POST
/
collection
/
{collection_id}
/
search
/
Search within collection
curl --request POST \
--url https://api.videodb.io/collection/{collection_id}/search/ \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"query": "search query",
"index_type": "spoken_word",
"search_type": "semantic",
"score_threshold": 0.2,
"result_threshold": 10,
"stitch": true,
"rerank": false,
"filter": [
{}
]
}
'const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: 'search query',
index_type: 'spoken_word',
search_type: 'semantic',
score_threshold: 0.2,
result_threshold: 10,
stitch: true,
rerank: false,
filter: [{}]
})
};
fetch('https://api.videodb.io/collection/{collection_id}/search/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.videodb.io/collection/{collection_id}/search/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => 'search query',
'index_type' => 'spoken_word',
'search_type' => 'semantic',
'score_threshold' => 0.2,
'result_threshold' => 10,
'stitch' => true,
'rerank' => false,
'filter' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.videodb.io/collection/{collection_id}/search/"
payload := strings.NewReader("{\n \"query\": \"search query\",\n \"index_type\": \"spoken_word\",\n \"search_type\": \"semantic\",\n \"score_threshold\": 0.2,\n \"result_threshold\": 10,\n \"stitch\": true,\n \"rerank\": false,\n \"filter\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.videodb.io/collection/{collection_id}/search/")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"search query\",\n \"index_type\": \"spoken_word\",\n \"search_type\": \"semantic\",\n \"score_threshold\": 0.2,\n \"result_threshold\": 10,\n \"stitch\": true,\n \"rerank\": false,\n \"filter\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.videodb.io/collection/{collection_id}/search/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"search query\",\n \"index_type\": \"spoken_word\",\n \"search_type\": \"semantic\",\n \"score_threshold\": 0.2,\n \"result_threshold\": 10,\n \"stitch\": true,\n \"rerank\": false,\n \"filter\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body$headers=@{}
$headers.Add("x-access-token", "<api-key>")
$headers.Add("Content-Type", "application/json")
$response = Invoke-WebRequest -Uri 'https://api.videodb.io/collection/{collection_id}/search/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"query": "search query",
"index_type": "spoken_word",
"search_type": "semantic",
"score_threshold": 0.2,
"result_threshold": 10,
"stitch": true,
"rerank": false,
"filter": [
{}
]
}'import Foundation
let parameters = [
"query": "search query",
"index_type": "spoken_word",
"search_type": "semantic",
"score_threshold": 0.2,
"result_threshold": 10,
"stitch": true,
"rerank": false,
"filter": [[]]
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.videodb.io/collection/{collection_id}/search/")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"x-access-token": "<api-key>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))using RestSharp;
var options = new RestClientOptions("https://api.videodb.io/collection/{collection_id}/search/");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-access-token", "<api-key>");
request.AddJsonBody("{\n \"query\": \"search query\",\n \"index_type\": \"spoken_word\",\n \"search_type\": \"semantic\",\n \"score_threshold\": 0.2,\n \"result_threshold\": 10,\n \"stitch\": true,\n \"rerank\": false,\n \"filter\": [\n {}\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
using RestSharp;
var options = new RestClientOptions("https://api.videodb.io/collection/{collection_id}/search/");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-access-token", "<api-key>");
request.AddJsonBody("{\n \"query\": \"search query\",\n \"index_type\": \"spoken_word\",\n \"search_type\": \"semantic\",\n \"score_threshold\": 0.2,\n \"result_threshold\": 10,\n \"stitch\": true,\n \"rerank\": false,\n \"filter\": [\n {}\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: 'search query',
index_type: 'spoken_word',
search_type: 'semantic',
score_threshold: 0.2,
result_threshold: 10,
stitch: true,
rerank: false,
filter: [{}]
})
};
fetch('https://api.videodb.io/collection/{collection_id}/search/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.videodb.io/collection/{collection_id}/search/");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-access-token: <api-key>");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"query\": \"search query\",\n \"index_type\": \"spoken_word\",\n \"search_type\": \"semantic\",\n \"score_threshold\": 0.2,\n \"result_threshold\": 10,\n \"stitch\": true,\n \"rerank\": false,\n \"filter\": [\n {}\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.videodb.io/collection/{collection_id}/search/");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-access-token: <api-key>");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"query\": \"search query\",\n \"index_type\": \"spoken_word\",\n \"search_type\": \"semantic\",\n \"score_threshold\": 0.2,\n \"result_threshold\": 10,\n \"stitch\": true,\n \"rerank\": false,\n \"filter\": [\n {}\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"query\": \"search query\",\n \"index_type\": \"spoken_word\",\n \"search_type\": \"semantic\",\n \"score_threshold\": 0.2,\n \"result_threshold\": 10,\n \"stitch\": true,\n \"rerank\": false,\n \"filter\": [\n {}\n ]\n}")
val request = Request.Builder()
.url("https://api.videodb.io/collection/{collection_id}/search/")
.post(body)
.addHeader("x-access-token", "<api-key>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute(){
"success": true,
"data": {
"query": "search query",
"results": [
{
"video_id": "m-12345",
"start": 10.5,
"end": 20.3,
"text": "matched content",
"score": 0.95
}
]
}
}Search across all media files in a collection using semantic or keyword search.
import videodb
from videodb import SearchType, IndexType
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
# Search spoken content
results = coll.search(
query="product launch",
search_type=SearchType.semantic,
index_type=IndexType.spoken_word
)
for result in results.shots:
print(f"Video: {result.video_id}")
print(f"Match: {result.text}")
print(f"Time: {result.start} - {result.end}")
import { connect, SearchType, IndexType } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
const coll = await conn.getCollection();
// Search spoken content
const results = await coll.search(
'product launch',
SearchType.semantic,
IndexType.spoken_word
);
for (const result of results.shots) {
console.log(`Video: ${result.video_id}`);
console.log(`Match: ${result.text}`);
console.log(`Time: ${result.start} - ${result.end}`);
}
- Videos must be indexed before search works (use
video.index_spoken_words()orvideo.index_scenes()) - Use
IndexType.scenefor visual search across scenes - Add metadata during indexing for filtered searches
Collection Search Guide
Advanced search with metadata filtering
Video Indexing
Create indexes for searchable content
Authorizations
API key for authentication (sk-xxx format)
Path Parameters
Example:
"default"
Body
application/json
Example:
"search query"
Available options:
spoken_word, scene Example:
"spoken_word"
Available options:
semantic, custom Example:
"semantic"
Example:
0.2
Example:
10
Example:
true
Example:
false
⌘I