# Hacker News Search API

> Returns Hacker News stories by relevance or date, single items, user profiles, front page stories and Show HN stories.

Category: Developer & Tech. Region: global. 12 endpoints at `https://api.hoshime.com/v1/hnsearch/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/hnsearch
## GET /v1/hnsearch/search

Hacker News stories that match a query, most relevant first.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Words to search for in story titles, URLs and text. (e.g. golang) |
| `limit` | integer | no | Items per page, 1 to 50. (default 10) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `commentCount` (integer (int64)), `hnUrl` (string), `id` (string), `imageUrl` (string), `points` (integer (int64)), `publishedAt` (string), `source` (string), `summary` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/hnsearch/search?query=golang" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/hnsearch/searchByDate

Hacker News stories that match a query, newest first.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Words to search for in story titles, URLs and text. (e.g. golang) |
| `limit` | integer | no | Items per page, 1 to 50. (default 10) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `commentCount` (integer (int64)), `hnUrl` (string), `id` (string), `imageUrl` (string), `points` (integer (int64)), `publishedAt` (string), `source` (string), `summary` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/hnsearch/searchByDate?query=golang" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/hnsearch/item

One Hacker News story or comment by its id, with its direct replies counted.

Scope: `social:read` · Units: 1 · Cached: 10 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Item id, the number after item?id= in its URL. (e.g. 1) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `createdAt` (string), `id` (string), `points` (integer (int64)), `replyCount` (integer (int64)), `text` (string), `title` (string), `type` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/hnsearch/item?id=1" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/hnsearch/user

A Hacker News user by username.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `username` | string | yes | Hacker News username, such as pg. (e.g. pg) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `avatarUrl` (string), `bio` (string), `createdAt` (string), `followerCount` (integer (int64)), `followingCount` (integer (int64)), `id` (string), `karma` (integer (int64)), `name` (string), `postCount` (integer (int64)), `url` (string), `username` (string), `verified` (boolean)

```bash
curl "https://api.hoshime.com/v1/hnsearch/user?username=pg" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/hnsearch/frontPage

Stories on the Hacker News front page right now, most popular first.

Scope: `social:read` · Units: 1 · Cached: 1 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | no | Words to match in the front page; omit it for the whole page. |
| `limit` | integer | no | Items per page, 1 to 50. (default 10) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `commentCount` (integer (int64)), `hnUrl` (string), `id` (string), `imageUrl` (string), `points` (integer (int64)), `publishedAt` (string), `source` (string), `summary` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/hnsearch/frontPage" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/hnsearch/showHN

Show HN stories, most relevant first, or all of them without a query.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | no | Words to search for in Show HN stories. Omit it to list them. |
| `limit` | integer | no | Items per page, 1 to 50. (default 10) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `commentCount` (integer (int64)), `hnUrl` (string), `id` (string), `imageUrl` (string), `points` (integer (int64)), `publishedAt` (string), `source` (string), `summary` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/hnsearch/showHN" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/hnsearch/askHN

Ask HN stories, most relevant first, or all of them without a query.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | no | Words to search for in Ask HN stories. Omit it to list them. |
| `limit` | integer | no | Items per page, 1 to 50. (default 10) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `commentCount` (integer (int64)), `hnUrl` (string), `id` (string), `imageUrl` (string), `points` (integer (int64)), `publishedAt` (string), `source` (string), `summary` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/hnsearch/askHN" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/hnsearch/comments

Hacker News comments that match a query, newest first; without a query, the newest comments.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | no | Words to search for in comments. Omit it for the newest comments. (e.g. golang) |
| `limit` | integer | no | Items per page, 1 to 50. (default 10) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `createdAt` (string), `hnUrl` (string), `id` (string), `likeCount` (integer (int64)), `parentId` (string), `replyCount` (integer (int64)), `storyId` (string), `storyTitle` (string), `text` (string)

```bash
curl "https://api.hoshime.com/v1/hnsearch/comments?query=golang" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/hnsearch/authorStories

Stories one account submitted, newest first.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `username` | string | yes | Hacker News username, such as pg. (e.g. pg) |
| `limit` | integer | no | Items per page, 1 to 50. (default 10) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `commentCount` (integer (int64)), `hnUrl` (string), `id` (string), `imageUrl` (string), `points` (integer (int64)), `publishedAt` (string), `source` (string), `summary` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/hnsearch/authorStories?username=pg" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/hnsearch/authorComments

Comments one account wrote, newest first.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `username` | string | yes | Hacker News username, such as pg. (e.g. pg) |
| `limit` | integer | no | Items per page, 1 to 50. (default 10) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `createdAt` (string), `hnUrl` (string), `id` (string), `likeCount` (integer (int64)), `parentId` (string), `replyCount` (integer (int64)), `storyId` (string), `storyTitle` (string), `text` (string)

```bash
curl "https://api.hoshime.com/v1/hnsearch/authorComments?username=pg" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/hnsearch/jobs

Job posts on Hacker News, newest first, mostly the hiring posts of Y Combinator companies; a query filters them.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | no | Words to match in job posts, such as rust or remote. Omit it to list them all. |
| `limit` | integer | no | Items per page, 1 to 50. (default 10) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `commentCount` (integer (int64)), `hnUrl` (string), `id` (string), `imageUrl` (string), `points` (integer (int64)), `publishedAt` (string), `source` (string), `summary` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/hnsearch/jobs" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/hnsearch/replies

The direct replies to one Hacker News story or comment, in the order the thread shows them; each reply counts its own replies.

Scope: `social:read` · Units: 1 · Cached: 10 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Story or comment id, the number after item?id= in its URL. (e.g. 1) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `createdAt` (string), `id` (string), `likeCount` (integer (int64)), `replyCount` (integer (int64)), `text` (string)

```bash
curl "https://api.hoshime.com/v1/hnsearch/replies?id=1" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
