YogsDB Video Filters

Video Filters

EXPERIMENTAL. THESE MAY CHANGE. Keep an eye on this page for any changes. I’ll aim to not make any breaking changes but may need to.

To apply filters to an API query, add them as URL parameters. For example to limit results to those with “test” in the title and have more than 5000 views and retrieve 100 results per page, the URL would be

https://api.yogsdb.com/api/videos?title=test&moreViewsThan=5000&orderBy=view_count|asc&limit=100

Available filters

Replace query fields inside <> with the actual query you wish to make, don’t add the <> characters to the query.

youtube_id= return Videos with the YouTube ID (actually will just return one video as this is a unique field)

title= return Videos where the title contains

description= return Videos where the description contains

uploadedAfter= return Videos uploaded after

uploadedBefore= return Videos uploaded before

channel= return Videos where the channel slug is

slug= return Videos where the video slug contains

Note: slugs are the string that appear in the URL

For example in https://yogsdb.com/sips/witcher-3-wild-hunt-now-or-never-part-74 the Channel slug is “sips” and the Video slug is “witcher-3-wild-hunt-now-or-never-part-74”. They’re URL friendly forms of the Channel and Video titles

longerThan= return Videos where the video is longer than . Duration is in seconds

shorterThan= return Videos where the video is shorter than . Duration is in seconds

moreViewsThan= return Videos where the video has more views than

fewerViewsThan= return Videos where the video has fewer views than

moreLikesThan= return Videos where the video has more likes than

fewerLikesThan= return Videos where the video has fewer likes than

moreDislikesThan= return Videos where the video has more dislikes than

fewerDislikesThan= return Videos where the video has fewer dislikes than

moreCommentsThan= return Videos where the video has more dislikes than

fewerCommentsThan= return Videos where the video has fewer dislikes than

orderBy=<FIELD>|<ASC/DESC> order the results by the column followed by a pipe character “|” followed by either asc (ascending) or desc (descending)

limit= returns results matching your query. Max results 1000 to avoid overloading the database. Please use the page parameters to get more than this.

page= returns of results. For example if you add the limit of 100, page 2 will start with the 101st result for your query.

inRandomOrder=1 pulls results in a random order. This is effectively passing ORDER BY RAND() to the SQL query so as you may imagine doesn’t play nicely with the orderBy filter