Loading repository data…
Loading repository data…
ambujpandit761-eng / repository
Command-line tool that tracks competitor brand mentions in the news via newsdata.io and prints a digest with source breakdown and keyword frequency.
A command-line tool that scans recent news for mentions of the competitors you list and prints a digest you can read at a glance: how many times each brand came up, which outlets covered it, and the keywords that showed up most often.
It pulls live headlines from the newsdata.io news API (https://newsdata.io) — grab a free API key to run it.
requests library (see requirements.txt)Install dependencies:
pip install -r requirements.txt
Get a free API key from newsdata.io (https://newsdata.io) and export it:
export NEWSDATA_API_KEY=your_key_here
(Optional) List the brands you want to follow, one per line:
cp competitors.example.txt competitors.txt
# edit competitors.txt
Track one or more brands directly:
python main.py --brand "Acme Corp" --brand Globex
Or read them from a file (defaults to competitors.txt if present):
python main.py --file competitors.txt
Useful options:
--language en Language code (default: en)
--country us Restrict to a country code
--max-pages 2 Pages to fetch per brand (~10 articles each; default 1)
--top 10 How many sources/keywords to list
--markdown digest.md Also write the digest as Markdown
$ python main.py --brand "Acme Corp"
============================================================
COMPETITOR NEWS DIGEST
Generated: 2026-06-12 09:00 UTC
Source: newsdata.io news API (https://newsdata.io)
============================================================
Tracking 1 brand(s) — 7 matching article(s).
------------------------------------------------------------
## Acme Corp — 7 mention(s)
------------------------------------------------------------
Top sources:
3 TechCrunch
2 Reuters
2 The Verge
Top keywords:
4 acme
3 funding
2 hardware
Sentiment breakdown:
sample — live sentiment requires a paid newsdata.io plan
positive 5 ############............ (sample)
neutral 3 #######................. (sample)
negative 2 #####................... (sample)
AI tags: (none — requires a paid newsdata.io plan)
Latest headlines:
[?] Acme Corp raises Series B to expand hardware line
TechCrunch · 2026-06-12 06:30:00
https://example.com/acme-series-b
For each brand the tool queries the newsdata.io latest endpoint with the
brand as the search term, follows the nextPage cursor up to --max-pages,
and aggregates the results. Only free-tier-safe parameters are sent on the
default path, so a brand-new free key works without extra configuration.
Some fields — sentiment, ai_tag, ai_summary — are only populated on paid
newsdata.io plans. The tool reads them straight from each article when present
and falls back to a labeled placeholder when they are absent, so nothing breaks
on a free key. No paid-only query parameters are sent on the default path.
MIT