Product Extraction API

The Product API automatically extracts complete data from any shopping or e-commerce product page. Retrieve full pricing information, product IDs (SKU, UPC, MPN), images, product specifications, brand and more.


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

Provide the following arguments:

Developer token
Web page URL of the product to process (URL encoded)
Optional arguments
Used to specify optional fields to be returned by the Product API. See the Fields section below.
Pass discussion=false to disable automatic extraction of product reviews. See 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.

The fields argument

Use the fields argument to return optional fields in the JSON response. The default fields will always be returned. For nested arrays, use parentheses to retrieve specific fields, or * to return all sub-fields.

For example, to return links and meta (in addition to the default fields), your &fields argument would be:



The Product API returns data in JSON format.

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 product).
URL of submitted page / page from which the product is extracted.
Returned if the pageUrl redirects to another URL.
Title of the product.
Text description, if available, of the product.
Item's brand name.
Offer or actual/final price of the product.
Regular or original price of the product, if available.
Shipping price.
Discount or amount saved off the regular price.
offerPrice separated into its constituent parts: amount, symbol, and full text.
regularPrice separated into its constituent parts: amount, symbol, and full text.
saveAmount separated into its constituent parts: amount, symbol, full text, and whether or not it is a percentage value.
Diffbot-determined unique product ID. If upc, isbn, mpn or sku are identified on the page, productId will select from these values in the above order.
Universal Product Code (UPC/EAN), if available.
Stock Keeping Unit -- store/vendor inventory number or identifier.
Manufacturer's Product Number.
International Standard Book Number (ISBN), if available.
If a specifications table or similar data is available on the product page, individual specifications will be returned in the specs object as name/value pairs. Names will be normalized to lowercase with spaces replaced by underscores, e.g. display_resolution.
Array of images, if present within the product.
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.
Height of image as (re-)sized via browser/CSS.
Width of image as (re-)sized via browser/CSS.
Raw image height, in pixels.
Raw image width, in pixels.
Returns true if image is identified as primary based on visual analysis.
XPath expression identifying the image node.
Internal ID used for indexing.
Product reviews, as extracted by the Diffbot Discussion API. See below.
Country of origin as identified by UPC/ISBN.
If available, two-character ISO country code where the product was produced.
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 Product 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.
The following fields are in an early beta stage:
Item's availability, either true or false.
Returns an inferred category from Diffbot's product categorization taxonomy.
Returns array of product color options.
Returns normalized specifications if a specifications table (or similar element) is found on the product page. More details on normalization.
Returns true if multiple products are distinctly available on the product page.
If the product is available in a range of prices, the minimum and maximum values will be returned. The lowest price will also be returned as the offerPrice.
The minimum price for the offered item.
The maximum price for the offered item.
If the product is available with quantity-based discounts, all identifiable price points will be returned. The lowest price will also be returned as the offerPrice.
The minimum quantity required to purchase for the associated price.
Price of the specific quantity level.
Size(s) available, if identified on the page.

Review Extraction

By default the Product API will attempt to extract user reviews from product pages, using integrated functionality from the Diffbot Discussion API. Review data will be returned in the discussion object (nested within the primary product object). The full syntax for discussion data is available in the Discussion API documentation.

Discussion extraction can be disabled using the argument discussion=false. Note that if a page has recently been processed by Diffbot, cached reviews may be returned even if discussion=false is passed.

Example Response

  "request": {
    "pageUrl": "",
    "api": "product",
    "options": [],
    "fields": "title,text,offerPrice,regularPrice,saveAmount,pageUrl,images",
    "version": 3
  "objects": [
      "type": "product",
      "title": "Before I Go To Sleep",
      "text": "Memories define us. So what if you lost yours every time you went to sleep? Your name, your identity, your past, even the people you love -- all forgotten overnight. And the one person you trust may be telling you only half the story. Before I Go To Sleep is a disturbing psychological thriller in which an amnesiac desperately tries to uncover the truth about who she is and who she can trust.",
      "offerPrice": "$7.99",
      "regularPrice": "$9.99",
      "saveAmount": "$2.00",
      "pageUrl": "",
      "images": [
          "title": "Before I Go to Sleep cover",
          "url": "",
          "xpath": "/HTML[@class='no-js']/BODY[@id='page-product']/DIV[@class='content-frame']/DIV[@class='content']/DIV[@class='content-shop']/DIV[@class='row']/DIV[@class='span5']/DIV[@class='product-thumbs']/UL/LI[@class='first-image']/A[@class='single_image']/IMG",
          "diffbotUri": "image|1|768070723"
      "diffbotUri": "product|1|937176621"


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.

HTML Post Sample:

curl -H "Content-Type: text/html" -d '<html><head><title>Something to Buy</title></head><body><h2>A Pair of Jeans</h2><div>Price: $31.99</div></body></html>' ''