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

@maschinenlesbar.org/strahlenschutz-cli

v0.0.3

Published

TypeScript API client and CLI for the open BfS ODL-Info radiation API (imis.bfs.de)

Readme

strahlenschutz-cli

CI Release npm

Query Germany's ambient gamma dose-rate (ODL) monitoring network from your terminal. strahlenschutz is a command-line tool over the open BfS ODL-Info WFS (imis.bfs.de): fetch the latest readings across all ~1 700 stations, look up a single station by its kenn id, or pull hourly/daily time series — all as clean GeoJSON you can pipe straight into jq.

  • Works out of the box — no account, no API key, no configuration. Install and query.
  • Clean GeoJSON output — pretty-printed by default, --compact for one-line/scripting.
  • Three commandslatest, station, and timeseries.
  • Real open data — backed by the Bundesamt für Strahlenschutz's public IMIS network.

Want to use this as a TypeScript library or understand how it's built? See DEVELOPING.md.

Install

npm i -g @maschinenlesbar.org/strahlenschutz-cli

This installs the strahlenschutz command. Requires Node.js 20+.

Check it works:

strahlenschutz --help

Quickstart

No setup needed — the ODL-Info service is open data and requires no key. Your first command:

strahlenschutz latest --max 5

That prints a GeoJSON FeatureCollection with the five most recent station readings. Dose-rate values are in µSv/h and live in each feature's properties. Pull out a station's id and value with jq:

strahlenschutz --compact latest --max 5 \
  | jq -r '.features[] | [.properties.kenn, .properties.value] | @tsv'

Look up a single station you already know:

strahlenschutz station 091811461

Commands

latest                 latest ODL reading per station (GeoJSON FeatureCollection)
station <kenn>         latest reading for one station
timeseries <kenn>      hourly or daily time series for a station

latest options

| Flag | Meaning | | --- | --- | | --station <kenn> | restrict to one station by its numeric kenn id | | --max <n> | max features to return (WFS count) | | --start <n> | paging offset (use together with --max) | | --sort <prop> | sort by a feature property; append D for descending, e.g. "end_measure D" |

station arguments

| Argument | Meaning | | --- | --- | | <kenn> | numeric station id — must be digits only, non-empty |

No per-command options. An unknown kenn exits with code 4.

timeseries options

| Flag | Meaning | | --- | --- | | --resolution ts-1h\|ts-24h | hourly (default) or daily-averaged series | | --max <n> | max features to return | | --start <n> | paging offset | | --sort <prop> | sort by a feature property |

Common tasks

A few recipes to get going — see Usage.md for the full, use-case-driven set.

# Latest reading for every station (the full network)
strahlenschutz latest

# Sample 5 readings for a quick look
strahlenschutz latest --max 5

# One station you care about
strahlenschutz station 091811461

# Hourly time series — last 24 hours of readings
strahlenschutz timeseries 091811461 --max 24

# Daily time series for a longer-term view
strahlenschutz timeseries 091811461 --resolution ts-24h

# Page through the network (most-recent first, 10 at a time)
strahlenschutz latest --sort "end_measure D" --max 10 --start 0
strahlenschutz latest --sort "end_measure D" --max 10 --start 10

Output & scripting

Every command prints pretty GeoJSON to stdout. Errors and diagnostics go to stderr, so piping stdout into jq stays clean.

# Extract dose rate and station id from a single-station lookup
strahlenschutz --compact station 091811461 \
  | jq '.features[0].properties | {kenn, value}'

# Flat TSV table of all stations — kenn and µSv/h value
strahlenschutz --compact latest \
  | jq -r '.features[] | [.properties.kenn, .properties.value] | @tsv'

# Plot-ready CSV: timestamp + value for the hourly series
strahlenschutz --compact timeseries 091811461 --max 48 \
  | jq -r '.features[] | [.properties.end_measure, .properties.value] | @csv'

Use --compact for single-line JSON in pipelines and logs:

strahlenschutz --compact latest --max 5

--compact (and every global option) works before or after the command — both strahlenschutz --compact latest … and strahlenschutz latest … --compact do the same thing.

Exit codes make the CLI easy to use in scripts:

| Code | Meaning | | --- | --- | | 0 | success (also --help / --version) | | 1 | error — API error, network failure, parse error, or any other problem | | 4 | station not found — the kenn returned no features (WFS always returns 200 with an empty collection for unknown ids) | | non-zero | usage / argument-validation error (bad flag or argument) |

Troubleshooting

  • command not found: strahlenschutz — the global npm bin directory isn't on your PATH. Run npm bin -g to find it and add it, or run via npx @maschinenlesbar.org/strahlenschutz-cli ….
  • Exit 4 / "No station found for kenn …" — the kenn doesn't exist in the network. Re-check the id from a fresh latest result; the WFS always returns HTTP 200 with an empty collection for an unknown station rather than a 404.
  • Non-numeric kenn rejected immediatelykenn must be digits only. The client validates this before making any request; no request is sent.
  • Exit 1 / network error — connectivity, DNS, or a timeout. Try again, or raise the limit with --timeout 60000.
  • Unexpectedly large response — raise or remove the cap with --max-response-bytes 0 (unlimited).

Global options

These apply to every command and may be given before or after the command:

| Option | Description | | --- | --- | | -V, --version | Print the version number | | -h, --help | Show help for the program or a command | | --compact | Print JSON on a single line instead of pretty-printed | | --base-url <url> | API base URL (default https://www.imis.bfs.de) | | --timeout <ms> | Per-request timeout in milliseconds (default 30000) | | --user-agent <ua> | User-Agent header value | | --max-retries <n> | Retries for transient 429/503 responses (default 2) | | --max-response-bytes <n> | Cap response body size in bytes (0 = unlimited; default 100 MiB) |

Learn more

  • Usage.md — full use-case-driven cookbook.
  • GLOSSARY.md — domain terms, station identifiers, WFS concepts, exit codes.
  • DEVELOPING.md — TypeScript library usage, architecture, testing, CI.
  • SKILLS.md — Claude Code Agent Skills bundled with this repo (dose-rate snapshot, station trend, GeoJSON export), installable as a plugin.

Data license

This CLI is a client — it accesses data it does not own or redistribute. The upstream data is © its provider and licensed separately from this tool's code. See DATA_LICENSE.md.

Bundesamt für Strahlenschutz — Datenlizenz Deutschland Namensnennung 2.0 (dl-de/by-2-0). Attribution required; commercial use and modification allowed.

License

Dual-licensed — use it under either:

  • AGPL-3.0-or-later (default, free). Note the AGPL's §13 network clause: if you run a modified version as a network service, you must offer that modified source to the service's users.
  • Commercial license (paid), for closed-source / proprietary or SaaS use without the AGPL's obligations.

See LICENSING.md for details, and CONTRIBUTING.md for the contribution policy (this project does not accept external code contributions). Commercial enquiries: [email protected].