Library to identify trending AI products on Product Hunt (API + scraping fallback).
Project description
ph_ai_tracker
A small Python library that finds trending AI products on Product Hunt.
- Primary: Product Hunt GraphQL API v2
- Secondary: Web scraping fallback (BeautifulSoup) for when the API is unavailable / rate-limited
Install (dev)
poetry install
Install (PyPI)
pip install ph-ai-tracker
Quickstart
from ph_ai_tracker import AIProductTracker
tracker = AIProductTracker(
api_token="YOUR_PRODUCTHUNT_TOKEN", # optional
strategy="auto", # api | scraper | auto
)
result = tracker.get_products(search_term="AI", limit=20)
print(result.to_pretty_json())
Or from the terminal (prints pretty JSON):
poetry run python -m ph_ai_tracker --strategy scraper --search AI --limit 10
After installing from PyPI, you can also run:
ph-ai-tracker --strategy scraper --search AI --limit 10
Trending behavior
--strategy apidefaults to Product Hunt'sRANKINGorder.- The API client first attempts the
artificial-intelligencetopic; if the schema/topic query fails, it falls back to global posts and applies a client-side filter.
Product Hunt API token
Do not hardcode tokens in code or commit them to git.
Set your token as an environment variable:
export PRODUCTHUNT_TOKEN="<your_token>"
poetry run python -m ph_ai_tracker --strategy api --search AI --limit 10
Notes
- This project is intended to run well on PyPy 3.
- All tests are offline and use mocks/fixtures (no real network).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ph_ai_tracker-0.1.0.tar.gz.
File metadata
- Download URL: ph_ai_tracker-0.1.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.14.2 Darwin/25.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51cfb746013426b0a45c17198bd5a3ccc9f47a934e1bb0c9c891d1bf3fd5d287
|
|
| MD5 |
9518e848fa00d39e83eeb017b164e10b
|
|
| BLAKE2b-256 |
fc546e96e280f0804511e55ddccc016b65052b9d3b223775834a03c54c1f65d1
|
File details
Details for the file ph_ai_tracker-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ph_ai_tracker-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.14.2 Darwin/25.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d65cec446f64377e7586ab22204a032f0fa03e0bd7de226073f5cab6b35835e7
|
|
| MD5 |
bacab1d73fd6ce961d02c9466d2936d5
|
|
| BLAKE2b-256 |
0813b3ae4f534a0954c25604e221c9ed64d0b0fb5adb74662b4487fb1fcd5e77
|