← All one-liners·#020·discovery·self contained·beginner

PyPI download stats for any package

pypistats.org has a free, no-key endpoint. Useful for ecosystem-trend research without scraping.

The one-liner
$ curl -s "https://pypistats.org/api/packages/pandas/recent" \
  | jq '.data'
What each stage does
  1. [01] curlcurl -s "https://pypistats.org/api/packages/pandas/recent"
    Free public API. Endpoints: /recent (last day/week/month), /overall, /python_major, /python_minor, /system.
  2. [02] jqjq '.data'
    Strip the {package, type, data: {...}} envelope. Pipe the result into another jq if you want a specific window.
Expected output (sample)
{
  "last_day":   2451327,
  "last_week":  16974912,
  "last_month": 72840185
}
Caveats & tips
  • Swap 'pandas' for any pip-installable package name.
  • For historical series, use `/api/packages/<name>/overall?mirrors=true` and group with DuckDB.