# searchHackerNews

**Identifier:** `hackernews_searchHackerNews`

**Provider:** [Hacker News](https://kirha.com/providers/hackernews.md)

Search Hacker News stories or comments by keyword, with filters on type, author, points and date, sorted by relevance or recency. Use it to find what developers and founders said about a technology, product or company.

## Run it with the CLI

```bash
kirha tools run hackernews_searchHackerNews \
  --input '{}'
```

`--input` takes a JSON object that matches the input schema. Pass `--input -` to read it from stdin.

## Call it over HTTP

```bash
curl https://api.kirha.com/tools/v1/execute \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: **********' \
  --data '{
  "tool_name": "hackernews_searchHackerNews",
  "input": {}
}'
```

Replace the stars with an API key from https://app.kirha.com/api-keys.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "author": {
      "minLength": 1,
      "type": "string"
    },
    "from": {
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "type": "string"
    },
    "limit": {
      "default": 15,
      "maximum": 50,
      "minimum": 1,
      "type": "integer"
    },
    "minPoints": {
      "description": "Stories only",
      "maximum": 9007199254740991,
      "minimum": 0,
      "type": "integer"
    },
    "query": {
      "minLength": 1,
      "type": "string"
    },
    "sort": {
      "default": "relevance",
      "enum": [
        "relevance",
        "date"
      ],
      "type": "string"
    },
    "to": {
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "type": "string"
    },
    "type": {
      "default": "story",
      "enum": [
        "story",
        "comment",
        "ask",
        "show"
      ],
      "type": "string"
    }
  },
  "type": "object"
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "context": {
      "type": "string"
    },
    "results": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "author": {
            "type": "string"
          },
          "comments": {
            "type": "number"
          },
          "discussionUrl": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "points": {
            "type": "number"
          },
          "postedAt": {
            "type": "string"
          },
          "storyId": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "discussionUrl"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "total": {
      "type": "number"
    }
  },
  "required": [
    "context",
    "total",
    "results"
  ],
  "type": "object"
}
```

-----

[All Hacker News tools](https://kirha.com/providers/hackernews.md) · [< Back to tools list](https://kirha.com/tools.md)