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

chocodata-cli

v0.1.0

Published

Command-line interface for the Chocodata web scraping API. Scrape Amazon, Walmart, eBay, Bing, TikTok and 490+ more endpoints from your terminal, as JSON or NDJSON.

Readme

chocodata-cli

Command-line interface for the Chocodata web scraping API. Scrape from a terminal or a shell script, get JSON or NDJSON.

npm install -g chocodata-cli
chocodata login asa_live_YOUR_KEY

Node 18+. Get a key at chocodata.com; the free tier is 1,000 requests, one time, no card.

Usage

chocodata <target> <resource> [--param value]

The CLI mirrors the API's own shape: a target, a resource, then that endpoint's parameters as flags.

chocodata amazon product --query 0143127748
chocodata amazon product --query 0143127748 --domain de
chocodata amazon search --query laptop

chocodata walmart product --url https://www.walmart.com/ip/19075520026
chocodata ebay product --url https://www.ebay.com/itm/298520538688

chocodata bing search --q coffee --count 10
chocodata bing images --q "red panda" --count 20 --safe_search strict

chocodata tiktok profile --username rotana
chocodata youtube video --video_id dQw4w9WgXcQ
chocodata instagram profile --username nasa

Parameters differ per endpoint, and the CLI passes flags through rather than inventing a uniform surface it cannot honour: amazon product takes --query, walmart product takes --url or --id and rejects --query, bing search takes --q. All 499 endpoints work this way, including ones not listed above. Browse them at chocodata.com/scraper-api.

Batch from a file

--stdin-param reads values from stdin, one per line, and feeds them into a parameter. With --ndjson you get one compact object per line, ready for jq or a warehouse loader.

cat asins.txt | chocodata amazon product --stdin-param query --ndjson > out.ndjson

# with jq
cat asins.txt | chocodata amazon product --stdin-param query --ndjson \
  | jq -r '[.asin, .title, .price] | @csv'

Errors go to stderr and successful rows to stdout, so a partial failure still leaves you a clean NDJSON stream.

Authentication

In order of precedence:

  1. CHOCODATA_API_KEY environment variable
  2. ~/.chocodata/config.json, written by chocodata login with 0600 permissions
chocodata whoami    # shows which key is in use, masked

Flags

| Flag | Meaning | |---|---| | --ndjson | One compact JSON object per line. Default is pretty-printed JSON. | | --stdin-param <name> | Read values from stdin, one per line, into that parameter. | | --debug | Log every HTTP call to stderr with timings. | | --help | Usage and examples. |

Exit codes

0 on success. 1 if the request failed (or, in batch mode, if every row failed). The error line carries the status, the API's error code, and the request id for support:

error 404 item_not_found: That TikTok handle does not resolve: it has been
deleted, renamed, or is unavailable in this region. (request d2f460a7-...)

You are only charged on a 2xx. Errors cost no credits. Retryable failures (429, 5xx, network) are retried automatically with backoff.

License

MIT