# getHackerNewsStory

**Identifier:** `hackernews_getHackerNewsStory`

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

Get one Hacker News story or comment by id with its discussion thread: title, link, points and the comments with their depth and reply counts. Use it to read what was said in a specific discussion.

## Run it with the CLI

```bash
kirha tools run hackernews_getHackerNewsStory \
  --input '{
    "id": "<id>"
  }'
```

`--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_getHackerNewsStory",
  "input": {
    "id": "<id>"
  }
}'
```

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": {
    "id": {
      "description": "Item id or news.ycombinator.com item URL",
      "type": "string"
    },
    "limit": {
      "default": 30,
      "maximum": 150,
      "minimum": 1,
      "type": "integer"
    },
    "maxDepth": {
      "default": 2,
      "description": "1 keeps top-level comments only",
      "maximum": 6,
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "id"
  ],
  "type": "object"
}
```

## Output schema

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

-----

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