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

statisticsoftheworld

v1.0.0

Published

Official SDK for Statistics of the World — free API for 490+ global economic indicators, 218 countries, 20+ years of history.

Readme

statisticsoftheworld

Official JavaScript/TypeScript SDK for Statistics of the World — free API for 490+ global economic indicators across 218 countries with 20+ years of history.

Data sourced from IMF, World Bank, FRED, UN, and more.

Install

npm install statisticsoftheworld

Quick Start

import { createClient } from 'statisticsoftheworld';

const sotw = createClient();

// List all countries
const { data: countries } = await sotw.countries();
console.log(countries[0]); // { id: "USA", name: "United States", ... }

// Get all indicators for a country
const { indicators } = await sotw.country('CAN');
console.log(indicators); // [{ id: "IMF.NGDPD", value: 2420000000000, ... }, ...]

// GDP rankings — top 10
const { data: top10 } = await sotw.rankings('IMF.NGDPD', { limit: 10 });
console.log(top10); // [{ rank: 1, country: "United States", value: ... }, ...]

// Historical GDP for Canada (20+ years)
const { data: history } = await sotw.history('IMF.NGDPD', 'CAN');
console.log(history); // [{ year: 2000, value: 744631000000 }, ...]

API Key (Optional)

Without a key you get 1,000 requests/day. For higher limits, get a free key at statisticsoftheworld.com/pricing:

const sotw = createClient({ apiKey: 'sotw_your_key_here' });

API Reference

createClient(options?)

Create a new client instance.

| Option | Type | Default | Description | |--------|------|---------|-------------| | apiKey | string | — | API key for higher rate limits | | baseUrl | string | https://statisticsoftheworld.com | Base URL override |

Methods

| Method | Description | |--------|-------------| | sotw.countries() | List all 218 countries | | sotw.country(id) | Get a country with all indicator values (e.g., 'USA', 'CAN') | | sotw.indicators() | List all 490+ indicators | | sotw.indicator(id) | Get an indicator ranked across all countries | | sotw.history(indicator, country) | Get 20+ years of historical data | | sotw.rankings(indicator, { limit? }) | Get countries ranked by an indicator |

Common Indicator IDs

| ID | Indicator | |----|-----------| | IMF.NGDPD | GDP (nominal, USD) | | SP.POP.TOTL | Population | | IMF.PCPIPCH | Inflation rate (%) | | SL.UEM.TOTL.ZS | Unemployment rate (%) | | SP.DYN.LE00.IN | Life expectancy | | NY.GDP.PCAP.CD | GDP per capita |

Links

License

MIT