cURL
curl --request POST \ --url https://api.videodb.io/video/{video_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, "scene_index_id": "idx-12345", "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 video content by spoken words or visual scenes
import videodb conn = videodb.connect(api_key="your_api_key") coll = conn.get_collection() video = coll.get_videos()[0] # Search for query in video results = video.search("customer reviews discussion") print(f"Found {len(results.docs)} matches") for doc in results.docs: print(f"Time: {doc['start']:.2f}s - {doc['end']:.2f}s") print(f"Text: {doc['text']}")
API key for authentication (sk-xxx format)
"m-12345"
"search query"
spoken_word
scene
"spoken_word"
semantic
keyword
"semantic"
0.2
10
true
"idx-12345"
Search results
Show child attributes