{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Scraper: Stories, Comments, Who's Hiring",
    "description": "Hacker News scraper for story, comment and hiring-post research. Select a mode to export stories, comments, search results or parsed hiring-post rows as JSON.",
    "version": "1.0",
    "x-build-id": "8a6x5tU6iUMyvLL1y"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/grit-77~hacker-news-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-grit-77-hacker-news-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/grit-77~hacker-news-scraper/runs": {
      "post": {
        "operationId": "runs-sync-grit-77-hacker-news-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/grit-77~hacker-news-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-grit-77-hacker-news-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "topstories",
              "newstories",
              "beststories",
              "askstories",
              "showstories",
              "jobstories",
              "search",
              "comments",
              "whoishiring"
            ],
            "type": "string",
            "description": "What to collect. Front page / new / best / ask / show / jobs lists come from the official Hacker News API. 'search' uses Algolia HN Search. 'comments' returns the full comment tree of the stories you name as flat rows. 'whoishiring' parses the monthly 'Ask HN: Who is hiring?' thread into one structured row per job post.",
            "default": "topstories"
          },
          "maxItems": {
            "title": "Max rows",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard cap on rows returned (and charged) in this run.",
            "default": 30
          },
          "query": {
            "title": "Search query (search mode)",
            "type": "string",
            "description": "Keywords to search for, for example `rust async` or `\"show hn\" sqlite`. May be empty if you set an author, date range or minimum points."
          },
          "type": {
            "title": "Item type (search mode)",
            "enum": [
              "story",
              "comment",
              "all",
              "poll",
              "ask_hn",
              "show_hn",
              "front_page",
              "job"
            ],
            "type": "string",
            "description": "Restrict search to one kind of item. `ask_hn`, `show_hn` and `front_page` match Algolia tags.",
            "default": "story"
          },
          "searchSort": {
            "title": "Sort (search mode)",
            "enum": [
              "relevance",
              "date"
            ],
            "type": "string",
            "description": "Relevance is capped at 1,000 hits by Algolia. Newest first has no practical cap: the actor keeps narrowing the date window.",
            "default": "relevance"
          },
          "author": {
            "title": "Author (search mode)",
            "type": "string",
            "description": "Only items posted by this HN username."
          },
          "dateFrom": {
            "title": "Posted from (search mode)",
            "type": "string",
            "description": "UTC date `YYYY-MM-DD` (or ISO timestamp). Inclusive."
          },
          "dateTo": {
            "title": "Posted until (search mode)",
            "type": "string",
            "description": "UTC date `YYYY-MM-DD` (or ISO timestamp). A bare date includes that whole day."
          },
          "minPoints": {
            "title": "Minimum points",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only items with at least this many points. Works in search mode and in the list modes.",
            "default": 0
          },
          "minComments": {
            "title": "Minimum comments",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only items with at least this many comments. Works in search mode and in the list modes.",
            "default": 0
          },
          "storyIds": {
            "title": "Story ids or links (comments mode)",
            "type": "array",
            "description": "Item ids or `https://news.ycombinator.com/item?id=...` links. One request returns a whole tree, however large.",
            "items": {
              "type": "string"
            }
          },
          "includeStory": {
            "title": "Include the story row (comments mode)",
            "type": "boolean",
            "description": "Add the story itself as the first row of each tree. It is charged like any other row.",
            "default": true
          },
          "maxCommentDepth": {
            "title": "Max comment depth (comments mode)",
            "minimum": 0,
            "type": "integer",
            "description": "0 = whole tree. 1 = top-level comments only, 2 = top-level plus direct replies, and so on.",
            "default": 0
          },
          "hiringMonths": {
            "title": "Hiring threads (whoishiring mode)",
            "type": "array",
            "description": "`latest` finds the newest 'Ask HN: Who is hiring?' thread. Or name months such as `2026-09` or `September 2026`. Each thread is one request and typically holds several hundred posts.",
            "default": [
              "latest"
            ],
            "items": {
              "type": "string"
            }
          },
          "hiringRemoteOnly": {
            "title": "Remote posts only (whoishiring mode)",
            "type": "boolean",
            "description": "Keep only posts whose header mentions remote work.",
            "default": false
          },
          "hiringKeywords": {
            "title": "Keywords (whoishiring mode)",
            "type": "array",
            "description": "Keep only posts whose text contains ANY of these words (case-insensitive), for example `rust`, `python`, `machine learning`.",
            "items": {
              "type": "string"
            }
          },
          "includeHtml": {
            "title": "Include raw HTML",
            "type": "boolean",
            "description": "Add `text_html` (the original HN markup) next to the plain `text` field.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Concurrent requests",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Parallel requests to the Hacker News API. The default is polite; raise it for large list runs.",
            "default": 10
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}