Skip to content

Knowledge Graph API

Isaac edited this page Aug 6, 2021 · 1 revision

Diffbot documentation:

https://docs.diffbot.com/kgapi

Usage

letkg=awaitdiffbot.knowledgeGraph({query: 'type:LocalBusiness location.{country.name:"Canada" city.name:"Ottawa" isCurrent:true}'});console.log(kg.hits);console.log(kg.data);

Full list of supported parameters:

ParamTypeRequiredDescription
querystringYesThe DQL knowledge base query
typestringNoType of search: "query", "text", or "queryTextFallback"
sizenumberNoMax number of results in page
fromnumberNoOrdinal position of first result to return. (First position is 0.) Default is 0.
jsonmodestringNojsonmode=extended returns origin information for facts
nonCanonicalFactsbooleanNoReturn non-canonical facts. Default is no non-canonical facts.
noDedupArticlesbooleanNoIndicates that articles should not be deduplicated but all of them returned

Clone this wiki locally