CLI
Installing news-fetch provides the news-fetch command.
news-fetch --version
news-fetch --help
Fetch one article
Bare URL (maps to get):
news-fetch https://www.example.com/news/story
JSON:
news-fetch https://www.example.com/news/story --json
# or
news-fetch get URL --json
Article body as Markdown:
news-fetch get URL --markdown
From a local HTML file (no network):
news-fetch get --html page.html --json https://example.com/story
Options: --proxy, --strict, --debug.
Human-readable output includes title, publisher, published date, authors, confidence, page type, and a text preview.
Batch → JSONL
news-fetch batch urls.txt -o articles.jsonl --workers 20
news-fetch batch urls.txt --jsonl --proxy http://p1:8080 --proxy http://p2:8080 --delay 0.05
urls.txt— one URL per line (#comments allowed)-o/--output— write JSONL (streamed; first result is written before the job finishes)--jsonl— also print JSONL to stdout- Failed URLs emit an error object instead of an article:
{"url": "https://example.com/gone", "error": {"type": "FetchError", "message": "...", "status": 404}}
- A
N ok, M failedsummary is printed to stderr. - Exit code is
1only when no URL succeeded; otherwise0.
Changed in 1.1.0: error rows were previously
{"url": "...", "error": true}.
Discover
news-fetch discover https://www.theguardian.com --limit 10
news-fetch discover https://www.bbc.com --limit 20 --json