Sorting
Python
Node.js
You can sort search results using the sort_option
and group_by
parameters. The platform returns a confidence
field for each matching video clip, indicating how well the clip matches your query.
When you omit the group_by
parameter, the platform returns a flat list of clips sorted by the confidence
field in descending order.
When you set group_by
to “video”, the platform groups results by video and sorts the clips within each video by the confidence field in descending order. You can further sort the list of videos using the sort_option
parameter:
clip_count
: Sorts videos by the number of matching clips in descending order.score
: Sorts videos by the highestconfidence
value among their clips in descending order.
To group the response by video and sort the list of videos on the number of matches:
Python
To group the response by video and sort the list of videos on the maximum value of the confidence
field:
Python