Skip to content

Article API

Isaac edited this page Apr 3, 2022 · 5 revisions

Diffbot documentation:

https://www.diffbot.com/dev/docs/article/

Usage

Note: url is optional if including plaintext POST body

  let article = await diffbot.article({
    url: 'https://www.theverge.com/2020/8/25/21400240/epic-apple-ruling-unreal-engine-fortnite-temporary-restraining-order',
    body: 'optional-html-or-plaintext-post-body',
  });
  console.log(article.objects[0].authors);
  console.log(article.objects[0].publisherRegion);
  console.log(article.objects[0].tags);

Full list of supported parameters:

Param Type Required Description
url string Yes Web page URL of the article to process (required unless posting plain text)
fields string[] No Used to specify optional fields to be returned by the Article API. See fields: https://www.diffbot.com/dev/docs/article/#fields
paging boolean No Pass paging=false to disable automatic concatenation of multiple-page articles. (By default, Diffbot will concatenate up to 20 pages of a single article.)
maxTags number No Set the maximum number of automatically-generated tags to return. By default a maximum of ten tags will be returned.
tagConfidence number No Set the minimum relevance score of tags to return, between 0.0 and 1.0. By default only tags with a score equal to or above 0.5 will be returned.
discussion boolean No Pass discussion=false to disable automatic extraction of article comments.
timeout number No 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).
callback string No Use for jsonp requests. Needed for cross-domain ajax.
proxy string No Used to specify the IP address of a custom proxy that will be used to fetch the target page, instead of Diffbot's default IPs/proxies. (Ex: &proxy=168.212.226.204)
proxyAuth string No Used to specify the authentication parameters that will be used with the proxy specified in the &proxy parameter. (Ex: &proxyAuth=username:password)
naturalLanguage string[] No Used to request the output of the Diffbot Natural Language API in the field naturalLanguage. Example: &naturalLanguage=entities,facts,categories,sentiment.
body string No Optional HTML markup to pass as POST body
customJS string No This functionality is currently in beta. See docs for details: https://docs.diffbot.com/docs/en/api-article#custom-javascript
customHeaders object No This functionality is currently in beta. See docs for details: https://docs.diffbot.com/docs/en/api-article#custom-headers