oEmbed format lets you embed the player with a coub video when a user posts a link to it in your web application or site.
To embed a coub video using the oEmbed player you need to make an HTTP request containing a URL of the required video to the Coub endpoint. The endpoint responses with a JSON or an XML data that contains an HTML code for video embedding and data about the required video.
By the way, Embedly service supports coubs.
Coub provides two oEmbed endpoints: one that responses with JSON data, and one that responses with XML data.
The URL of the JSON endpoint:
http://coub.com/api/oembed.json
The URL of the XML endpoint:
http://coub.com/api/oembed.xml
The endpoint accepts url
parameter that should contain a URL to a coub video with following scheme:
http://coub.com/view/:permalink
Apart from the coub video's URL endpoints also accepts several parameters:
Here is an example of the valid HTTP request to the oEmbed endpoint:
GET http://coub.com/api/oembed.json?url=http%3A//coub.com/view/um0um0&autoplay=true&maxwidth=500&maxheight=500
The endpoint responses on requests with a JSON or an XML data that contains several fields:
video
;1.0
;Coub
;http://coub.com/
;Here is the JSON response example:
{
"type": "video",
"version": "1.0",
"width": "450",
"height": "360",
"title": "Dear diary...",
"url": "http://coub.com/view/2hb98",
"thumbnail_url": "http://ell.akamai.coub.com/get/bucket:22.31/p/coub/simple/cw_image/b536fe74cf3/c79a0b057d948743f17b4/med_1405385699_00032.jpg",
"thumbnail_width": "450",
"thumbnail_height": "360",
"author_name": "costruendo l'alba",
"channel_url": "http://coub.com/d608ae26dad95db0aa47655081171555",
"provider_name": "Coub",
"provider_url": "http://coub.com/",
"html": "<iframe src=\"http://coub.com/embed/um0um0\" allowfullscreen=\"true\" frameborder=\"0\" width=\"640\" height=\"512\"></iframe>"
}