Skip to main content

hn-keyword-watch

A small, dependency-free Python watcher that scans Hacker News for keywords and buying-intent phrases ("looking for a tool", "alternative to", "any recommendations"...) and prints the stories and comments that match.

It only reads public data from two official sources:

  • Algolia HN Search API (hn.algolia.com/api/v1/search_by_date). Full-text search, newest first. This is the default.
  • Official HN Firebase API (hacker-news.firebaseio.com/v0). Walks back through the newest items one by one.

Install

pip install hn-keyword-watch        # once published
# or from a checkout:
pip install .

Python 3.9+ and no third-party dependencies.

Usage

# Default buying-intent phrases, last 24 hours, via Algolia
hn-keyword-watch

# Your own phrases, last 48 hours
hn-keyword-watch "looking for a crm" "alternative to hubspot" --hours 48

# JSON lines on stdout (pipe into jq or another script) and save everything to a file
hn-keyword-watch "social listening" --json --out matches.json

# Scan the 300 newest items via the official Firebase API instead
hn-keyword-watch "is there a tool" --source firebase --scan 300

# Keep running and check every 10 minutes
hn-keyword-watch "alternative to notion" --watch 600

# Optional: send each match to your own Slack or Discord incoming webhook
hn-keyword-watch "need a crm" --watch 900 --webhook "$MY_WEBHOOK_URL"

Matching is case-insensitive and on whole words, so crm matches "need a CRM." but not "crmify". With Algolia each phrase is sent as a quoted query and then checked again locally.

Example output:

[story] 2026-10-23 14:03 UTC by someone | matched: alternative to
  Show HN: A European alternative to WhatsApp for work chats
  https://news.ycombinator.com/item?id=50209191

As a library:

from hn_keyword_watch import search_algolia, find_matches

items = search_algolia('"looking for a tool"', hits_per_page=50)
for m in find_matches(items, ["looking for a tool"]):
    print(m.url, m.matched)

Limits

  • Algolia returns at most 1,000 hits per query, so narrow the window (--hours) for very common phrases.
  • The Firebase source makes one request per item, so --scan is slow for big numbers. Use Algolia for wide searches.
  • --watch keeps a seen-set in memory only. Restarting it can print a match again.
  • Phrase matching is literal. It won't tell you whether a post is actually a buying signal. For that, see intent-score.

Be a good API citizen

  • Both APIs are free and public with no key, so please keep the load low. The CLI pauses between phrases and won't poll more often than every 60 seconds.
  • Read the HN API docs and Algolia HN Search docs and follow any rate limits they publish.
  • This tool only reads. Don't use it to spam people who post on HN. Reply by hand, and only when you can actually help.

If you'd rather not run this yourself, Prospy does social listening and AI lead generation across X/Twitter, Reddit, Bluesky and Hacker News, surfacing buying-intent posts.

Development

PYTHONPATH=src python -m unittest discover -s tests -v

License

MIT

Metadata

Release files for hn-keyword-watch 0.1.0

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

Source distribution (sdist)

Source distribution for hn-keyword-watch 0.1.0
File Size Uploaded Provenance
hn_keyword_watch-0.1.0.tar.gz 9.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for hn-keyword-watch 0.1.0
File Interpreter ABI Platform
hn_keyword_watch-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.0 kB

Release files / hn_keyword_watch-0.1.0.tar.gz

Download URL hn_keyword_watch-0.1.0.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1353874cb6bf3dcbcf12445200d89c8983a6aa006e6672c5412d35543d1a1e73
BLAKE2b-256 checksum
How to use checksums
df1e211473c9a79070285c848322b697550e9a023aba64df6dddda1eaf9253bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / hn_keyword_watch-0.1.0-py3-none-any.whl

Download URL hn_keyword_watch-0.1.0-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
305c8092a73fd4b42c1f9718b8af4b6bbffa607cdf5c7ce855cf6e48e5583ef1
BLAKE2b-256 checksum
How to use checksums
08e8a1313ab39cb97aa1b5f50ec383f1367cfea036f0183b8a36e28bfa18fb94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for hn-keyword-watch 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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