hackernews by vm0-ai/vm0-skills
npx skills add https://github.com/vm0-ai/vm0-skills --skill hackernews通过直接使用 curl 命令调用官方 Hacker News API 来获取故事、评论和用户数据。
官方文档:
https://github.com/HackerNews/API
当你需要以下功能时,请使用此技能:
无需 API 密钥! Hacker News API 完全免费且开放。
基础 URL:https://hacker-news.firebaseio.com/v0
获取当前前 500 个热门故事的 ID:
curl -s "https://hacker-news.firebaseio.com/v0/topstories.json" | jq '.[:10]'
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
获取最佳故事(长期获得最高投票):
curl -s "https://hacker-news.firebaseio.com/v0/beststories.json" | jq '.[:10]'
获取最新的故事:
curl -s "https://hacker-news.firebaseio.com/v0/newstories.json" | jq '.[:10]'
获取 "Ask HN" 帖子:
curl -s "https://hacker-news.firebaseio.com/v0/askstories.json" | jq '.[:10]'
获取 "Show HN" 帖子:
curl -s "https://hacker-news.firebaseio.com/v0/showstories.json" | jq '.[:10]'
获取招聘信息:
curl -s "https://hacker-news.firebaseio.com/v0/jobstories.json" | jq '.[:10]'
根据 ID 获取任何条目的完整详情。将 <item-id> 替换为实际的条目 ID:
curl -s "https://hacker-news.firebaseio.com/v0/item/<item-id>.json"
响应字段:
| 字段 | 描述 |
|---|---|
id | 唯一条目 ID |
type | story, comment, job, poll, pollopt |
by | 作者用户名 |
time | Unix 时间戳 |
title | 故事标题(仅限故事) |
url | 故事 URL(如果是外部链接) |
text | 内容文本(Ask HN,评论) |
score | 赞成票数 |
descendants | 总评论数 |
kids | 子评论 ID 数组 |
获取前 5 个故事的完整详情。将 <item-id> 替换为实际的条目 ID:
curl -s "https://hacker-news.firebaseio.com/v0/topstories.json" | jq '.[:5][]' | while read id; do
curl -s "https://hacker-news.firebaseio.com/v0/item/${id}.json" | jq '{id, title, score, url, by}'
done
获取一个故事及其顶级评论。将 <story-id> 替换为实际的故事 ID:
curl -s "https://hacker-news.firebaseio.com/v0/item/<story-id>.json" | jq '{title, score, descendants, kids}'
然后,对于 kids 数组中的每个评论 ID,将 <comment-id> 替换为实际的评论 ID:
curl -s "https://hacker-news.firebaseio.com/v0/item/<comment-id>.json" | jq '{by, text, score}'
获取用户详情。将 <username> 替换为实际的用户名:
curl -s "https://hacker-news.firebaseio.com/v0/user/<username>.json"
响应字段:
| 字段 | 描述 |
|---|---|
id | 用户名 |
created | 账户创建时间戳 |
karma | 用户的 karma 分数 |
about | 用户简介(HTML) |
submitted | 提交的条目 ID 数组 |
获取用户的近期提交。将 <username> 替换为实际的用户名:
curl -s "https://hacker-news.firebaseio.com/v0/user/<username>.json" | jq '.submitted[:5]'
获取当前最大的条目 ID(用于轮询新条目):
curl -s "https://hacker-news.firebaseio.com/v0/maxitem.json"
获取最近更改的条目和资料(用于实时更新):
curl -s "https://hacker-news.firebaseio.com/v0/updates.json"
curl -s "https://hacker-news.firebaseio.com/v0/topstories.json" | jq '.[:10][]' | while read id; do
curl -s "https://hacker-news.firebaseio.com/v0/item/${id}.json" | jq -r '"\(.score) points | \(.title) | \(.url // "Ask HN")"'
done
curl -s "https://hacker-news.firebaseio.com/v0/topstories.json" | jq '.[:30][]' | while read id; do
curl -s "https://hacker-news.firebaseio.com/v0/item/${id}.json" | jq -r 'select(.score >= 100) | "\(.score) | \(.title)"'
done
curl -s "https://hacker-news.firebaseio.com/v0/topstories.json" | jq '.[:50][]' | while read id; do
curl -s "https://hacker-news.firebaseio.com/v0/item/${id}.json" | jq -r 'select(.title | test("AI|GPT|LLM|Machine Learning|Neural"; "i")) | "\(.score) | \(.title)"'
done
| 端点 | 描述 |
|---|---|
/v0/topstories.json | 前 500 个热门故事 |
/v0/beststories.json | 最佳故事 |
/v0/newstories.json | 最新的 500 个故事 |
/v0/askstories.json | Ask HN 故事 |
/v0/showstories.json | Show HN 故事 |
/v0/jobstories.json | 招聘信息 |
/v0/item/{id}.json | 条目详情 |
/v0/user/{id}.json | 用户资料 |
/v0/maxitem.json | 当前最大条目 ID |
/v0/updates.json | 已更改的条目/资料 |
url)每周安装数
2.4K
代码仓库
GitHub 星标数
47
首次出现
2026 年 1 月 24 日
安全审计
安装于
opencode2.3K
gemini-cli2.3K
codex2.3K
cursor2.3K
github-copilot2.3K
amp2.3K
Use the official Hacker News API via direct curl calls to fetch stories, comments, and user data.
Official docs:
https://github.com/HackerNews/API
Use this skill when you need to:
No API key required! The Hacker News API is completely free and open.
Base URL: https://hacker-news.firebaseio.com/v0
Fetch IDs of the current top 500 stories:
curl -s "https://hacker-news.firebaseio.com/v0/topstories.json" | jq '.[:10]'
Fetch the best stories (highest voted over time):
curl -s "https://hacker-news.firebaseio.com/v0/beststories.json" | jq '.[:10]'
Fetch the newest stories:
curl -s "https://hacker-news.firebaseio.com/v0/newstories.json" | jq '.[:10]'
Fetch "Ask HN" posts:
curl -s "https://hacker-news.firebaseio.com/v0/askstories.json" | jq '.[:10]'
Fetch "Show HN" posts:
curl -s "https://hacker-news.firebaseio.com/v0/showstories.json" | jq '.[:10]'
Fetch job postings:
curl -s "https://hacker-news.firebaseio.com/v0/jobstories.json" | jq '.[:10]'
Fetch full details for any item by ID. Replace <item-id> with the actual item ID:
curl -s "https://hacker-news.firebaseio.com/v0/item/<item-id>.json"
Response fields:
| Field | Description |
|---|---|
id | Unique item ID |
type | story, comment, job, poll, pollopt |
by | Username of author |
time |
Fetch top 5 stories with full details. Replace <item-id> with the actual item ID:
curl -s "https://hacker-news.firebaseio.com/v0/topstories.json" | jq '.[:5][]' | while read id; do
curl -s "https://hacker-news.firebaseio.com/v0/item/${id}.json" | jq '{id, title, score, url, by}'
done
Fetch a story and its top-level comments. Replace <story-id> with the actual story ID:
curl -s "https://hacker-news.firebaseio.com/v0/item/<story-id>.json" | jq '{title, score, descendants, kids}'
Then for each comment ID in the kids array, replace <comment-id> with the actual comment ID:
curl -s "https://hacker-news.firebaseio.com/v0/item/<comment-id>.json" | jq '{by, text, score}'
Fetch user details. Replace <username> with the actual username:
curl -s "https://hacker-news.firebaseio.com/v0/user/<username>.json"
Response fields:
| Field | Description |
|---|---|
id | Username |
created | Account creation timestamp |
karma | User's karma score |
about | User bio (HTML) |
submitted | Array of item IDs submitted |
Fetch a user's recent submissions. Replace <username> with the actual username:
curl -s "https://hacker-news.firebaseio.com/v0/user/<username>.json" | jq '.submitted[:5]'
Get the current largest item ID (useful for polling new items):
curl -s "https://hacker-news.firebaseio.com/v0/maxitem.json"
Get recently changed items and profiles (for real-time updates):
curl -s "https://hacker-news.firebaseio.com/v0/updates.json"
curl -s "https://hacker-news.firebaseio.com/v0/topstories.json" | jq '.[:10][]' | while read id; do
curl -s "https://hacker-news.firebaseio.com/v0/item/${id}.json" | jq -r '"\(.score) points | \(.title) | \(.url // "Ask HN")"'
done
curl -s "https://hacker-news.firebaseio.com/v0/topstories.json" | jq '.[:30][]' | while read id; do
curl -s "https://hacker-news.firebaseio.com/v0/item/${id}.json" | jq -r 'select(.score >= 100) | "\(.score) | \(.title)"'
done
curl -s "https://hacker-news.firebaseio.com/v0/topstories.json" | jq '.[:50][]' | while read id; do
curl -s "https://hacker-news.firebaseio.com/v0/item/${id}.json" | jq -r 'select(.title | test("AI|GPT|LLM|Machine Learning|Neural"; "i")) | "\(.score) | \(.title)"'
done
| Endpoint | Description |
|---|---|
/v0/topstories.json | Top 500 stories |
/v0/beststories.json | Best stories |
/v0/newstories.json | Newest 500 stories |
/v0/askstories.json | Ask HN stories |
/v0/showstories.json | Show HN stories |
/v0/jobstories.json | Job postings |
url for Ask HN)Weekly Installs
2.4K
Repository
GitHub Stars
47
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
opencode2.3K
gemini-cli2.3K
codex2.3K
cursor2.3K
github-copilot2.3K
amp2.3K
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装
| Unix timestamp |
title | Story title (stories only) |
url | Story URL (if external link) |
text | Content text (Ask HN, comments) |
score | Upvote count |
descendants | Total comment count |
kids | Array of child comment IDs |
/v0/item/{id}.json | Item details |
/v0/user/{id}.json | User profile |
/v0/maxitem.json | Current max item ID |
/v0/updates.json | Changed items/profiles |