Apify HN Scraper
VerifiedScrape Hacker News stories, comments, and discussions. Use when user asks to search HN, find Hacker News posts, monitor tech discussions, or extract HN data....
$ Add to .claude/skills/ About This Skill
# Hacker News Scraper
Scrape Hacker News using an Apify Actor via the REST API.
Actor ID `0UDODOnpTkxY3Oc90`
Prerequisites - `APIFY_TOKEN` environment variable must be set - `curl` and `jq` must be available
Workflow
Step 1: Confirm parameters with user Ask what they want to scrape. Supported input fields: - `searchTerms` (array of strings) - keywords to search - `maxResults` (integer) - max stories to return - `sortBy` (string) - "points", "date", or "relevance" - `includeComments` (boolean) - include comment threads
Step 2: Run the Actor ```bash RESULT=$(curl -s -X POST "https://api.apify.com/v2/acts/0UDODOnpTkxY3Oc90/run-sync-get-dataset-items?token=$APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{"searchTerms": ["TERM"], "maxResults": 30}') echo "$RESULT" | jq '.' ```
Step 3: Poll and fetch (if async) ```bash RUN_ID=$(curl -s -X POST "https://api.apify.com/v2/acts/0UDODOnpTkxY3Oc90/runs?token=$APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{"searchTerms": ["TERM"], "maxResults": 100}' | jq -r '.data.id') curl -s "https://api.apify.com/v2/actor-runs/$RUN_ID?token=$APIFY_TOKEN" | jq -r '.data.status' curl -s "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN" | jq '.' ```
Step 4: Present results Summarize: top stories by points, comment counts, domains, trends. Offer JSON/CSV export.
Error Handling - If APIFY_TOKEN not set: `export APIFY_TOKEN=your_token` - If run FAILS: check log endpoint
Use Cases
- Monitor Hacker News for mentions of your product or competitors
- Collect trending tech discussions for weekly newsletter curation
- Extract top-voted stories on a specific topic for market research
- Track comment sentiment around a technology or framework launch
- Build a dataset of HN posts for training content recommendation models
Pros & Cons
Pros
- +Handles both synchronous and async scraping with automatic polling
- +Supports flexible search with keyword, sort, and comment filters
- +Outputs structured JSON ready for downstream analysis or export
Cons
- -Requires a paid Apify account and API token
- -Rate-limited by Apify actor execution quotas
- -Content preview truncation means some comment threads may be incomplete
FAQ
What does Apify HN Scraper do?
Scrape Hacker News stories, comments, and discussions. Use when user asks to search HN, find Hacker News posts, monitor tech discussions, or extract HN data....
What platforms support Apify HN Scraper?
Apify HN Scraper is available on Claude Code, OpenClaw.
What are the use cases for Apify HN Scraper?
Monitor Hacker News for mentions of your product or competitors. Collect trending tech discussions for weekly newsletter curation. Extract top-voted stories on a specific topic for market research.
100+ free AI tools
Writing, PDF, image, and developer tools — all in your browser.