Make any-to-video search requests
Use this endpoint to search for relevant matches in an index using text, media, or a combination of both as your query.
Text queries:
- Use the
query_textparameter to specify your query.
Media queries:
- Set the
query_media_typeparameter to the corresponding media type (example:image). - Provide up to 10 images by specifying the following parameters multiple times:
query_media_url: Publicly accessible URL of your media file.query_media_file: Local media file. Composed text and media queries:
- Use the
query_textparameter for your text query. - Set
query_media_typetoimage. - Provide up to 10 images by specifying the
query_media_urlandquery_media_fileparameters multiple times.
Entity search (beta):
- To find a specific person in your videos, enclose the unique identifier of the entity you want to find in the
query_textparameter.
- When using images in your search queries (either as media queries or in composed searches), ensure your images meet the requirements.
- This endpoint is rate-limited. For details, see the Rate limits page.
Authentication
Your API key.
You can find your API key on the API Keys page.
Request
The type of media you wish to use. This parameter is required for media queries. For example, to perform an image-based search, set this parameter to image. Use query_text together with this parameter when you want to perform a composed image+text search.
The publicly accessible URL of a media file to use as a query. This parameter is required for media queries if query_media_file is not provided.
You can provide up to 10 images by specifying this parameter multiple times:
--form query_media_url=https://example.com/image1.jpg \
--form query_media_url=https://example.com/image2.jpg
A local media file to use as a query. This parameter is required for media queries if query_media_url is not provided.
You can provide up to 10 images by specifying this parameter multiple times:
--form query_media_file=@/path/to/image1.jpg \
--form query_media_file=@/path/to/image2.jpg
The text query to search for. This parameter is required for text queries. Note that the platform supports full natural language-based search. You can use this parameter together with query_media_type and query_media_url or query_media_file to perform a composed image+text search.
If you're using the Entity Search feature to search for specific persons in your video content, you must enclose the unique identifier of your entity between the <@ and > markers. For example, to search for an entity with the ID entity123, use <@entity123> is walking as your query.
Marengo supports up to 500 tokens per query.
Specifies the modalities the video understanding model uses to find relevant information.
Available options:
visual: Searches visual content.audio: Searches non-speech audio.transcription: Spoken words
- You can specify multiple search options in conjunction with the
operatorparameter described below to broaden or narrow your search. For example, to search using both visual and non-speech audio content, include this parameter two times in the request as shown below:--form search_options=visual \ --form search_options=audio \ --form search_options=transcription \
For guidance, see the Search options section.
Specifies how the platform matches your text query with the words spoken in the video. This parameter applies only when the search_options parameter contains the transcription value.
Available options:
lexical: Exact word matchingsemantic: Meaning-based matching
For details on when to use each option, see the Transcription options section.
Default: ["lexical", "semantic"].
Use this parameter to group or ungroup items in a response. It can take one of the following values:
video: The platform will group the matching video clips in the response by video.clip: The matching video clips in the response will not be grouped.
Default: clip
Combines multiple search options using or or and. Use and to find segments matching all search options. Use or to find segments matching any search option. For detailed guidance on using this parameter, see the Combine multiple modalities section.
Default: or.
The number of items to return on each page. When grouping by video, this parameter represents the number of videos per page. Otherwise, it represents the maximum number of video clips per page.
Max: 50.
Specifies a stringified JSON object to filter your search results. Supports both system-generated metadata (example: video ID, duration) and user-defined metadata.
Syntax for filtering
The following table describes the supported data types, operators, and filter syntax:
System-generated metadata
The table below describes the system-generated metadata available for filtering your search results:
User-defined metadata
To filter by user-defined metadata:
- Add metadata to your video by calling the
PUTmethod of the/indexes/:index-id/videos/:video-idendpoint - Reference the custom field in your filter object. For example, to filter videos where a custom field named
needsReviewof type boolean istrue, use{"needs_review": true}.
For more details and examples, see the Filter search results page.
Specifies whether to include user-defined metadata in the search results.
Response headers
The maximum number of requests you can make per rate limit window for this endpoint. For details, see the Rate limits page.
Response
An array that contains your search results. For each match found, the model returns the following fields: