mcpField
H
hacker-news-scraper

hacker-news-scraper

github.com/gooseworks-aiData & databases1.3k59 installsUpdated 3d ago
Repository

About hacker-news-scraper

A Python CLI skill for searching Hacker News through the Algolia HN Search API. It filters by date, item type, and optional keywords, then returns ranked results as JSON or a summary.

Key features

  1. 01Search Hacker News by query
  2. 02Filter by date and item type
  3. 03Apply optional keyword filters
  4. 04Sort results by points
  5. 05Export JSON or summary output

Use cases

  1. 01Find recent discussions on a topic
  2. 02Review Ask HN or Show HN posts
  3. 03Collect stories matching keywords

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/gooseworks-ai/goose-skills --skill hacker-news-scraper

After installing, type/hacker-news-scraperin Claude Code to confirm it loaded.

Bundled filesscripts/search_hn.pyskill.meta.json

Details

From the project README

Hacker News Scraper

Search Hacker News using the free Algolia HN Search API. No Apify token or API key needed.

Quick Start

Only dependency: pip install requests.

# Stories about AI content marketing in last week
python3 skills/hacker-news-scraper/scripts/search_hn.py \
  --query "AI content marketing" --days 7

# Show HN posts in last month (summary view)
python3 skills/hacker-news-scraper/scripts/search_hn.py \
  --query "" --tags show_hn --days 30 --output summary

# Comments mentioning a specific tool
python3 skills/hacker-news-scraper/scripts/search_hn.py \
  --query "LangChain" --tags comment --days 14 --max-results 20

How the Script Works

  1. Queries the Algolia HN Search API (search_by_date endpoint)
  2. Uses numericFilters=created_at_i>{unix_timestamp} for server-side date filtering
  3. Paginates until max-results reached
  4. Normalizes results to a consistent schema
  5. Applies optional keyword filtering (client-side)
  6. Sorts by points (descending) and outputs JSON or summary

CLI Reference

FlagDefaultDescription
--queryrequiredSearch query
--days7How many days back to search
--tagsstoryItem type: story, comment, ask_hn, show_hn
--max-results50Max results to return
--keywordsnoneAdditional filter keywords (comma-separated, OR logic)
--outputjsonOutput format: json or summary

Output Format

{
  "id": "12345678",
  "title": "Show HN: My new tool",
  "url": "https://example.com",
  "author": "username",
  "points": 42,
  "num_comments": 15,
  "created_at": "2026-02-18T12:00:00.000Z",
  "hn_url": "https://news.ycombinator.com/item?id=12345678",
  "text": ""
}

Cost

Free. No API key, no rate limits (within reason), no Apify credits.

Comments

Markdown supported