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

scrape-sdk

v0.3.0

Published

TypeScript client to scrape URLs to markdown with failover across Firecrawl, TinyFish, Jina, Tavily, Spider, Browserbase, and local Cheerio

Downloads

135

Readme

Scrape SDK

One TypeScript client for scraping URLs to markdown. Pick Firecrawl, TinyFish, Jina, Tavily, Spider, Browserbase, or local Cheerio, then fail over without rewriting callers.

  • Adapters against live vendor APIs: Firecrawl v2, TinyFish Fetch/Search/Agent, Jina, Tavily, Spider.cloud, Browserbase Fetch, and Cheerio
  • scrape(url) is the verb. map(), crawl(), extract(), search(), agent(), and scrapeMany() when a provider can do them
  • Abortable timeouts, retries on retryable errors, and automatic failover
  • Site/docs roots try /llms.txt before HTML
  • fromEnv() builds the client from the keys you already have
  • CLI, Vercel AI SDK tools, and an MCP server for full-page markdown

Install

npm install scrape-sdk

Works on Node 20+ and Bun. Keep provider API keys out of client code.

Usage

import { scrape } from "scrape-sdk";

const page = await scrape("https://stripe.com");
console.log(page.markdown);
console.log(`via ${page.provider} in ${page.latencyMs}ms`);

No API key required — Jina + local are always in the chain. Add keys and it fails over:

import { fromEnv } from "scrape-sdk";

const scraper = fromEnv();
const page = await scraper.scrape("https://stripe.com");

Firecrawl Keyless is opt-in so a no-key upgrade does not silently change your network or free-quota usage:

const scraper = fromEnv({ firecrawlKeyless: true });

Or pick the order yourself:

import { createScrapeClient } from "scrape-sdk";
import { firecrawl } from "scrape-sdk/firecrawl";
import { jina } from "scrape-sdk/jina";
import { local } from "scrape-sdk/local";

const scraper = createScrapeClient({
  providers: [
    firecrawl({ apiKey: process.env.FIRECRAWL_API_KEY! }),
    jina(),
    local(),
  ],
});

Providers that cannot perform an operation are skipped. If none can, you get a CapabilityError instead of a fake result.

Behavior notes for 0.3.0

  • Client timeouts are cumulative across the /llms.txt probe, retries, and fallback providers.
  • maxChars: 0 is a hard zero-character limit; non-empty output is marked truncated.
  • Unsupported adapter options now fail explicitly instead of silently degrading. Target-page headers and format: "html" can raise UnsupportedOptionError on adapters that cannot honor them.

Methods

| Method | Use when | | :--- | :--- | | scrape(url) | You already have a URL | | search(query) | You need to find URLs | | map(url) | You need a site's URL list, not bodies | | crawl(url) | You need many page bodies from one site | | extract(url, { schema }) | You need structured JSON | | scrapeMany(urls) | You have a list of URLs | | agent(url, { goal }) | You need an interactive, multi-step web task |

Providers

| Provider | Import | Key | scrape | search | map | crawl | extract | JS | | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | | Firecrawl v2 / Keyless | scrape-sdk/firecrawl | optional | yes | yes | yes | yes | yes | yes | | TinyFish Fetch/Search + Agent* | scrape-sdk/tinyfish | yes | yes | yes | — | — | Agent* | yes | | Jina | scrape-sdk/jina | optional | yes | yes | — | — | — | yes | | Tavily | scrape-sdk/tavily | yes | yes | yes | — | — | — | — | | Spider.cloud | scrape-sdk/spider | yes | yes | — | — | yes | — | yes | | Browserbase | scrape-sdk/browserbase | yes | yes | — | — | — | yes | — | | Local Cheerio | scrape-sdk/local | no | yes | — | — | — | — | no |

Agent* is available only when TinyFish is configured with enableAgent: true.

TinyFish Fetch/Search are free within the provider's account limits. TinyFish Agent is opt-in because it is a metered goal-based browser run; configure tinyfish({ apiKey, enableAgent: true }) or fromEnv({ tinyfishAgent: true }). TinyFish does not provide native map() or crawl() in this adapter.

Firecrawl Keyless supports the no-key free surface; use FIRECRAWL_KEYLESS=1 or fromEnv({ firecrawlKeyless: true }). Firecrawl crawl returns a job id; the adapter polls until it finishes. Browserbase is POST /v1/fetch, not a Playwright session, so it does not run page JavaScript.

CLI

npx scrape-sdk https://stripe.com
npx scrape-sdk search "vercel ai sdk tools"
npx scrape-sdk map https://docs.firecrawl.dev
npx scrape-sdk crawl https://docs.firecrawl.dev --limit 5 --json
npx scrape-sdk scrape https://example.com --provider local

MCP

{
  "mcpServers": {
    "scrape-sdk": {
      "command": "npx",
      "args": ["-y", "scrape-sdk-mcp"],
      "env": {
        "FIRECRAWL_API_KEY": "fc-...",
        "FIRECRAWL_KEYLESS": "1",
        "TINYFISH_API_KEY": "sk-tinyfish-...",
        "TINYFISH_AGENT": "1",
        "TAVILY_API_KEY": "tvly-..."
      }
    }
  }
}

scrape_url returns the full page as markdown — not a summary. Host WebFetch often summarizes; this does not. map_site, crawl_site, and extract_json register when the configured providers support them.

Documentation

Full docs live at scrape-sdk.com/docs. Good places to start:

License

MIT © Arush Wadhawan