Skip to main content

The Local News CLI

Get the latest news straight from your terminal. Powered by NewsAPI.org.

  • Top headlines by country or topic
  • Full-text keyword search with AND/OR/NOT
  • Articles from the past 7 days only
  • Open any article in your browser directly from the CLI

demo


Install

pip install news-cli

Or with uv:

uv tool install news-cli

Setup

Get a free API key at newsapi.org/register, then set it as an environment variable:

export NEWS_API_KEY=your_key_here

Add that line to your ~/.zshrc or ~/.bashrc to make it permanent.


Usage

news [OPTIONS]

Options:
  -s, --search TEXT    Keywords to search for. Supports AND/OR/NOT.
  -c, --country TEXT   2-letter country code: us, gb, in, fr, de, au, ...
  -t, --topic TEXT     business | entertainment | general | health |
                       science | sports | technology
  -l, --lang TEXT      Article language: en, fr, de, es, ar, zh, ...  [default: en]
      --sort TEXT      relevancy | popularity | date  [default: popularity]
                       (only applies to --search without --country/--topic)
  -n, --limit INT      Number of articles to show (1–100)  [default: 20]
      --json           Output as JSON for scripting
      --verbose        Enable debug logging
      --help           Show this message and exit

Examples

# Top headlines (defaults to US)
news

# Headlines for a specific country
news --country gb
news -c in

# Headlines by topic
news --topic technology
news -t health

# Search for a keyword
news --search "climate change"
news -s "AI AND regulation"

# Combine: search within a country or topic
news --search "election" --country us
news -s "startup" -t technology

# Filter by language
news --search "économie" --lang fr

# Sort search results by date
news --search "SpaceX" --sort date

# Show more results
news -n 50

# Pipe to jq or other tools
news --json | jq '.[].title'

Troubleshooting

No API key found — set the NEWS_API_KEY environment variable (see Setup above).

No articles found — the combination of filters returned nothing. Try a broader country, drop the topic filter, or change the language.

Results seem old — the CLI only shows articles from the past 7 days. For older content, use the NewsAPI directly.

Metadata

Release files for news-cli 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for news-cli 2.0.1
File Size Uploaded
news_cli-2.0.1.tar.gz 12.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for news-cli 2.0.1
File Interpreter ABI Platform
news_cli-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 25.0 kB

Release files / news_cli-2.0.1.tar.gz

Download URL news_cli-2.0.1.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7ef5f2c2f2fca0490c2955a385cc809867ff4e3551fbf8d72de0bae55f724cda
BLAKE2b-256 checksum
How to use checksums
ae1f2079e9faef8c0b4835a44a2b44d39ce991b5f0c7aaf7ef861058f82bed10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / news_cli-2.0.1-py3-none-any.whl

Download URL news_cli-2.0.1-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb61c92249d1ed9090e2b5e73e54899f902388e3980928d97548de192886a0fc
BLAKE2b-256 checksum
How to use checksums
3890fb0edb66079a8784f493e11260769debd2fc1421e62e2af1a6d0d492f11c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

2.0.0

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page