Log inJoin

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
ParameterValues
qfree text; "exact phrase", -exclude, OR
sortrelevant | latest | oldest | plays | likes | comments | duration | alphabetical
durationany | short | medium | long | custom (+ min_duration, max_duration in seconds)
uploadedanytime | today | week | month | year | custom (+ from, to as YYYY-MM-DD)
categorycategory slug, includes its sub-categories
licenseany | cc | commercial | by | by-sa | by-nd | by-nc | by-nc-sa | by-nc-nd | cc0
qualityany | sd | hd | hd1080 | uhd
userrestrict to one handle
tagrestrict to one tag slug
page, per_pagepagination, per_page up to 60