Video Extraction API

The Video API is currently in beta.

The Video API automatically extracts detailed video information—including most metadata, thumbnail images, direct video URL and embed code—from nearly any video page or video platform on the web.


To use the Video API, perform a HTTP GET request on the following endpoint:

Provide the following arguments:

Developer token
Web page URL of the video to process (URL encoded)
Optional arguments
Used to specify optional fields to be returned by the Video API. See the Fields section below.
Sets a value in milliseconds to wait for the retrieval/fetch of content from the requested URL. The default timeout for the third-party response is 30 seconds (30000).
Use for jsonp requests. Needed for cross-domain ajax.


Diffbot's V3 APIs return information about all identified objects on a submitted page.

Each V3 response includes a request object (which returns request-specific metadata), and an objects array, which will include the extracted information for all objects on a submitted page.

Objects in the Product API's objects array will include the following fields:

Type of object (always video).
URL of submitted page / page from which the video is extracted.
Returned if the pageUrl redirects to another URL.
Title of the video.
Text description, if available, of the video.
Direct link to source video file, if available.
Embeddable HTML of the video (if available), typically an IFRAME or VIDEO object.
Embeddable URL, if available.
Video uploader or creator, if available.
Date of extracted video, normalized in most cases to RFC 1123 (HTTP/1.1).
Duration in seconds of the Video.
Number of Video views, if available on the page.
Raw video height, if available, in pixels.
Raw video width, if available, in pixels.
Array of images, if present within the video.
Fully resolved link to image. If the image SRC is encoded as base64 data, the complete data URI will be returned.
Description or caption of the image.
MIME type, if available, as specified by the Video's "Content-Type."
Returns the (spoken/human) language of the submitted page, using two-letter ISO 639-1 nomenclature.
Unique object ID. The diffbotUri is generated from the values of various Video fields and uniquely identifies the object. This can be used for deduplication.
Optional fields, available using fields= argument
Returns a top-level object (links) containing all hyperlinks found on the page.
Returns a top-level object (meta) containing the full contents of page meta tags, including sub-arrays for OpenGraph tags, Twitter Card metadata, microdata, and -- if available -- oEmbed metadata.
Returns any key/value pairs present in the URL querystring. Items without a discrete value will be returned as true.
Returns a top-level array (breadcrumb) of URLs and link text from page breadcrumbs.

Example Response

  "request": {
    "pageUrl": "",
    "api": "video",
    "version": 3
  "objects": [
      "type": "video",
      "title": "Create a Custom API Using Diffbot's Custom API Toolkit",
      "text": "This demonstration shows how to create a completely custom API using Diffbot's Custom API Toolkit. In it we show how to extract the \"What's Hot\" / Trending links from",
      "pageUrl": "",
      "embedUrl": "",
      "humanLanguage": "en",
      "date": "Fri, 02 Aug 2013 07:00:00 GMT",
      "url": "",
      "author": "Diffbot",
      "html": "<iframe width=\"459\" height=\"344\" src=\"\" frameborder=\"0\" allowfullscreen></iframe>",
      "mime": "video/mp4",
      "duration": 343,
      "naturalWidth": 1280,
      "naturalHeight": 720,
      "viewCount": 1000
      "images": [
          "title": "Create a Custom API Using Diffbot's Custom API Toolkit",
          "url": "",
      "diffbotUri": "video|3|566075164",


You can supply Diffbot with basic authentication credentials or custom HTTP headers (see below) to access intranet pages or other sites that require a login.

Basic Authentication

To access pages that require a login/password (using basic access authentication), include the username and password in your url parameter, e.g.:

Custom HTTP Headers

You can supply Diffbot APIs with custom HTTP headers that will be passed along when making requests to third-party sites. These can be used to define specific Referer, User-Agent, Cookie or any other values.

Custom headers should be sent as HTTP headers in your request to, and prepended with X-Forward-.

For instance, to send custom User-Agent, Referer and My-Custom-Header header values:

Desired HeaderSend to

Custom Javascript

This functionality is currently in beta.

Using the X-Evaluate custom header (sent as X-Forward-X-Evaluate), you can inject your own Javascript code into web pages. Custom Javascript will be executed once the DOM has loaded.

Custom Javascript should be provided as a text string and contained in its own function. You must also include the special functions start() and end() to indicate the beginning and end of your custom script. Once end() fires, the updated document will be processed by your chosen extraction API.

It's recommended that your end() function be offset using setTimeout (see JavaScript Timing Events) in order to accommodate your primary function processing. Additionally, if your custom Javascript requires access to Ajax-delivered content, it may be necessary to offset your entire function using setTimeout in order to delay the start of your processing.

The following sample X-Evaluate header waits one-half second after the DOM has loaded, enacts a click on the a.loadMore element, then waits 800 milliseconds before signaling the end():

function() {
    setTimeout(function() {
        var loadMoreNode = document.querySelector('a.loadMore');
        if (loadMoreNode != null) {
            setTimeout(function() {
            }, 800);
        } else {
    }, 500);

Delivered as a string value as a custom header:

"X-Forward-X-Evaluate": "function() {start();setTimeout(function(){var loadMoreNode=document.querySelector('a.loadMore');if (loadMoreNode != null) {;setTimeout(function(){end();}, 800);} else {end();}},500);}"

Posting Content

If your content is not publicly available (e.g., behind a firewall), you can POST markup directly to the Product API endpoint for analysis:

Please note that the url argument is still required, and will be used to resolve any relative links contained in the markup.

Provide the content to analyze as your POST body, and specify the Content-Type header as text/html.