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

letarticle=awaitdiffbot.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:

ParamTypeRequiredDescription
urlstringYesWeb page URL of the article to process (required unless posting plain text)
fieldsstring[]NoUsed to specify optional fields to be returned by the Article API. See fields: https://www.diffbot.com/dev/docs/article/#fields
pagingbooleanNoPass paging=false to disable automatic concatenation of multiple-page articles. (By default, Diffbot will concatenate up to 20 pages of a single article.)
maxTagsnumberNoSet the maximum number of automatically-generated tags to return. By default a maximum of ten tags will be returned.
tagConfidencenumberNoSet 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.
discussionbooleanNoPass discussion=false to disable automatic extraction of article comments.
timeoutnumberNoSets 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).
callbackstringNoUse for jsonp requests. Needed for cross-domain ajax.
proxystringNoUsed 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)
proxyAuthstringNoUsed to specify the authentication parameters that will be used with the proxy specified in the &proxy parameter. (Ex: &proxyAuth=username:password)
naturalLanguagestring[]NoUsed to request the output of the Diffbot Natural Language API in the field naturalLanguage. Example: &naturalLanguage=entities,facts,categories,sentiment.
bodystringNoOptional HTML markup to pass as POST body
customJSstringNoThis functionality is currently in beta. See docs for details: https://docs.diffbot.com/docs/en/api-article#custom-javascript
customHeadersobjectNoThis functionality is currently in beta. See docs for details: https://docs.diffbot.com/docs/en/api-article#custom-headers

Clone this wiki locally