name: hackernews
/plugin marketplace add vm0-ai/api0/plugin install api0@api0This skill inherits all available tools. When active, it can use any tool Claude has access to.
name: hackernews description: Hacker News API via curl. Use this skill to fetch top stories, new posts, comments, and user profiles from Hacker News.
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
Important: When using
$VARin a command that pipes to another command, wrap the command containing$VARinbash -c '...'. Due to a Claude Code bug, environment variables are silently cleared when pipes are used directly.bash -c 'curl -s "https://api.example.com" -H "Authorization: Bearer $API_KEY"' | jq .
Fetch IDs of the current top 500 stories:
bash -c 'curl -s "https://hacker-news.firebaseio.com/v0/topstories.json"' | jq '.[:10]
Fetch the best stories (highest voted over time):
bash -c 'curl -s "https://hacker-news.firebaseio.com/v0/beststories.json"' | jq '.[:10]
Fetch the newest stories:
bash -c 'curl -s "https://hacker-news.firebaseio.com/v0/newstories.json"' | jq '.[:10]
Fetch "Ask HN" posts:
bash -c 'curl -s "https://hacker-news.firebaseio.com/v0/askstories.json"' | jq '.[:10]
Fetch "Show HN" posts:
bash -c 'curl -s "https://hacker-news.firebaseio.com/v0/showstories.json"' | jq '.[:10]
Fetch job postings:
bash -c 'curl -s "https://hacker-news.firebaseio.com/v0/jobstories.json"' | jq '.[:10]
Fetch full details for any item by ID:
ITEM_ID="8863"
bash -c 'curl -s "https://hacker-news.firebaseio.com/v0/item/${ITEM_ID}.json"' | jq .
Response fields:
| Field | Description |
|---|---|
id | Unique item ID |
type | story, comment, job, poll, pollopt |
by | Username of author |
time | 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 |
Fetch top 5 stories with full details:
for id in $(curl -s "https://hacker-news.firebaseio.com/v0/topstories.json" | jq '.[:5][]'); 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:
STORY_ID="8863"
# Get story
STORY=$(curl -s "https://hacker-news.firebaseio.com/v0/item/${STORY_ID}.json")
echo "$STORY" | jq '{title, score, descendants}'
# Get first 3 comments
for kid in $(echo "$STORY" | jq '.kids[:3][]'); do
curl -s "https://hacker-news.firebaseio.com/v0/item/${kid}.json" | jq '{by, text}'
done
Fetch user details:
USERNAME="pg"
bash -c 'curl -s "https://hacker-news.firebaseio.com/v0/user/${USERNAME}.json"' | jq .
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 |
USERNAME="pg"
bash -c '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):
bash -c 'curl -s "https://hacker-news.firebaseio.com/v0/updates.json"' | jq .
echo "=== Top 10 Hacker News Stories ==="
curl -s "https://hacker-news.firebaseio.com/v0/topstories.json" > /tmp/topstories.json
for id in $(cat /tmp/topstories.json | jq '.[:10][]'); do
bash -c '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" > /tmp/topstories.json
for id in $(cat /tmp/topstories.json | jq '.[:30][]'); do
bash -c '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" > /tmp/topstories.json
for id in $(cat /tmp/topstories.json | jq '.[:50][]'); do
bash -c '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 |
/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 |
url for Ask HN)