π¦ ClawHub
Hacker News
by @ivangdavila
Search and browse Hacker News with API access to stories, comments, users, and hiring threads.
TERMINAL
clawhub install hacker-newsπ About This Skill
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 profile3. Algolia Search Syntax
/search?query=TERM&tags=TAG&numericFilters=FILTER
Tags (combinable with AND):
story, comment, poll, job, ask_hn, show_hnauthor_USERNAME β posts by userstory_ID β comments on storyNumeric filters:
created_at_i>TIMESTAMP β after datepoints>N β minimum pointsnum_comments>N β minimum comments4. 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
hits[] arrayid, title, url, score, by, time, descendants (comment count)id, text, by, parent, time6. Rate Limits
page=N, hitsPerPage=N)7. Gotchas
url is null for Ask HN/Show HN text posts β use text field insteaddeleted and dead items exist β check before displayingobjectID = HN item id (as string)