oEmbed and the search API
oEmbed
Every watch page advertises its oEmbed endpoint through <link rel="alternate"> tags, so anything that understands oEmbed unfurls a pasted link into the player.
GET https://media.kokai.studio/api/oembed?url=https%3A%2F%2Fmedia.kokai.studio%2F123456789&maxwidth=640
{
"type": "video",
"version": "1.0",
"provider_name": "Kokai Studio Media",
"title": "…",
"author_name": "…",
"html": "<iframe src=\"https://media.kokai.studio/embed/123456789\" …></iframe>",
"width": 640,
"height": 360,
"duration": 212,
"thumbnail_url": "…"
}Add &format=xml for the XML representation, and &maxheight= to constrain height instead of width. Unlisted videos work if the URL includes the hash.
Search API
The search page and the JSON API take the same parameters, so any search you can build in the UI can be fetched as JSON or subscribed to as RSS.
GET https://media.kokai.studio/api/search?q=documentary&duration=medium&license=cc&quality=hd&sort=plays
GET https://media.kokai.studio/api/search?q=surf&tab=people
GET https://media.kokai.studio/api/search/rss?q=animation&uploaded=week| Parameter | Values |
|---|---|
q | free text; "exact phrase", -exclude, OR |
sort | relevant | latest | oldest | plays | likes | comments | duration | alphabetical |
duration | any | short | medium | long | custom (+ min_duration, max_duration in seconds) |
uploaded | anytime | today | week | month | year | custom (+ from, to as YYYY-MM-DD) |
category | category slug, includes its sub-categories |
license | any | cc | commercial | by | by-sa | by-nd | by-nc | by-nc-sa | by-nc-nd | cc0 |
quality | any | sd | hd | hd1080 | uhd |
user | restrict to one handle |
tag | restrict to one tag slug |
page, per_page | pagination, per_page up to 60 |