Skip to main content
POST
/
video
/
{video_id}
/
search
Search within video
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 for specific content within a video using semantic search on transcripts or visual indexes.
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']}")
  • Requires index to be created first (create-index endpoint)
  • Returns matched segments with timestamps and relevance scores
  • Supports semantic search on transcribed text
  • Can filter results by score threshold and result count
  • Search results include exact timestamp ranges for video navigation

Authorizations

x-access-token
string
header
required

API key for authentication (sk-xxx format)

Path Parameters

video_id
string
required
Example:

"m-12345"

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,
keyword
Example:

"semantic"

score_threshold
number
Example:

0.2

result_threshold
integer
Example:

10

stitch
boolean
Example:

true

scene_index_id
string
Example:

"idx-12345"

filter
object[]

Response

200 - application/json

Search results

success
boolean
Example:

true

data
object