# Hacker News User Submissions (`hackernews.user_submissions`)

Stories and comments a Hacker News user posted, newest first.

- **Route:** `POST /v1/run/hackernews.user_submissions`
- **Price:** $0.0015 per request ($1.50 per 1,000) · `cost_usd` on every response
- **Source:** Hacker News API + HN Search (Algolia) (`hackernews`) · failover: no
- **Measured latency:** p50 516 ms · p95 516 ms · p99 516 ms (1 calls, 30d)
- **Heavy response:** no

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `username` | string | yes |  | HN username |
| `type` | string | no | "story" | What to return |
| `limit` | integer | no | 20 | Results per page |
| `page` | integer | no | 0 | Page number, from 0 |

## Output (`output` in the run envelope)

| Field | Meaning |
|---|---|
| `submissions` | Stories or comments with points, text and links. |
| `total` | Total matches. |
| `pages` | Number of pages. |

## Example

```bash
curl -s -X POST https://getallapis.com/v1/run/hackernews.user_submissions \
  -H "Authorization: Bearer $GETALLAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"username":"pg","type":"story","limit":5}'
```

```python
from getallapis_client import Client
client = Client()  # reads GETALLAPIS_API_KEY
result = client.run('hackernews.user_submissions', {'username': 'pg', 'type': 'story', 'limit': 5})
print(result['cost_usd'], result['output'])
```

```bash
getallapis run hackernews.user_submissions '{"username":"pg","type":"story","limit":5}'
```

Quote first (free, validates input): `POST /v1/quote/hackernews.user_submissions` with the same body.
