Skip to content

Knowledge Graph API

Isaac edited this page Aug 6, 2021 · 1 revision

Diffbot documentation:

https://docs.diffbot.com/kgapi

Usage

  let kg = await diffbot.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:

Param Type Required Description
query string Yes The DQL knowledge base query
type string No Type of search: "query", "text", or "queryTextFallback"
size number No Max number of results in page
from number No Ordinal position of first result to return. (First position is 0.) Default is 0.
jsonmode string No jsonmode=extended returns origin information for facts
nonCanonicalFacts boolean No Return non-canonical facts. Default is no non-canonical facts.
noDedupArticles boolean No Indicates that articles should not be deduplicated but all of them returned