Full-text search of Hacker News stories and comments with title, link, author, points and comment count.
curl -X POST "https://api.primaryapi.com/v1/run/hackernews.search" \
-H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"rust","tags":"story","limit":1}'{
"output": {
"found": true,
"data": {
"total": 61089,
"nextCursor": "1",
"results": [
{
"title": "Why Discord is switching from Go to…",
"points": 1582,
"comments": 642,
"type": "story", …
}
]
}
},
"credits": 1
}Input and output
5 fields
rust.story.1.11 fields
Good to know
Comment text and story text are HTML as stored by HN.
One page per call. Send nextCursor back as cursor to read the next page.
More from Hacker News. Same key, same credits.
The same key and credits work for every API.