diffbot-api-node
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 â€ĸ Public â€ĸ Published

diffbot-api-node

npm (scoped) npm bundle size

DiffBot-API-Node is a Promise-based library to use the the DiffBot REST APIs.

Features

Currently supports the following features:

  • Product (no POST support yet)
  • Crawl (Only new crawls, with name, seeds, and apiUrl params)
  • Knowledge Graph

Install

npm install diffbot-api-node

Usage

const DiffBot = require('diffbot-api-node')
const diffbot = new DiffBot('your-api-key-goes-here');

  // Product
  let p = await diffbot.product({
    url: 'https://www.amazon.com/Qihua-Universe-Blanket-Blankets-Travelling/dp/B074J5CYTJ',
    discussion: false,
  });
  console.log(p.objects);

  // Crawl (new)
  let crawl = await diffbot.crawl().new({
    name: 'my-new-crawl',
    seeds: [
      'https://www.cruisebar.com.au/',
      'https://www.sydneyharbourdinnercruises.com.au/',
    ],
  });
  console.log(crawl.response);
  console.log(crawl.jobs);

  // Knowledge Graph
  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);

/diffbot-api-node/

    Package Sidebar

    Install

    npm i diffbot-api-node@0.0.2

    Version

    0.0.2

    License

    MIT

    Unpacked Size

    10.1 kB

    Total Files

    5

    Last publish

    Collaborators

    • therealpadster