hacker-news

star 8

Search and browse Hacker News with API access to stories, comments, users, and hiring threads.

modbender By modbender schedule Updated 3/6/2026

name: Hacker News

slug: hacker-news

version: 1.0.0

description: Search and browse Hacker News with API access to stories, comments, users, and hiring threads.

metadata: {"clawdbot":{"emoji":"๐ŸŸ ","requires":{"bins":[]},"os":["linux","darwin","win32"]}}


Quick Reference

| Topic | File |

|-------|------|

| API endpoints | api.md |

| Search patterns | search.md |

Core Rules

1. Two APIs Available

| API | Use Case | Base URL |

|-----|----------|----------|

| Official HN API | Single items, real-time | https://hacker-news.firebaseio.com/v0 |

| Algolia Search | Full-text search, filters | https://hn.algolia.com/api/v1 |

2. Official API Endpoints

  • /topstories.json โ€” top 500 story IDs

  • /newstories.json โ€” newest 500 story IDs

  • /beststories.json โ€” best stories

  • /askstories.json โ€” Ask HN

  • /showstories.json โ€” Show HN

  • /jobstories.json โ€” job postings

  • /item/{id}.json โ€” story/comment details

  • /user/{username}.json โ€” user profile

3. Algolia Search Syntax


/search?query=TERM&tags=TAG&numericFilters=FILTER

Tags (combinable with AND):

  • story, comment, poll, job, ask_hn, show_hn

  • author_USERNAME โ€” posts by user

  • story_ID โ€” comments on story

Numeric filters:

  • created_at_i>TIMESTAMP โ€” after date

  • points>N โ€” minimum points

  • num_comments>N โ€” minimum comments

4. Common Patterns

| Request | Endpoint |

|---------|----------|

| Frontpage | Official /topstories.json โ†’ fetch first 30 items |

| Search posts | Algolia /search?query=X&tags=story |

| User's posts | Algolia /search?tags=author_USERNAME |

| Who is hiring? | Algolia /search?query=who is hiring&tags=story,author_whoishiring |

| Comments on story | Algolia /search?tags=comment,story_ID |

| This week's top | Algolia /search?tags=story&numericFilters=created_at_i>WEEK_TS |

5. Response Handling

  • Official API returns IDs โ†’ batch fetch items (parallelize)

  • Algolia returns full objects with hits[] array

  • Story object: id, title, url, score, by, time, descendants (comment count)

  • Comment object: id, text, by, parent, time

6. Rate Limits

  • Official API: No auth required, generous limits

  • Algolia: 10,000 requests/hour (no key needed)

  • Always paginate large results (page=N, hitsPerPage=N)

7. Gotchas

  • url is null for Ask HN/Show HN text posts โ€” use text field instead

  • deleted and dead items exist โ€” check before displaying

  • Timestamps are Unix seconds, not milliseconds

  • Algolia objectID = HN item id (as string)

Install via CLI
npx skills add https://github.com/modbender/skill-library-mcp --skill hacker-news
Repository Details
star Stars 8
call_split Forks 2
navigation Branch main
article Path SKILL.md
More from Creator