Data source: Hacker News API
https://context.gnist.ai/rest/hn/
AuthenticationAll requests require a Gnist-API-Key header (or api_key query parameter).
Free tier: 100 calls/day. Get your API key.
Tools (5)
search_hn_discussionsFull-text search over Hacker News stories.
Searches the complete HN archive via the Algolia search index. Results are sorted by relevance.
Args:
query: Search terms.
date_from: Filter results after this date — YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS (UTC).
date_to: Filter results before this date — YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS (UTC).
min_points: Minimum points (upvotes) a story must have. Default 0 (no filter).
max_results: Maximum stories to return (1–100, default 25).
Returns:
Dictionary with 'count' and 'stories' list. Each story has title, url, author,
points, num_comments, created_at, and hn_url.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | required | Search terms. |
date_from | any | optional | Filter results after this date — YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS (UTC). |
date_to | any | optional | Filter results before this date — YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS (UTC). |
min_points | integer | optional | Minimum points (upvotes) a story must have. Default 0 (no filter). (default: 0) |
max_results | integer | optional | Maximum stories to return (1–100, default 25). (default: 25) |
{
"query": "example"
}get_hn_trendingGet top Hacker News stories in a rolling time window, sorted by points.
Args:
hours_ago: How far back to look (1–168 hours, default 24).
min_points: Minimum points threshold (default 10).
max_results: Maximum stories to return (1–100, default 25).
Returns:
Dictionary with 'count' and 'stories' list sorted by points descending.
| Parameter | Type | Required | Description |
|---|---|---|---|
hours_ago | integer | optional | How far back to look (1–168 hours, default 24). (default: 24) |
min_points | integer | optional | Minimum points threshold (default 10). (default: 10) |
max_results | integer | optional | Maximum stories to return (1–100, default 25). (default: 25) |
{
"query": "example"
}get_hn_story_threadFetch a Hacker News story with its top comments.
Args:
story_id: The HN story ID (numeric, from the URL: news.ycombinator.com/item?id=<id>).
max_comments: Maximum top-level comments to include (default 20).
Returns:
Story metadata plus a list of top comments sorted by score, each
with text, author, points, and nested replies.
| Parameter | Type | Required | Description |
|---|---|---|---|
story_id | integer | required | The HN story ID (numeric, from the URL: news.ycombinator.com/item?id=<id>). |
max_comments | integer | optional | Maximum top-level comments to include (default 20). (default: 20) |
{
"story_id": 1
}get_hn_author_activityGet recent submissions and comments by a Hacker News user.
Args:
username: HN username (case-sensitive).
limit: Maximum stories and comments to return each (default 10).
Returns:
User profile (username, karma, created_at) with lists of recent
stories and comments.
| Parameter | Type | Required | Description |
|---|---|---|---|
username | string | required | HN username (case-sensitive). |
limit | integer | optional | Maximum stories and comments to return each (default 10). (default: 10) |
{
"username": "example"
}report_feedbackReport a bug, feature request, or general feedback for this data source.
Use this when something doesn't work as expected, when you'd like
a new feature, or when you have suggestions for improvement.
Args:
feedback: Describe the issue or suggestion.
feedback_type: One of 'bug', 'feature_request', or 'general'.
| Parameter | Type | Required | Description |
|---|---|---|---|
feedback | string | required | |
feedback_type | string | optional | (default: "general") |
{
"feedback": "example"
}Quick Start
curl -X POST "https://context.gnist.ai/rest/hn/search_hn_discussions" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"query": "example"}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/rest/hn/search_hn_discussions",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={
"query": "example"
},
)
print(resp.json())