Titles, topics, and hashtags
Use the /gist
endpoint if you require a swift breakdown of the essence of your videos. This endpoint operates exclusively on a set of predefined formats to generate the following:
- Title: Distills the essence of a video into a brief, coherent phrase, facilitating quick understanding and categorization. For example, a title like “From Consumerism to Minimalism: A Journey Toward Sustainable Living” clearly indicates the video’s narrative trajectory, emphasizing themes related to consumption patterns and sustainable lifestyles.
- Topic: Represents the central themes or subjects of a video and provides a high-level understanding based on the meaning conveyed by all modalities. Topics enable effective categorization and quick referencing. For example, “Shopping Vlog Lifestyle” denotes a video covering aspects related to shopping experiences, vlogging, and the associated lifestyle.
- Hashtag: Concisely summarizes the themes, subjects, or sentiments expressed within a video. Hashtags improve categorization and searchability on social media platforms. For example, hashtags such as
#BlackFriday,
#ShoppingMania,
and#Consumerism
indicate key focal points in a video, potentially related to shopping events, consumer behaviors, or broader commentary on consumption patterns.
For a description of each field in the request and response, see the API Reference > Generate titles, topics, or hashtags page.
Depending on your needs, you can generate either a single type of text or multiple types simultaneously with a single API call. Refer to the examples provided below for guidance.
Prerequisites
The examples in this guide assume the following:
- You’re familiar with the concepts that are described on the Platform overview page.
- You’ve already created an index, and the Pegasus video understanding engine is enabled for this index..
- You’ve uploaded a video, and the platform has finished indexing it.
Generate a title
To generate a title based on the content of a video, invoke the gist
method of the generate
object with the following parameters:
video_id
: A string representing the unique identifier of the video for which you want to generate a title.types
: An array of strings representing the type of text you want to generate . This example uses["title"]
.
The output should look similar to the following one:
Generate a title, topic, and hashtag
To generate a title, topic, and hashtag based on the content of a video, invoke the gist
method of the generate
object with the following parameters:
video_id
: A string representing the unique identifier of the video for which you want to generate a title.types
: An array of strings representing the types of text you want to generate. This example uses["title", "topic", "hashtag"]
.
The output should look similar to the following one: