Text queries
Text queries allow you to use natural language to find video segments matching specific keywords or phrases.
Note the following about using text queries:
- The platform supports full natural language-based search. The following examples are valid queries: “birds flying near a castle,” “sun shining on the water,” “chickens on the road,” “an officer holding a child’s hand,” and “crowd cheering in the stadium.”
- The platform supports queries in multiple languages. For a complete list, see the Supported languages page.
- To search for specific text shown in videos, use queries that target on-screen text rather than objects or concepts. Note that the platform may return both textual and visual matches. For example, searching for the word “smartphone” might return both segments where “smartphone” appears as on-screen text and segments where smartphones are visible as objects.
- To detect logos, specify the text within the logo. If the logo doesn’t contain text, you can search using image queries.
Examples
This section provides examples of performing search requests using text queries. Ensure that the prerequisites are met before proceeding.
Visual
The platform analyzes video content as you would see and hear from it, including actions, objects, sounds, and events, excluding human speech. To search using visual cues, invoke the query
method of the search
object with the following parameters:
index_id
: A string representing the unique identifier of the index to search.query_text
: A string representing your search query. Note that the platform supports full natural language-based search. The following examples are valid queries: “birds flying near a castle,” “sun shining on the water,” “chickens on the road,” “an officer holding a child’s hand,” and “crowd cheering in the stadium.”options
: An array of strings specifying the sources of information the platform uses when performing a search. This example searches using visual cues.
The example output below was truncated for brevity:
Audio
The platform analyzes human speech within your videos. The following example sets the value of the options
parameter to ["audio"]
to search using human speech as the source of information.
The example output below was truncated for brevity:
Visual and audio
The following example sets the value options
parameter to ["visual", "audio"]
and the value of the operator
parameter to and
to specify that the platform should return the results for which all the selected sources of information match:
The example output below was truncated for brevity: