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

# Hacker News Search (Algolia)

> Full-text search over Hacker News stories, comments, polls and users, plus whole items with their comment trees, from the free HN Search API built on Algolia.

![](https://mintcdn.com/webrouter/JBFYvcRI1PVnd4YX/logo/data-apis/hn-algolia.webp?fit=max\&auto=format\&n=JBFYvcRI1PVnd4YX\&q=85\&s=ee25a53f9691dd1b7ff249c6ba2b7c77)

[Web Catalog · Search](https://docs.webrouter.net/data-apis.md?category=search)

No key needed

Endpoints

4

Auth

None

[Vendor docs](https://hn.algolia.com/api) · Serves `news.ycombinator.com`

## Notes

* Keyless and free. Limited to 10,000 requests per hour per IP.
* Results page from 0; the response gives nbHits, nbPages, page and hitsPerPage.
* The documented parameters are query, tags, numericFilters and page (plus hitsPerPage); the API is built on Algolia's search API, whose other query parameters it says are also accepted.
* Timestamps for numericFilters are Unix seconds (created\_at\_i).

## Endpoints

GET

Search Hacker News by relevance

Stories, comments and polls matching a query, sorted by relevance, then points, then comment count.

[Open](#hn-algolia-search)

GET

Search Hacker News by date

Items matching a query or filter, most recent first.

[Open](#hn-algolia-search-by-date)

GET

Get an item with its comments

A story, comment or poll by ID with author, points, text and the full nested children tree.

[Open](#hn-algolia-item-get)

GET

Get a user

Username, about text and karma of an HN user.

[Open](#hn-algolia-user-get)

### Search Hacker News by relevance

GET

`/search`

`hn-algolia.search`

Stories, comments and polls matching a query, sorted by relevance, then points, then comment count.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `query`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Full-text query.
      </td>
    </tr>

    <tr><td>`tags`</td><td>string</td><td>query</td><td>Tag filter, comma-separated tags are ANDed; parenthesised ones are ORed, e.g. author\_pg,(story,poll). Tags: story, comment, poll, pollopt, show\_hn, ask\_hn, front\_page, author\_USERNAME, story\_ID. Example `story`</td></tr>

    <tr>
      <td>
        `numericFilters`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Numeric conditions, comma-separated, with \<, \<=, =, >, >= on created\_at\_i (Unix seconds), points or num\_comments, e.g. created\_at\_i>1700000000.
      </td>
    </tr>

    <tr>
      <td>
        `page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Page number, from 0.
      </td>
    </tr>

    <tr>
      <td>
        `hitsPerPage`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Results per page (default 20).
      </td>
    </tr>

    <tr>
      <td>
        `restrictSearchableAttributes`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Limit matching to one attribute, e.g. url (the docs' example).
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://hn.algolia.com/api) · Same job: [AnyAPI](https://docs.webrouter.net/data-apis/anyapi.md#anyapi-facebook-search), [DEV Community](https://docs.webrouter.net/data-apis/dev-to.md#dev-to-articles-search), [FastMoss](https://docs.webrouter.net/data-apis/fastmoss.md#fastmoss-creators-search), [Fetchin](https://docs.webrouter.net/data-apis/fetchinio.md#fetchinio-posts-search), [HarvestAPI](https://docs.webrouter.net/data-apis/harvestapi.md#harvestapi-linkedin-post-search), [Influencers Club](https://docs.webrouter.net/data-apis/influencersclub.md#influencersclub-creators-discover)

```python Python theme={null}
router.call_data_api("hn-algolia.search", {'tags': 'story'})
```

```text MCP theme={null}
call_data_api(endpoint="hn-algolia.search", params={"tags": "story"})
```

> [!NOTE]
>
> * tags=front\_page with no query returns what is on the front page now.

### Search Hacker News by date

GET

`/search_by_date`

`hn-algolia.search_by_date`

Items matching a query or filter, most recent first.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `query`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Full-text query.
      </td>
    </tr>

    <tr><td>`tags`</td><td>string</td><td>query</td><td>Tag filter, comma-separated tags are ANDed; parenthesised ones are ORed, e.g. author\_pg,(story,poll). Tags: story, comment, poll, pollopt, show\_hn, ask\_hn, front\_page, author\_USERNAME, story\_ID. Example `story`</td></tr>

    <tr>
      <td>
        `numericFilters`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Numeric conditions, comma-separated, with \<, \<=, =, >, >= on created\_at\_i (Unix seconds), points or num\_comments, e.g. created\_at\_i>1700000000.
      </td>
    </tr>

    <tr>
      <td>
        `page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Page number, from 0.
      </td>
    </tr>

    <tr>
      <td>
        `hitsPerPage`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Results per page (default 20).
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://hn.algolia.com/api) · Same job: [AnyAPI](https://docs.webrouter.net/data-apis/anyapi.md#anyapi-facebook-search), [DEV Community](https://docs.webrouter.net/data-apis/dev-to.md#dev-to-articles-search), [FastMoss](https://docs.webrouter.net/data-apis/fastmoss.md#fastmoss-creators-search), [Fetchin](https://docs.webrouter.net/data-apis/fetchinio.md#fetchinio-posts-search), [HarvestAPI](https://docs.webrouter.net/data-apis/harvestapi.md#harvestapi-linkedin-post-search), [Influencers Club](https://docs.webrouter.net/data-apis/influencersclub.md#influencersclub-creators-discover)

```python Python theme={null}
router.call_data_api("hn-algolia.search_by_date", {'tags': 'story'})
```

```text MCP theme={null}
call_data_api(endpoint="hn-algolia.search_by_date", params={"tags": "story"})
```

> [!NOTE]
>
> * Use tags=story (or comment) with numericFilters=created\_at\_i>X to poll for new items.

### Get an item with its comments

GET

`/items/{id}`

`hn-algolia.item.get`

A story, comment or poll by ID with author, points, text and the full nested children tree.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`id` required</td><td>integer</td><td>path</td><td>HN item ID. Example `1`</td></tr>
  </tbody>
</table>

[Vendor docs](https://hn.algolia.com/api) · Same job: [AnyAPI](https://docs.webrouter.net/data-apis/anyapi.md#anyapi-facebook-comments), [DEV Community](https://docs.webrouter.net/data-apis/dev-to.md#dev-to-comments-list), [Fetchin](https://docs.webrouter.net/data-apis/fetchinio.md#fetchinio-post-comments), [HarvestAPI](https://docs.webrouter.net/data-apis/harvestapi.md#harvestapi-linkedin-profile-comments), [Influencers Club](https://docs.webrouter.net/data-apis/influencersclub.md#influencersclub-posts-details), [Instagram Graph API](https://docs.webrouter.net/data-apis/instagram.md#instagram-comments-list)

```python Python theme={null}
router.call_data_api("hn-algolia.item.get", {'id': 1})
```

```text MCP theme={null}
call_data_api(endpoint="hn-algolia.item.get", params={"id": 1})
```

### Get a user

GET

`/users/{username}`

`hn-algolia.user.get`

Username, about text and karma of an HN user.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`username` required</td><td>string</td><td>path</td><td>HN username. Example `pg`</td></tr>
  </tbody>
</table>

[Vendor docs](https://hn.algolia.com/api) · Same job: [AnyAPI](https://docs.webrouter.net/data-apis/anyapi.md#anyapi-facebook-profile), [Aviato](https://docs.webrouter.net/data-apis/aviato.md#aviato-company-social-metrics), [DEV Community](https://docs.webrouter.net/data-apis/dev-to.md#dev-to-users-get), [Facebook Pages (Graph API)](https://docs.webrouter.net/data-apis/facebook.md#facebook-page-get), [Fetchin](https://docs.webrouter.net/data-apis/fetchinio.md#fetchinio-post-reactions), [HarvestAPI](https://docs.webrouter.net/data-apis/harvestapi.md#harvestapi-linkedin-post-reactions)

```python Python theme={null}
router.call_data_api("hn-algolia.user.get", {'username': 'pg'})
```

```text MCP theme={null}
call_data_api(endpoint="hn-algolia.user.get", params={"username": "pg"})
```


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