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

@fiale-plus/bls-cli

v0.1.0

Published

Unofficial CLI and TypeScript client for the BLS API (Bureau of Labor Statistics) — designed for AI agents

Downloads

24

Readme

@fiale-plus/bls-cli

npm version npm downloads Test License: MIT

Unofficial CLI and TypeScript client for the BLS Public Data API v2 (Bureau of Labor Statistics) — designed for AI agents.

Features

  • Time series data, surveys, and popular series via CLI commands
  • Zero runtime dependencies — Node 18+ native fetch and parseArgs
  • JSON output by default — structured, agent-friendly, pipe to jq
  • CSV and table formats--format csv or --format table for human workflows
  • Built-in shortcutsbls cpi, bls unemployment, bls jobs for common series
  • TypeScript library — import BlsClient for programmatic use with full type safety
  • v2 features — catalog metadata, calculations, annual averages, aspects

Quick Start

npm install -g @fiale-plus/bls-cli
export BLS_API_KEY=your-key-here

bls cpi --start-year 2020 --end-year 2024
bls series CUUR0000SA0 LNS14000000
bls unemployment --calculations

Get a free API key at: https://www.bls.gov/developers/home.htm

Installation

# Global (CLI usage)
npm install -g @fiale-plus/bls-cli

# Local (library usage)
npm install @fiale-plus/bls-cli

Requires Node.js >= 18.0.0.

CLI Usage

Series Command

bls series <id> [<id2>...]                     # Get time series data

Shortcut Commands

bls cpi                                        # CPI-U All Items (CUUR0000SA0)
bls unemployment                               # Unemployment Rate (LNS14000000)
bls jobs                                       # Total Nonfarm Employment (CEU0000000001)

Discovery Commands

bls popular                                    # 25 most popular series
bls surveys                                    # List all surveys
bls survey <id>                                # Survey metadata
bls search <text>                              # Help finding series IDs

Series Options

| Flag | Description | |------|-------------| | --start-year <YYYY> | Start year for data | | --end-year <YYYY> | End year for data | | --catalog | Include catalog metadata (v2 only) | | --calculations | Include net/percent changes (v2 only) | | --annual-average | Include annual averages (v2 only) |

Common Options

| Flag | Description | |------|-------------| | --api-key <key> | API key (or set BLS_API_KEY env var) | | -f, --format <json\|csv\|table> | Output format (default: json) | | --help | Show help | | --version | Show version |

API Key

The BLS API works without a key (v1 mode, limited), but v2 features require registration.

  • Without key: 25 queries/day, 10 years max, no catalog/calculations
  • With key: 500 queries/day, 20 years max, full v2 features

Get a free key at: https://www.bls.gov/developers/home.htm

Set it as an environment variable:

export BLS_API_KEY=your-key-here

Or pass it per-command:

bls cpi --api-key your-key-here

Library Usage

import { BlsClient } from "@fiale-plus/bls-cli";

const bls = new BlsClient(process.env.BLS_API_KEY);

// Get CPI data
const data = await bls.getSeriesData(
  ["CUUR0000SA0"],
  { startYear: "2020", endYear: "2024", calculations: true },
);
console.log(data.Results.series);

// Get popular series
const popular = await bls.getPopularSeries();
console.log(popular);

// List surveys
const surveys = await bls.getSurveys();
console.log(surveys);

Development

git clone https://github.com/fiale-plus/bls-cli.git
cd bls-cli
npm install
npm run build
npm test

# Dev mode (runs TypeScript directly)
npm run dev -- cpi --start-year 2023 --end-year 2024
npm run dev -- series CUUR0000SA0 LNS14000000

# Integration tests (requires BLS_API_KEY)
BLS_API_KEY=your-key npm run test:integration

Disclaimer

This is an unofficial, community-maintained tool. It is not affiliated with, endorsed by, or connected to the Bureau of Labor Statistics, the U.S. Department of Labor, or any government entity.

This tool accesses the publicly available BLS Public Data API. Data retrieved through this tool is sourced from BLS and is provided for informational purposes only. It should not be used as the sole basis for financial or policy decisions. Always verify data against official sources.

This software is provided "AS IS" under the MIT License, without warranty of any kind.

Links

License

MIT