npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dataotto/scrapebit-sdk

v1.0.0

Published

Official Node.js SDK for Scrapebit - AI-powered web scraping API

Readme

Scrapebit Node.js SDK

The official Node.js SDK for Scrapebit - AI-powered web scraping API.

npm version License: MIT

Installation

npm install @dataotto/scrapebit-sdk

Quick Start

import { Scrapebit } from '@dataotto/scrapebit-sdk';

const scrapebit = new Scrapebit('sb_live_your_api_key');

const result = await scrapebit.scrape('https://example.com/products');
console.log(result.data);

Features

  • AI-Powered Extraction - Use natural language prompts to describe what data you want
  • Structured Output - Get clean, structured JSON data
  • Multi-Page Scraping - Handle pagination automatically (paid plans)
  • PDF Generation - Convert any webpage to PDF
  • Screenshot Capture - Full-page or element screenshots
  • Scheduled Tasks - Set up recurring scrapes
  • Website Monitoring - Monitor pages for changes
  • Deep Research - AI-powered research and analysis

Usage

Initialize the Client

import { Scrapebit } from '@dataotto/scrapebit-sdk';

const scrapebit = new Scrapebit('sb_live_your_api_key');

// With custom configuration
const scrapebit = new Scrapebit('sb_live_your_api_key', {
  timeout: 60000,
  retries: 3,
});

Web Scraping

// Basic scrape with AI prompt
const result = await scrapebit.content.scrape({
  url: 'https://example.com/products',
  prompt: 'Extract all product names, prices, and descriptions'
});

console.log(result.data);
// [
//   { name: 'Product 1', price: '$19.99', description: '...' },
//   { name: 'Product 2', price: '$29.99', description: '...' },
// ]

Structured Extraction

const result = await scrapebit.content.scrape({
  url: 'https://example.com/team',
  prompt: 'Extract team member information',
  columns: ['name', 'role', 'email', 'linkedin']
});

Multi-Page Scraping

Note: Pagination requires a paid plan (Starter and above).

const result = await scrapebit.content.scrape({
  url: 'https://example.com/listings',
  prompt: 'Extract all listing titles and prices',
  pagination: {
    nextButtonSelector: '.next-page',
    maxPages: 5,
    delayMs: 1000
  }
});

Check Usage and Plan

const usage = await scrapebit.usage.get();

console.log(`Credits remaining: ${usage.credits_remaining}`);
console.log(`Plan: ${usage.plan.name}`);
console.log(`API requests today: ${usage.api_requests_today}`);

// Check if you have enough credits
if (await scrapebit.usage.hasCredits(5)) {
  // Proceed with operation
}

PDF Generation

const pdf = await scrapebit.pdf.generate({
  url: 'https://example.com/report',
  format: 'a4',
  orientation: 'portrait',
  margin: { top: '20px', bottom: '20px', left: '20px', right: '20px' }
});

console.log(pdf.pdfUrl);

Screenshot Capture

const screenshot = await scrapebit.screenshot.capture({
  url: 'https://example.com',
  format: 'png',
  fullPage: true
});

console.log(screenshot.imageUrl);

Website Monitoring

const monitor = await scrapebit.monitoring.create({
  name: 'Price Monitor',
  url: 'https://example.com/product',
  checkInterval: 'hourly',
  notifyOnlyOnChanges: true,
  alertChannels: [
    { type: 'email', email: '[email protected]' }
  ]
});

// List all monitors
const monitors = await scrapebit.monitoring.list();

// Pause/resume
await scrapebit.monitoring.pause(monitor.id);
await scrapebit.monitoring.resume(monitor.id);

Scheduled Tasks

const task = await scrapebit.schedule.create({
  url: 'https://example.com/prices',
  type: 'scrape',
  scheduledAt: '2024-01-15T09:00:00Z',
  frequency: 'daily',
  options: {
    prompt: 'Extract all product prices'
  },
  webhookUrl: 'https://your-app.com/webhook'
});

// List scheduled tasks
const tasks = await scrapebit.schedule.list({ status: 'pending' });

// Trigger immediately
await scrapebit.schedule.triggerNow(task.id);

Deep Research

// Create a research session
const session = await scrapebit.deepResearch.createSession({
  name: 'Market Research Q1 2024'
});

// Add scraped content
await scrapebit.deepResearch.addScrapeResult(session.id, 'scrape_abc123');

// Chat with your research data
const response = await scrapebit.deepResearch.chat(session.id, {
  message: 'What are the main trends across these sources?'
});

// Generate analysis
const analysis = await scrapebit.deepResearch.analyze(session.id, {
  type: 'summary',
  prompt: 'Summarize the key findings'
});

Error Handling

import {
  Scrapebit,
  ScrapebitError,
  AuthenticationError,
  RateLimitError,
  InsufficientCreditsError,
  ValidationError,
} from '@dataotto/scrapebit-sdk';

try {
  const result = await scrapebit.content.scrape({
    url: 'https://example.com',
    prompt: 'Extract data'
  });
} catch (error) {
  if (error instanceof AuthenticationError) {
    console.error('Invalid API key');
  } else if (error instanceof RateLimitError) {
    console.error(`Rate limited. Retry after ${error.retryAfter} seconds`);
  } else if (error instanceof InsufficientCreditsError) {
    console.error(`Need ${error.creditsRequired} credits, have ${error.creditsRemaining}`);
  } else if (error instanceof ValidationError) {
    console.error(`Validation error: ${error.message}`);
  } else if (error instanceof ScrapebitError) {
    console.error(`API error: ${error.code} - ${error.message}`);
  }
}

Rate Limits

| Plan | API Requests/Day | |------|------------------| | Free | No API access | | Starter | 100 | | Pro | 500 | | Business | Unlimited |

Rate limit headers are included in responses:

  • X-RateLimit-Limit: Your daily limit
  • X-RateLimit-Remaining: Requests remaining today
  • X-RateLimit-Reset: When the limit resets (ISO 8601)

TypeScript

Full TypeScript support with exported types:

import type {
  ScrapeOptions,
  ScrapeResult,
  PdfOptions,
  ScreenshotOptions,
  UsageInfo,
} from '@dataotto/scrapebit-sdk';

Requirements

Documentation

Full API documentation is available at docs.scrapebit.com.

License

MIT