company-research CLI workflow
Setup
CH_API_KEY must be set in the environment — not accepted as a CLI flag.
All commands output JSON to stdout; errors go to stderr with exit 1. Use jq to extract fields.
Command reference
search-company <query> [-l/--limit N]
get-company-profile <ch-number>
list-filings <ch-number> [-c/--category STR] [--start N] [-l/--limit N]
fetch-filing <ch-number> <document-id>
get-latest <ch-number> <category>
list-zip-contents <ch-number> <document-id>
extract-xbrl-facts <local-path> [--name-prefix STR] [--include-text-facts]
clear-cache [--ch-number STR]
Canonical sequence
company-research search-company "Tesco" # pick ch_number
company-research list-filings 00445790 --category accounts # pick document_id
company-research fetch-filing 00445790 <document_id> # get local_path
company-research extract-xbrl-facts <local_path> # financial facts
get-latest shortcut — replaces list-filings + fetch-filing:
company-research get-latest 00445790 accounts
Key facts
- CH numbers are zero-padded to 8 digits:
00445790not445790 list-filingscommon categories:accounts,confirmation-statement; omit--categoryto discover alldocument_idis an opaque UUID fromlist-filings/get-latestoutput — never construct itextract-xbrl-factstakeslocal_path(fromfetch-filing/get-latestoutput), notdocument_id
ZIP archives
When fetch-filing/get-latest returns "is_archive": true:
company-research list-zip-contents 00445790 <document_id> # pick entry: is_primary or content_type
company-research extract-xbrl-facts <entry_local_path>
PDF-rendered iXBRL
When extract-xbrl-facts returns "render_type": "pdf_rendered": XBRL facts are present but narrative text is inaccessible. Check warnings for alternative formats.