# Hacker News API
> Search Hacker News stories and comments by relevance or date, read the live front page, and fetch full item threads with their comment trees. Filter by story, Ask HN, Show HN, poll or comment. Great for tech-trend monitoring, brand and topic tracking, content aggregation and developer tools.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/hackernews-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Basic** ($7/Mo) — 60,000 calls/Mo, 8 req/s
- **Pro** ($19/Mo) — 350,000 calls/Mo, 25 req/s
- **Mega** ($49/Mo) — 1,500,000 calls/Mo, 75 req/s

## Endpoints

### Hacker News

#### `GET /v1/frontpage` — Current Hacker News front page

**Parameters:**
- `limit` (query, optional, string) — Max results (1-50) Example: `30`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/hackernews-api/v1/frontpage?limit=30"
```

**Response:**
```json
{
    "data": {
        "count": 30,
        "results": [
            {
                "id": "48324712",
                "url": "https://www.owenmcgrann.com/p/the-dead-economy-theory",
                "tags": [
                    "story",
                    "author_WillDaSilva",
                    "story_48324712",
                    "front_page"
                ],
                "text": null,
                "title": "The dead economy theory",
                "author": "WillDaSilva",
                "hn_url": "https://news.ycombinator.com/item?id=48324712",
                "points": 809,
                "created_at": "2026-05-29T15:46:24Z",
                "num_comments": 986
            },
            {
                "id": "48324499",
                "url": "https://rockstarintel.com/gta-6-developers-announce-rockstar-games-union/",
                "tags": [
                    "story",
                    "author_AndrewKemendo",
                    "story_48324499",
                    "front_page"
                ],
                "text": null,
                "title": "GTA 6 Developers Unionize",
                "author": "AndrewKemendo",
                "hn_url": "https://news.ycombinator.com/item?id=48324499",
                "points": 605,
                "created_at": "2026-05-29T15:32:55Z",
                "num_comments": 417
            },
            {
                "id": "48309233",
                "url": "https://www.latimes.com/california/story/2026-
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/item` — Full story or comment with its comment tree

**Parameters:**
- `id` (query, required, string) — Numeric HN item id Example: `8863`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/hackernews-api/v1/item?id=8863"
```

**Response:**
```json
{
    "data": {
        "id": "1",
        "url": "http://ycombinator.com",
        "text": null,
        "type": "story",
        "title": "Y Combinator",
        "author": "pg",
        "hn_url": "https://news.ycombinator.com/item?id=1",
        "points": 57,
        "children": [
            {
                "id": "15",
                "url": null,
                "text": "&#34;the rising star of venture capital&#34; -unknown VC eating lunch on SHR",
                "type": "comment",
                "title": null,
                "author": "sama",
                "hn_url": "https://news.ycombinator.com/item?id=15",
                "points": null,
                "children": [
                    {
                        "id": "17",
                        "url": null,
                        "text": "Is there anywhere to eat on Sandhill Road?",
                        "type": "comment",
                        "title": null,
                        "author": "pg",
                        "hn_url": "https://news.ycombinator.com/item?id=17",
                        "points": null,
                        "children": [
                            {
                                "id": "1079",
                                "url": null,
                                "text": "sure",
                                "type": "comment",
                                "title": null,
                                "author": "dmon",
                                "hn_url": "
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/search` — Search stories and comments

**Parameters:**
- `q` (query, required, string) — Search text Example: `rust`
- `sort` (query, optional, string) — relevance (default) or date Example: `date`
- `type` (query, optional, string) — story, ask_hn, show_hn, poll or comment Example: `story`
- `limit` (query, optional, string) — Max results (1-50) Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/hackernews-api/v1/search?q=rust&sort=date&type=story&limit=10"
```

**Response:**
```json
{
    "data": {
        "sort": "relevance",
        "type": "story",
        "count": 10,
        "query": "openai",
        "total": 25362,
        "results": [
            {
                "id": "38309611",
                "url": "https://openai.com/blog/openai-announces-leadership-transition",
                "tags": [
                    "story",
                    "author_davidbarker",
                    "story_38309611"
                ],
                "text": null,
                "title": "OpenAI's board has fired Sam Altman",
                "author": "davidbarker",
                "hn_url": "https://news.ycombinator.com/item?id=38309611",
                "points": 5710,
                "created_at": "2023-11-17T20:28:50Z",
                "num_comments": 2530
            },
            {
                "id": "35813322",
                "url": "https://www.semianalysis.com/p/google-we-have-no-moat-and-neither",
                "tags": [
                    "story",
                    "author_klelatti",
                    "story_35813322"
                ],
                "text": null,
                "title": "Google “We have no moat, and neither does OpenAI”",
                "author": "klelatti",
                "hn_url": "https://news.ycombinator.com/item?id=35813322",
                "points": 2455,
                "created_at": "2023-05-04T10:19:13Z",
                "num_comments": 1039
            },
            {
                "id": "44800746"
…(truncated, see openapi.json for full schema)
```

### Users

#### `GET /v1/user` — User profile: karma, account age, submission count, bio

**Parameters:**
- `id` (query, required, string) — HN username Example: `pg`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/hackernews-api/v1/user?id=pg"
```

**Response:**
```json
{
    "data": {
        "id": "pg",
        "about": "Bug fixer.",
        "karma": 157316,
        "hn_url": "https://news.ycombinator.com/user?id=pg",
        "created_at": "2006-10-09T18:21:32.000Z",
        "submission_count": 15565
    },
    "meta": {
        "timestamp": "2026-06-13T14:47:25.263Z",
        "request_id": "03da2797-709b-44b3-b4ce-ecaee5314064"
    },
    "status": "ok",
    "message": "User retrieved",
    "success": true
}
```

### Stories

#### `GET /v1/stories` — Typed story lists without a search term

**Parameters:**
- `type` (query, optional, string) — story (default), ask, show, poll or job Example: `ask`
- `sort` (query, optional, string) — top (default) or date Example: `top`
- `limit` (query, optional, string) — Max results (1-50) Example: `20`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/hackernews-api/v1/stories?type=ask&sort=top&limit=20"
```

**Response:**
```json
{
    "data": {
        "sort": "top",
        "type": "ask",
        "count": 20,
        "total": 2223265,
        "results": [
            {
                "id": "37392676",
                "url": null,
                "tags": [
                    "story",
                    "author_SimingtonFCC",
                    "story_37392676",
                    "ask_hn"
                ],
                "text": "Hi everyone, I’m FCC Commissioner Nathan Simington, and I’m here to discuss security updates for IoT devices and how you can make a difference by filing comments with the FCC.<p>As you know, serious vulnerabilities are common in IoT, and it often takes too long for these to be patched on end-user devices—if the manufacturer even bothers to release an update, and if the device was even designed to receive them. Companies may stop supporting a device well before consumers have stopped using it. The support period is often not communicated at the time of sale. And sometimes the end of support is not even announced, leaving even informed users unsure whether their devices are still safe.<p>I’ve advocated for the FCC to require device manufacturers to support their devices with security updates for a reasonable amount of time [1]. I can&#x27;t bring such a proposal to a vote since I’m not the chairman of the agency. But I was able to convince my colleagues to tentatively support something a little more moderate addressing this problem.<p>The FCC recently issued a
…(truncated, see openapi.json for full schema)
```

### Comments

#### `GET /v1/comments` — Live comment stream with story context

**Parameters:**
- `sort` (query, optional, string) — date (default) or top Example: `date`
- `limit` (query, optional, string) — Max results (1-50) Example: `20`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/hackernews-api/v1/comments?sort=date&limit=20"
```

**Response:**
```json
{
    "data": {
        "sort": "date",
        "count": 20,
        "total": 33490573,
        "results": [
            {
                "id": "48517851",
                "text": "Just use Plexus [1].  The maintainer is not trying to be a hero or raise seed dollars or even really trying to promote it.  He&#x27;s just making an excellent, useful product.  (Unaffiliated, just a happy user).  It&#x27;s not a full-on &quot;LLMOps&quot; platform (whatever that is), it&#x27;s just a proxy that works very well and has some nice features.<p>[1] <a href=\"https:&#x2F;&#x2F;github.com&#x2F;mcowger&#x2F;plexus\" rel=\"nofollow\">https:&#x2F;&#x2F;github.com&#x2F;mcowger&#x2F;plexus</a>",
                "author": "indigodaddy",
                "hn_url": "https://news.ycombinator.com/item?id=48517851",
                "story_id": "48516504",
                "parent_id": "48516504",
                "created_at": "2026-06-13T14:46:21Z",
                "story_title": "AI OSS tool repo goes archived over night after raising $7.3M Seed"
            },
            {
                "id": "48517850",
                "text": "Very nice idea but please, check the performance: I had to close the tab 3 seconds in because it got stuck and my CPU fan got noisy.<p>So I couldn&#x27;t even check it out properly.",
                "author": "jdthedisciple",
                "hn_url": "https://news.ycombinator.com/item?id=48517850",
                "story_id": "48481400",
                "parent_id": "4
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/hackernews-api
OpenAPI spec: https://www.oanor.com/api/hackernews-api/openapi.json
