- Obtain your API key
- Create a collection
- Upload a video for indexing
- Query the video or an entire collection
Prerequisites
-
A command-line tool like
curl
(installed by default on most Unix-based systems) - An API key from your account settings. Click here to get one.
Create a Collection
A collection is a container for your videos. Let’s create one namedMy First Collection
.
Request
Response
Upload a Video to the Collection
Provide the video’s URL and the collection ID. The AI will index this video so it can be queried later. Note: the URL must point directly at a video file (eg the url ends in a video file extension) Feel free to use this video: https://storage.googleapis.com/tldr-public/static/never_gonna_give_you_up.mp4Request
Response
Check Video Indexing Progress
Indexing might take a moment. Check the status with the collection ID.Request
Response
Query Video Collection
Ask questions like “What topics are discussed at 10 minutes?” by providing the media_ids array with a single video’s ID.Request
Response