Automatically fetch daily Product Hunt products and export them to CSV format, sorted by vote count.
- 📊 Fetches daily released products from Product Hunt
- 🗳️ Sorts products by upvote count
- 📄 Exports data to CSV format
- ⏰ Designed for automated daily execution
- 🔐 Secure API token management via environment variables
- Node.js (version 14 or higher)
- npm or yarn
- Product Hunt API token
git clone git@github.com:ranbot-ai/product-hunt.git
cd product-hunt
npm install
-
Copy the example environment file:
cp .env.example .env
-
Edit
.env
and add your Product Hunt API token:PRODUCT_HUNT_API_TOKEN=your_actual_token_here
- Go to Product Hunt API Dashboard
- Create a new application
- Copy your API token
- Paste it in your
.env
file
To fetch today's products manually:
npm start
This will create a CSV file in the output/
directory with the format: products_YYYY-MM-DD.csv
A run.sh
script is provided in the scripts/
folder that will:
- Run the fetcher
- Automatically commit the CSV file
- Push to GitHub
-
Open your crontab:
crontab -e
-
Add a daily job (runs at 11:59 PM daily):
59 23 * * * /path/to/product-hunt/scripts/run.sh
-
The script will log output to
tmp/log.txt
-
Open your crontab:
crontab -e
-
Add a daily job (runs at 11:59 PM daily):
59 23 * * * cd /path/to/product-hunt && /usr/local/bin/node src/index.js
-
Make sure to use the full path to your node binary (find it with
which node
)
- Open Task Scheduler
- Create a new Basic Task
- Set it to run daily
- Action: Start a program
- Program:
node
- Arguments:
src/index.js
- Start in:
C:\path\to\product-hunt
The CSV file contains the following columns:
Column | Description |
---|---|
Rank | Position based on votes |
Name | Product name |
Tagline | Product tagline |
Votes | Number of upvotes |
Comments | Number of comments |
URL | Product Hunt URL |
Website | Product website URL |
Topics | Product categories/topics |
Description | Product description |
Created At | Launch date |
product-hunt/
├── src/
│ ├── index.js # Main script
│ └── utils/
│ ├── api.js # Product Hunt API client
│ └── csv.js # CSV export utilities
├── scripts/
│ └── run.sh # Automated run script with git commit/push
├── output/ # Generated CSV files
├── tmp/ # Log files (git-ignored)
├── .env # Your API configuration (git-ignored)
├── .env.example # Example configuration
├── .gitignore # Git ignore rules
├── package.json # Project dependencies
└── README.md # This file
- Check that your API token is correct in the
.env
file - Ensure your Product Hunt application has the necessary permissions
- Run
npm install
to install all dependencies
- The script will automatically create the
output/
directory if it doesn't exist
Feel free to submit issues or pull requests to improve this project!
MIT