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
# or from a checkout:
pip install .
Python 3.9+ and no third-party dependencies. Package page: pypi.org/project/hn-keyword-watch.
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
--scanis slow for big numbers. Use Algolia for wide searches. --watchkeeps 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.
Source and issues
The canonical repo is on Codeberg: codeberg.org/prospy/hn-keyword-watch. It's mirrored to GitHub at github.com/prospy-io/hn-keyword-watch. Issues and pull requests are welcome on either.
Development
PYTHONPATH=src python -m unittest discover -s tests -v
License
MIT
Metadata
Release files for hn-keyword-watch 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| hn_keyword_watch-0.1.1.tar.gz | 10.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hn_keyword_watch-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.5 kB
Release files / hn_keyword_watch-0.1.1.tar.gz
| Download URL | hn_keyword_watch-0.1.1.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9f10c43c720c3e565384fdd6955b14bbf300e921395b53dbc4369d40596aa004
|
|
BLAKE2b-256 checksum How to use checksums |
00af905f5a0e1ea2313b7bf111161ff77726dfb5e74eaf528bb05bbc2e0416c5
|
| 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.1-py3-none-any.whl
| Download URL | hn_keyword_watch-0.1.1-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e8608554eeda7deee512740957328beb96b8f146b953cddc022494094d44c52a
|
|
BLAKE2b-256 checksum How to use checksums |
8a5f537363d5a76109c6480b3e0f6abd96b4676ffdc7145fbdc7b1edeaabad82
|
| 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.1
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.