Sorting
Python
Node.js
You can sort search results using the sort_option and group_by parameters. The platform assigns a relevance ranking to each 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 relevance ranking in ascending order, with 1 being the most relevant result.
When you set group_by to video, the platform groups results by video and sorts the clips within each video by relevance ranking in ascending 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 highest relevance ranking (lowest number) among their clips in ascending 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 score field:
Python