This guide covers adding user-defined metadata to already-indexed videos using the Partial update video information method. You can also provide user-defined metadata when uploading content using the Create an asset method.
Metadata includes technical and contextual information about each video uploaded to the platform. user-defined metadata allows you to add more data to your videos, providing more detailed, specialized, or context-specific information.
The values you provide must be of the following types: string, integer, float or boolean. If you want to store other types of data such as objects or arrays, you must convert your data into string values.
Once the platform has finished indexing your videos, you can provide user-defined metadata by invoking the update method of the indexes.videos object with the following parameters:
index_id: A string representing the unique identifier of the index containing the video for which you want to provide user-defined metadata.video_id: A string representing the unique identifier of the videouser_metadata: A dictionary containing your user-defined metadata. In this example, the metadata dictionary has four keys: views, downloads, language and country. The views and downloads keys are integers, and thecreation_date and country keys are strings.Once you’ve added user-defined metadata to your videos, you can use it to filter your search results.
The example code below filters on a custom field named views of type integer. The platform will return only the results found in the videos for which the value of the views field equals 120000.
For more details on filtering search results, see the Filtering page.