Skip to navigation

Search a knowledge store

This method searches a knowledge store using natural language and returns matching video clips and images ranked by relevance.

Use the query.text field to specify your natural-language query. Use the filter parameter to choose which items to search. Use the search_options parameter to choose how the platform matches videos.

By default, each result is an individual match: a video clip or an image. Set the group_by parameter to item to group clips under their parent item.

Note

This endpoint is rate-limited. For details, see the Rate limits page.

Authentication

x-api-keystring

Your API key.

Note

You can find your API key on the API Keys page.

Path parameters

knowledge_store_idstringRequired
The unique identifier of the knowledge store.

Request

Request body for searching a knowledge store.

To paginate, set the page_token parameter to the next_page_token field returned in the previous response and send the request again. The token identifies the original search, so any search fields you send are ignored.

queryobjectRequired
The search query.
filterobjectOptional

Narrows results to specific items in the knowledge store. Omit the filter to search all items.

You can filter with these fields:

  • asset_type: The type of item. Use eq to match one type. Use in to match any type in a list.
  • item_id: Specific items. Use eq to match one item. Use in to match any item in a list.
  • user_metadata: Custom metadata. Map each key to the eq operator to match one value, or to the in operator to match any value in a list.
  • enrichment: Enrichment values that the platform extracts. Map each key to the eq operator to match one value, or to the in operator to match any value in a list.
  • created_at: Creation time. Use gte to set the earliest time and lte to set the latest time. You can use one or both.
  • location: Capture location. Provide the center and the radius of a circle.
  • tags: Item tags. Map each key under tags.metadata to the eq operator to match one value, or to the in operator to match any value in a list.

An item must match all of the fields that you specify. The tags field also limits which clips of an item the search returns.

When you use any of the user_metadata, enrichment, created_at, or location fields, the platform counts the items that match those conditions together. If more than 10,000 items match, the platform returns a 422 error with the metadata_filter_too_broad code. To reduce the count, add conditions or use the item_id field. The asset_type field does not reduce the count. When you use the tags field, the platform does not count items, and this limit does not apply. It counts the matching tags instead, as the tags field describes.

Examples:

{
    "asset_type": {
        "eq": "video"
    }
}
{
    "asset_type": {
        "in": [
            "video"
        ]
    },
    "item_id": {
        "in": [
            "ksi_069e9870-3c4d-7abc-9012-3456789abcde"
        ]
    }
}
{
    "user_metadata": {
        "category": {
            "eq": "tutorial"
        }
    },
    "created_at": {
        "gte": "2026-09-01T00:00:00Z"
    }
}
{
    "location": {
        "latitude": 37.5665,
        "longitude": 126.978,
        "radius_meters": 5000
    }
}
{
    "tags": {
        "metadata": {
            "event": {
                "eq": "goal"
            }
        }
    }
}
search_optionsobjectOptional

Specifies how videos are matched. Videos are the only type of item with configurable options, set in the search_options.video field. Images are always matched on their visual content and have no options to configure.

To choose which types of items to search, use the filter.asset_type field. If you provide options in the search_options.video field when the filter.asset_type field excludes videos, the platform returns a 400 error.

If you omit this field, videos are matched on their visual content.

group_byenumOptionalDefaults to none

Controls how the platform groups matches in the response.

  • none: Returns individual matches ordered by relevance.
  • item: Groups matches under their parent item.

Default: none.

Allowed values:
page_sizeintegerOptional1-50Defaults to 10

The maximum number of results per page. A result is one entry in the data array. With the group_by parameter set to its default of none, each result is an individual match: a video clip or an image. When set to item, each result is one item: a video with all its matching clips, or an image.

Default: 10. Max: 50.

page_tokenstringOptional

Pagination token used to retrieve the next page of results. Omit it on the first request. To fetch the next page, set it to the next_page_token field returned in the previous response and send the request again.

If a token is malformed or unrecognized, the platform returns a 400 error. If a token has expired, the platform returns a 410 error (make a new search request to obtain a fresh page token).

include_metadatabooleanOptionalDefaults to false

Set to true to include metadata in each result. Each result includes a metadata object with these fields:

  • system: System-generated metadata, such as duration and resolution.
  • user: The custom metadata of the source asset.
  • item: The custom metadata of the knowledge store item.

Response headers

X-Ratelimit-Limitdouble

The maximum number of requests you can make per rate limit window for this endpoint. For details, see the Rate limits page.

X-Ratelimit-Remainingdouble
The number of requests remaining in the current rate limit window for the specific endpoint.
X-Ratelimit-Useddouble
The number of requests you have made in the current rate limit window for the specific endpoint.
X-Ratelimit-Resetdouble
The time at which the current rate limit window resets, expressed in UTC epoch seconds.

Response

The search completed successfully.
datalist of objects
Search results, ordered by relevance.
effective_search_optionsobject

The video options applied to this search, including any defaults.

  • When the search includes videos: this object contains a video field with the modalities used.
  • When the search is limited to images (the filter.asset_type field excludes videos): no video options apply, and this object is empty.

Any option you omit is returned with its default value. For example, the video field shows ["visual"] for modalities when you don’t set search_options.video.

next_page_tokenstringOptional

Pagination token for the next page. Pass this value as the page_token parameter in your next request to retrieve more results. Absent when no more pages exist.

Errors

400
Bad Request Error
404
Not Found Error
410
Gone Error
422
Unprocessable Entity Error
429
Too Many Requests Error