> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mindcase.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Hacker News Stories API

> Hacker News stories with rank, title, link, body and author from the top, new, best, ask or show feed, or search by keyword.

`POST /v1/data/hackernews/stories/run`

**Pricing:** $0.01 per storie ($10.00 per 1,000).

## Request

Send the inputs under `params`. Only the keys below are accepted; any other key returns `422 invalid_params`.

**feed** `string` (default: top)

Which Hacker News list to read: Top, New, Best, Ask HN or Show HN. Top by default.

Allowed values: `top` (Top Stories), `new` (New Stories), `best` (Best Stories), `ask` (Ask HN), `show` (Show HN).

**query** `string`

Search stories by keyword, e.g. openai. Leave empty to read the chosen feed.

**sortBy** `string`

Order of search results (only used with a Search Query).

Allowed values: `relevance` (Relevance), `date` (Date (newest first)).

**maxResults** `integer` (default: 100)

How many stories to return in total. Defaults to 100; use 0 for all.

Max `500`.

## Example

```bash cURL theme={null}
curl -X POST "https://api.mindcase.co/v1/data/hackernews/stories/run?wait=true" \
  -H "Authorization: Bearer $MINDCASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "params": {
    "feed": "top",
    "maxResults": 10
  }
}'
```

```python Python theme={null}
import os, requests

r = requests.post(
    "https://api.mindcase.co/v1/data/hackernews/stories/run",
    params={"wait": "true"},
    headers={"Authorization": f"Bearer {os.environ['MINDCASE_API_KEY']}"},
    json={"params": {
    "feed": "top",
    "maxResults": 10
}},
)
job = r.json()
rows = job.get("data", [])  # if job["status"] == "running", poll /v1/jobs/{job_id}/results
```

```javascript Node.js theme={null}
const r = await fetch("https://api.mindcase.co/v1/data/hackernews/stories/run?wait=true", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MINDCASE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ params: {
  "feed": "top",
  "maxResults": 10
} }),
});
const job = await r.json();
const rows = job.data ?? []; // if job.status === "running", poll /v1/jobs/{job_id}/results
```

## Response fields

Each row in `data` is one storie, keyed by these fields.

| Field | Name | Type |
| - | - | - |
| `hnId` | Hn ID | text |
| `hnUrl` | Hn URL | url |
| `rank` | Rank | number |
| `title` | Title | text |
| `externalLink` | External Link | url |
| `body` | Body | text |
| `author` | Author | text |
| `points` | Points | number |
| `commentCount` | Comment Count | number |
| `posted` | Posted | text |

## Example response

Abridged: long text and lists are shortened.

```json theme={null}
{
  "job_id": "7f3a1c2e-0b9d-4c55-9a51-3f2e8d1b6a40",
  "agent": "hackernews/stories",
  "status": "completed",
  "row_count": 1,
  "truncated": false,
  "data": [
    {
      "author": "giuliomagnifico",
      "commentCount": 45,
      "hnId": "50324388",
      "hnUrl": "https://news.ycombinator.com/item?id=50324388",
      "posted": "2026-11-01T10:47:58+00:00",
      "rank": 1,
      "points": 110,
      "body": null,
      "externalLink": "https://www.visitnorway.com/plan-your-trip/travel-tips-a-z/norwegian-scenic-routes/worlds-best-toilets/",
      "title": "Norway makes shithouses great again"
    }
  ]
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.