Hacker News Search API
Hacker News stories, comments, Show HN and Ask HN posts for any words, brand or site: title, links, points, comments, author, date and the post's own text, by relevance or newest first, with date, points and comment filters.
$0.50 per 1,000 records
You pay only for the records you get. Zero records cost zero. 10,000 free records of this API to start (5,000 at the base price of $1 per 1,000), no card.
Data from hn.algolia.com/api
Get this data
Try it here with a few records, download the sample, fill a Google Sheet, or call it from your own code.
Try it
Run it on this page, or call it from your code with the endpoint in the developer section. A free key covers 10,000 records of this API, no card. Create a free key
For developers: the API and MCPThe endpoint, code in curl, JavaScript and Python, every input, and files for your tools
- Small runs answer in the same request; longer ones answer
202with a run to poll. fieldsreturns only the fields you name. The examples send the ones picked on this page.Idempotency-Keyis optional. A retry with it is never charged twice.- You pay for records returned. Zero records cost zero.
curl -X POST "https://pullrow.dev/v1/apis/hacker-news-search/run" \
-H "Authorization: Bearer $PULLROW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":{"search":"postgres"},"max_items":50}'Inputs
Send them as input in the request body. Leave one out to use its default.
What's in each record
13 fields: 11 here, 2 technical ones under Technical details.
Basics
- Type
story, comment, show_hn, ask_hn, job, poll or poll_option.
Example show_hn
- Title
Title of the story; empty for comments.
Example Show HN: PGlite – in-browser WASM Postgres with pgvector and live sync
- Domain
Site of that link, such as github.com.
Example pglite.dev
- Points
Points (upvotes) of the story.
Example 509
- Comments count
Number of comments on the story.
Example 108
- Author
Hacker News user name of the poster.
Example samwillis
- Text
The post's own text in plain text: the body of an Ask HN or Show HN post, or the comment.
Example Hey, Sam and the team from ElectricSQL here. PGlite is a WASM Postgres build packaged into a TypeScript/JavaScript…
- Story title
Title of that story, so comments can be read in context.
Example Show HN: PGlite – in-browser WASM Postgres with pgvector and live sync
Dates
- Created
When it was posted (UTC).
Example Aug 12, 2024
Links
- Link
The item's page on Hacker News.
- Link link
The link the story points to; empty for text posts and comments.
Example pglite.dev
Technical detailsField names and types for developers, and the 2 fields hidden above
Hidden by default
These 2 fields come with each record too. They are internal codes, notes about how the record was read or a copy of what was searched for, so the lists above leave them out.
- ID
idHacker News id of the item. - Story ID
story_idId of the story the item belongs to; its own id for a story.
Field names and types
The names your code reads in each record. "Filled" counts how many of the 3 sample records carry the field.
| Field name | Type | Shown on this page as | Filled |
|---|---|---|---|
id | text | ID (hidden) | 3 of 3 |
type | text | Type | 3 of 3 |
title | text | Title | 3 of 3 |
url | link | Link | 3 of 3 |
link_url | link | Link link | 3 of 3 |
domain | text | Domain | 3 of 3 |
points | number | Points | 3 of 3 |
comments_count | number | Comments count | 3 of 3 |
author | text | Author | 3 of 3 |
created_at | date and time | Created | 3 of 3 |
text | text | Text | 2 of 3 |
story_id | text | Story ID (hidden) | 3 of 3 |
story_title | text | Story title | 3 of 3 |
How it reads the site
Runs on a reader we built and maintain by hand for this site.
Save as pipeline
A pipeline remembers this API, your inputs and the fields you picked. It can run on a schedule and email you the results.
Sample records
| Record | Title | Text | Type | Domain | Points | Comments count | Author | Story title | Created | Link | Link link |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Show HN: PGlite – in-browser WASM Postgres with pgvector and live sync | Hey, Sam and the team from ElectricSQL here. PGlite is a WASM Postgres build packaged into a TypeScript/JavaScript client library, that enables you to run Postgres in the browser, Node.js and Bun, with no need to install any other dependencies. It's 3mb Gzipped, now has support… | show_hn | pglite.dev | 509 | 108 | samwillis | Show HN: PGlite – in-browser WASM Postgres with pgvector and live sync | Aug 12, 2024 | news.ycombinator.com/item?id=41224689 | pglite.dev |
| 2 | Show HN: PostgreSQL index advisor | This is a Postgres extension that can determine if a query should have an index. For example, for this table: create table book( id int primary key, title text not null ); You can run `index_advisor()` to see if there should be an index on a select statement: select * from… | show_hn | github.com | 417 | 97 | kiwicopple | Show HN: PostgreSQL index advisor | Apr 14, 2024 | news.ycombinator.com/item?id=40028111 | github.com/supabase/index_advisor |
| 3 | Show HN: I open-sourced the in-memory PostgreSQL I built at work for E2E tests | — | show_hn | github.com | 379 | 79 | n2d4 | Show HN: I open-sourced the in-memory PostgreSQL I built at work for E2E tests | Apr 7, 2024 | news.ycombinator.com/item?id=39960537 | github.com/stackframe-projects/pgmock |
Sample records from the example output this API publishes. Email addresses and phone numbers in them are masked. Hover over a column name to see the field name your code reads.
Reliability
Counted from real runs. Our own health checks are left out. A run succeeded when it finished and the site neither blocked it nor broke it.
Incidents and repairs
How it is kept working What a repair can't do
A ready-made API, maintained by us. It is not part of the daily check or the automatic rebuild yet.
- You pay only for records returned. A run that returns none costs nothing.
- Relevance order returns at most 1,000 items per search, the search service's own ceiling. Date order is not held to it: up to 10,000 items per run, newest first.
- Comments carry no points or comment counts, so min_points and min_comments leave comments out.
- text is cut at 1,000 characters, and e-mail addresses and phone numbers in it are replaced; open url for the full post.
- Comments in the monthly Who wants to be hired? and Seeking freelancer? threads are left out, because they are people's personal profiles.
- Data comes from the public HN Search API by Algolia, which allows 10,000 requests an hour per address; new items appear within minutes and points and comment counts are as of the last update there.
- front_page lists the stories on the front page right now; the other types search all of Hacker News back to 2007.
Version history
A run uses the live version unless the request names another one with version.
Manage this API
Only your workspace sees this part.
Automatic repair
Off: a rebuilt version is stored and waits for you in the version history.
Delete this API
Removes the API, its versions and the saved records of its runs. Calls to its address then answer 404. Records already charged stay charged. This cannot be undone.