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

@opendata.best/sdk

v0.1.0

Published

Official TypeScript/JavaScript SDK for the opendata.best API

Readme

@opendata/sdk

Official TypeScript/JavaScript SDK for the opendata.best API.

Features

  • ✅ Full TypeScript support with strict types
  • ✅ Zero runtime dependencies (native fetch, Node 18+)
  • ✅ Auto-pagination via async iterators
  • ✅ Automatic retry with exponential backoff
  • ✅ Quota tracking from response headers
  • ✅ Typed error hierarchy

Installation

npm install @opendata/sdk

Quick Start

import { OpenData } from '@opendata/sdk';

const client = new OpenData({ apiKey: 'pk_live_xxx' });

// List products
const products = await client.products.list();

// Search records
const page = await client.products.search('us_sec', { q: 'Tesla', limit: 50 });
console.log(page.data);       // Record<string, unknown>[]
console.log(page.meta.cursor); // string | null

// Auto-paginate
for await (const record of client.products.searchAll('us_sec', { q: 'Tesla' })) {
  console.log(record);
}

// Export
const data = await client.products.export('us_sec', { format: 'json', limit: 5000 });

// Groups
const groups = await client.groups.list();
const results = await client.groups.search('us_compliance', { q: 'bank' });

// Quota info (updated after every request)
console.log(client.quota);

Configuration

const client = new OpenData({
  apiKey: 'pk_live_xxx',          // Required
  baseUrl: 'https://...',          // Optional, default: https://opendata.best/api/v1/data
  timeout: 30000,                  // ms, default: 30000
  maxRetries: 3,                   // default: 3
});

Error Handling

import {
  OpenDataError,
  AuthenticationError,
  NotFoundError,
  RateLimitError,
  UpstreamError,
  APIError,
} from '@opendata/sdk';

try {
  await client.products.get('unknown');
} catch (err) {
  if (err instanceof NotFoundError) {
    console.log('Product not found');
  } else if (err instanceof RateLimitError) {
    console.log(`Quota exceeded (${err.quotaType}), retry after ${err.retryAfter}s`);
  } else if (err instanceof AuthenticationError) {
    console.log('Invalid API key');
  }
}

Error classes

| Class | Codes | |-------|-------| | AuthenticationError | AUTH_REQUIRED, AUTH_INVALID | | PermissionError | PRODUCT_ACCESS_DENIED, EXPORT_NOT_ENABLED | | NotFoundError | PRODUCT_NOT_FOUND | | RateLimitError | QUOTA_EXCEEDED_DAILY, QUOTA_EXCEEDED_MONTHLY | | UpstreamError | UPSTREAM_ERROR, UPSTREAM_TIMEOUT, UPSTREAM_RATE_LIMITED, UPSTREAM_UNAVAILABLE | | APIError | INTERNAL_ERROR, unexpected | | TimeoutError | Request timeout |

API Reference

client.products

| Method | Returns | |--------|---------| | list() | Promise<Product[]> | | get(productId) | Promise<Product> | | schema(productId) | Promise<ProductSchema> | | search(productId, options?) | Promise<SearchResult> | | searchAll(productId, options?) | AsyncGenerator<Record<string, unknown>> | | export(productId, options?) | Promise<Record<string, unknown>[]> |

client.groups

| Method | Returns | |--------|---------| | list() | Promise<ProductGroup[]> | | get(groupId) | Promise<ProductGroup> | | search(groupId, options?) | Promise<SearchResult> | | searchAll(groupId, options?) | AsyncGenerator<Record<string, unknown>> |

client.health()

No auth required. Returns server health status.

client.stats()

Returns usage stats scoped to your API key.

client.quota

Returns QuotaInfo extracted from the last response headers:

{
  dailyLimit?: number;
  dailyRemaining?: number;
  monthlyLimit?: number;
  monthlyRemaining?: number;
  plan?: string;
}

License

MIT