Skip to main content
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": [
    {}
  ]
}
'
{
  "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}")
  • Videos must be indexed before search works (use video.index_spoken_words() or video.index_scenes())
  • Use IndexType.scene for visual search across scenes
  • Add metadata during indexing for filtered searches

Authorizations

x-access-token
string
header
required

API key for authentication (sk-xxx format)

Path Parameters

collection_id
string
required
Example:

"default"

Body

application/json
query
string
required
Example:

"search query"

index_type
enum<string>
Available options:
spoken_word,
scene
Example:

"spoken_word"

search_type
enum<string>
Available options:
semantic,
custom
Example:

"semantic"

score_threshold
number
Example:

0.2

result_threshold
integer
Example:

10

stitch
boolean
Example:

true

rerank
boolean
Example:

false

filter
object[]

Response

200 - application/json

Search results

success
boolean
Example:

true

data
object