Command-line tool and TypeScript library
ka
German parliamentary Kleine Anfragen from 17 incompatible documentation systems, in one standardized, reproducible, machine-readable format — fetched from the parliament that published them, read deterministically, and stored as a record you can re-derive from the archived bytes.
Install
Needs Node.js 22 or newer. Installs the ka command:
npm i -g @maschinenlesbar.org/openka-cliAccess
No account, no API key, no configuration — install and query.
Quick start
# Ingest a window of Berlin's Schriftliche Anfragen (question + answer + PDF text)
ka sync --source berlin --since 2024-01-01 --limit 50
# Search it
ka search "Brücken Zustand" --parliament berlin --year 2024
ka show berlin-19-18221
# Get the canonical record, or another rendering of it
ka get berlin-19-18221 --format json # canonical JSON: the stored bytes
ka get berlin-19-18221 --format md # readable
ka get berlin-19-18221 --format jsonld # schema.org
# Prove it: re-run the extraction from the archived bytes and compare
ka verify berlin-19-18221
# See what the extractor refused to answer
ka review
# Bulk output
ka export --format csv --out corpus.csv
ka feed --party GRÜNE --out gruene.atomCommands
-
syncfetch, extract and store Anfragen from one or more sources
-
searchfull-text search over the corpus
-
getprint one record in a machine-readable format
-
showrender one record for reading
-
openprint the path of a record's archived source document
-
verifyre-run an extraction from the archived bytes and assert identical output
-
reviewwork the abstention queue: records the extractor refused to complete
-
reindexrebuild the search index and catalog from the stored records
-
sourcesthe source map and its health
-
reextractre-extract stored records from their archived bytes with this build's extractor — no network; then rebuild the index
-
rmremove records from the corpus, with their catalog rows and index postings (takes the corpus lock)
-
exportexport the corpus (or a selection of it) in bulk
-
feedan Atom feed of the newest matching Anfragen
-
schemaprint the JSON Schema of the canonical record
-
statswhat is in this corpus: coverage, completeness, extractor versions, disk use, and breakdowns with --by
-
doctorcheck the corpus: filesystem, free space, lock, catalog against records, macOS ._* files (exit 3 on a problem)
-
statuswhat a running sync is doing — progress, rate, time left — or how the last one ended
-
configcredentials kept apart from the corpus, in $XDG_CONFIG_HOME/openka/credentials (bund.api-key)
TypeScript library
@maschinenlesbar.org/openka-cli is also a typed API client you can import in your own code, with no runtime HTTP dependencies.
The tool, not the data
The data comes from the provider behind the API, under its own terms — see DATA_LICENSE.md. The code is dual-licensed AGPL-3.0-or-later or commercial — see LICENSING.md.