Video Search
The Vision API provides powerful video search capabilities through the /v1/search endpoint, which allows you to search through your uploaded videos using semantic queries.
Search Videos
Search through your videos using natural language queries:
Bash
Python
Search Parameters
General parameters:
query(required): Natural language search querymax_results(optional): Maximum number of results to return (default: 10, max: 200)threshold(optional): Confidence threshold level from 0 (lowest) to 1 (highest). Different queries may need different thresholds based on their specificity and the nature of your search.video_ids(optional): List of specific video IDs to search within. If not provided, the search runs across all of your videos (or the groups you include).group_ids(optional): List of group IDs to search within. Omit the field—or pass["default"]—to search the default group only. If you specifyvideo_ids, that filter takes precedence andgroup_idsis ignored.generate_report(optional): Whether to generate a report and explanations for the search results (default: false)
Time filtering parameters:
datetime_from(optional): Filter results from datetime (ISO 8601 format, e.g., 2024-01-15T10:00:00Z)datetime_to(optional): Filter results to datetime (ISO 8601 format, e.g., 2024-01-15T18:00:00Z)timestamp_from(optional): Filter results from video timestamp in seconds (relative to video start)timestamp_to(optional): Filter results to video timestamp in seconds (relative to video start)
Search Response
The search endpoint returns relevant video chunks with confidence scores relative to your search query:
Note: Confidence scores (0.0 to 1.0) are relative to your specific search query. A score of 0.95 for “person walking on beach” indicates high relevance to that particular query, not an absolute measure of query matching. Thresholds may vary significantly for each query and will require experimentation - one query might have a highest score of 0.8 while another query has 0.2 as the highest score, depending on the specificity and content of your videos.
Response Fields
Result Item Fields
video_chunk_id: Unique identifier for the specific video chunkvideo_id: ID of the parent videouser_id: User ID who owns the videoscore: Confidence score (0.0 to 1.0) relative to your search querystart_timestamp: Start time of the chunk in secondsend_timestamp: End time of the chunk in secondsplain_text_caption(optional): Text caption for the video chunkplain_text_transcript(optional): Transcription of speech in the video chunkexplanation(optional): Explanation of the video chunk content and its relevance to the search querys3_presigned_url(optional): Direct access URL for the video chunkdebug_info(optional): Debug information for internal use
Top-Level Response Fields
results: Array of video chunk results matching your search queryreport(optional): Summary report of the search results (only included whengenerate_reportis set to true)
Search Examples
Basic Content Search
Search with threshold and max number of results
Search with no threshold
Python Search Example
Best Practices
- Use descriptive queries for better search results
- Set appropriate thresholds based on your query type and needs:
- Specific queries (e.g., “red car driving on highway”): Use higher thresholds (0.7-0.9) for precise matches
- General queries (e.g., “people”): Use lower thresholds (0.2-0.5) to capture more results
- Exploratory searches: Use very low thresholds (0.1-0.3) to discover content
- Production applications: Start with moderate thresholds (0.4-0.6) and adjust based on results
- Understand confidence scores are relative to your query, not absolute video quality
- Set reasonable limits to manage response size
- Experiment with different thresholds for the same query to find optimal results
- Consider query complexity: Simple queries may need lower thresholds, complex queries may need higher thresholds
- Remember threshold variability: Each query may have different score ranges - one query’s highest score might be 0.8 while another’s is 0.2, requiring different threshold strategies
Search Tips
- Be specific: “person walking on beach” is better than “walking”
- Use natural language: The search understands conversational queries
- Adjust threshold based on query type:
- Specific objects/actions: Higher thresholds (0.7+)
- General concepts: Lower thresholds (0.3-0.6)
- Broad categories: Very low thresholds (0.1-0.3)
- Consider your use case: Use lower thresholds for exploratory searches, higher for precise filtering
- Monitor confidence scores: Higher scores indicate better matches for your specific query
- Remember relativity: A 0.9 score for one query might be different than 0.9 for another query
- Test different thresholds: The same query may work better with different thresholds depending on your video content