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

minifetch-api

v1.2.3

Published

Minifetch.com API Client. Fetch & extract metadata and data from web pages. For SEO research & AI Agents.

Readme

Minifetch API

Fetch & extract metadata and data from web pages. Minifetch.com provides composable extraction APIs for humans and AI Agents-- making web pages simple to access.

  • Sign up for an account and get your first fetches free. 🎉🎉
  • ✅ Always pay-as-you-go at competitive prices.
  • ⛔ No charge for blocked pages (403 errors).

👉 Dashboard | Full API docs | LLMs.txt | Questions? Join our Discord


Payments. Two ways to pay:

  1. Credit card + API key. Get started free - visit our dashboard to Sign Up. Your account will be auto-loaded with 125–250 API calls. Top up with your credit card later.
  2. x402. USDC stablecoin micropayments on Coinbase's Base & Solana networks.

Prerequisites

  • Node.js v18+ & NPM
  • A valid API key from our dashboard
  • Or an Ethereum or Solana private key for making USDC payments on Base or Solana networks.

Install

npm install minifetch-api --save

Quick Start

import Minifetch from "minifetch-api";

// First, initialize the client with your payment choice:

// 1. API Key Payments:
const client = new Minifetch({
  apiKey: process.env.MINIFETCH_API_KEY
});

// 2. x402 Payments:
//   - Network options: "base" or "solana"
//   - Private key from wallet that has a small amt of USDC
const client = new Minifetch({
  network: "base",
  privateKey: process.env.BASE_PRIVATE_KEY,
});

// Now you're ready to extract data from a url:
try {
  const url = "example.com";
  const response = await client.checkAndExtractUrlPreview(url);
  // 200 "ok" responses
  console.log(response);
} catch (err) {
  // No charge for errors or 403 blocked urls!
  console.log(err);
}

Data Extraction Methods

After the Quick Start, you have the following methods to use. The "checkAndExtract" methods help to avoid paying for blocked URLs. Price list & example data is here.

Wrap these in a try/catch just like in the Quickstart example above. Code examples can be also found in the Github repository /example- directories.

// Extracts a light, token-efficient preview of a URL:
// title, description, and image (only).
await client.checkAndExtractUrlPreview(url);

// Extracts a clean, token-efficient content summary as markdown from a URL.
// Removes ads, nav, scripts. More efficient than raw HTML fetches for LLMs.
// Options: { includeMediaUrls: true } - defaults to false.
await client.checkAndExtractUrlContent(url, options);

// Extracts all links from a URL categorized by type (internal/external/anchor).
// Detects image links, nofollow attributes, analyzes external domain distribution.
await client.checkAndExtractUrlLinks(url);

// Extracts rich structured metadata from a URL:
// meta tags, json-ld, images, headings, response headers, + more.
// Setting verbosity to "full" is the drop-in replacement for the
// `url-metadata` package.
// Options:
// { verbosity: "full" } - defaults to "standard"
// { includeResponseBody: true } - defaults to false
await client.checkAndExtractUrlMetadata(url, options);

// For max control, you can also use the following methods directly.
// Free - check robots.txt:
await client.preflightCheck(url);
// Extract data:
await client.extractUrlPreview(url);
await client.extractUrlContent(url, options); // same options as above
await client.extractUrlLinks(url);
await client.extractUrlMetadata(url, options) // same options as above

Error Types

When you wrap the functions above in a try/catch, here are the errors you may encounter. You are never charged for errors.

  • "RobotsBlockedError: URL is blocked by robots.txt"
    • URL is explicitly blocked by the website's robots.txt, cannot be fetched.
  • "Network Error: 402 Payment Required"
    • Check your wallet -- likely you ran out of USDC to pay!
  • "Network Error: 429 Too Many Requests"
    • Back off and retry, max 5-10 requests per second.
  • "Network Error: 502 Bad Gateway"
    • URLs that pass their robots.txt check but are blocked anyway via 403 or other tactics may error like this.
  • "503 Service Temporarily Unavailable"
    • Likely encountering upstream timeout errors on the target URL.
  • "InvalidURLError: Invalid url ${url}"
    • The URL is malformed in some way, correct it and try again.

Service Limitations

Minifetch only extracts publicly available metadata and content from pages accessible without authentication and javascript execution.

What Minifetch does NOT do:

  • Ignore robots.txt directives
  • Access authenticated or logged-in content
  • Create accounts or log into user sessions
  • Perform transactional actions (checkout, bidding, purchasing, form submissions)
  • Bypass paywalls or access restricted content

What Minifetch does NOT do currently but may offer in the future as an add-on:

  • Javascript execution

x402 Best Practices

  • LLMs & Agents should never have direct access to your private key. They will expose it!
  • Only keep a small amount of USDC in the account whose private key you use.
  • Keep that account separate from the rest of your onchain funds.
  • Pass your private key into the Minifetch API Client via an environment variable.

License

MIT / Copyright (c) 2026 Lauren Garcia This package is an API client for Minifetch.com. The client code is open source, but use of the Minifetch API is subject to the Minifetch.com Terms of Service.