RapidAPI logo

Diffbot

FREE
By diffbot
Updated 4 months ago
Data
5.6/10
Popularity Score
19277ms
Latency
94%
Success Rate

Diffbot API Documentation

Diffbot extracts data from web pages automatically and returns structured JSON. For example, our Article API returns an article's title, author, date and full-text. Use the web as your database!

We use computer vision, machine learning and natural language processing to add structure to just about any web page.

View API Details
GETArticle API
GETFrontpage
GETProduct API
GETArticle API

The Article API is used to extract clean article text from news articles, blog posts, and other text-heavy web pages.

Authorization:

You can get a developer token at http://www.diffbot.com/pricing/

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
urlSTRING
REQUIREDURL to extract article from (URLEncoded)
tokenQUERY
REQUIREDDeveloper token -- register for a token at http://www.diffbot.com/pricing
Optional Parameters
timeoutNUMBER
OPTIONALSpecify a value in milliseconds (e.g., &timeout=15000) to override the default API timeout of 5000ms.
pagingBOOLEAN
OPTIONALSend paging=false to disable automatic concatenation of multi-page articles.
fieldsSTRING
OPTIONALSend in a list of comma-separated fieldnames to override default field output in the response.
Code Snippet
unirest.get("https://diffbot-diffbot.p.rapidapi.com/v2/article?timeout=15000&fields=text%2Chtml%2Cimages(pixelHeight%2CpixelWidth)&url=http%3A%2F%2Fblog.diffbot.com%2Fdiffbot-api-batch-requests%2F")
.header("X-RapidAPI-Host", "diffbot-diffbot.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://diffbot-diffbot.p.rapidapi.com/v2/article
Request Method: GET
Response Headers
Response Body
Log inSign up

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.get("https://diffbot-diffbot.p.rapidapi.com/v2/article?timeout=15000&fields=text%2Chtml%2Cimages(pixelHeight%2CpixelWidth)&url=http%3A%2F%2Fblog.diffbot.com%2Fdiffbot-api-batch-requests%2F")
.header("X-RapidAPI-Host", "diffbot-diffbot.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication