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

searchhive-js

v1.1.0

Published

TypeScript SDK for the SearchHive API

Readme

searchhive-js

TypeScript SDK for the SearchHive API. Zero runtime dependencies — uses native fetch.

Install

npm install searchhive-js

Setup

import { SearchHive } from "searchhive-js";

const client = new SearchHive({ apiKey: "sk_live_..." });
// Or custom base URL:
// const client = new SearchHive({ apiKey: "sk_live_...", baseUrl: "https://your-instance.com/api/v1" });

Methods

client.swiftSearch({ query, max_results?, auto_scrape_top?, include_contacts?, include_social? })

Search + optional auto-scraping, contacts, and social profiles.

const res = await client.swiftSearch({
  query: "best AI tools 2025",
  max_results: 10,
  auto_scrape_top: 3,
  include_contacts: true,
  include_social: true,
});

console.log(res.search_results);  // [{title, link, snippet, position, date}]
console.log(res.scraped_content); // [{url, title, text, links, images, metadata, error}]
console.log(res.contacts);        // [{type, value, source_url, source_title}]
console.log(res.social_profiles); // [{platform, url, username, source_url, source_title}]
console.log(res.credits_used, res.remaining_credits);

client.scrapeForge({ url, extract?, wait_for?, timeout?, use_browser? })

Scrape a single URL.

const res = await client.scrapeForge({
  url: "https://example.com",
  extract: ["h1", ".main-content"],
  wait_for: "article.loaded",
  timeout: 30,
  use_browser: false,
});

console.log(res.title, res.text);
console.log(res.credits_used);

client.deepDive({ query, max_pages?, extract_content?, include_domains?, exclude_domains? })

Deep research: search + multi-page scraping + summary.

const res = await client.deepDive({
  query: "Rust vs Go performance comparison",
  max_pages: 5,
  extract_content: true,
});

console.log(res.summary);
console.log(res.scraped_content);
console.log(res.credits_used, res.remaining_credits);

client.batchScrape({ urls, extract?, timeout?, use_browser? })

Scrape multiple URLs in one request.

const results = await client.batchScrape({
  urls: ["https://example.com", "https://other.com"],
  timeout: 30,
});

client.health()

Check API status.

const { status } = await client.health();

Error Handling

import { SearchHiveError, RateLimitError, AuthenticationError } from "searchhive-js";

try {
  await client.swiftSearch({ query: "test" });
} catch (err) {
  if (err instanceof AuthenticationError) {
    // Invalid API key
  } else if (err instanceof RateLimitError) {
    // 429 — back off
  } else if (err instanceof SearchHiveError) {
    console.log(err.status, err.message);
  }
}

Backwards Compatibility

Old method names still work as aliases:

| Old | New | |-----|-----| | client.search() | client.swiftSearch() | | client.scrape() | client.scrapeForge() | | client.research() | client.deepDive() | | client.batchScrape() | (unchanged) |

These are marked @deprecated and will be removed in a future version.

License

MIT