{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Scraper – Stories, Comments, Search & Who's Hiring",
    "description": "Hacker News data from the official API and Algolia HN Search: top/new/best/Ask/Show/job stories, keyword and brand monitoring with only-new alerts, full comment trees flattened with depth, and the monthly Who is hiring thread parsed into job posts.",
    "version": "0.1",
    "x-build-id": "6twiFfKaZJ6Q0DBuw"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~hacker-news-data/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-hacker-news-data",
        "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/gazidev~hacker-news-data/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-hacker-news-data",
        "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/gazidev~hacker-news-data/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-hacker-news-data",
        "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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "What to get",
            "enum": [
              "lists",
              "search",
              "items",
              "whoIsHiring"
            ],
            "type": "string",
            "description": "**Story lists**: front page (top), new, best, Ask HN, Show HN or job stories. **Search & monitor**: keyword or brand search in stories and/or comments (Algolia HN Search), with date range and points/comments thresholds. **Items + comments**: one or more stories (IDs or URLs) with the full comment tree. **Who is hiring**: the monthly 'Ask HN: Who is hiring?' thread split into job posts.",
            "default": "lists"
          },
          "lists": {
            "title": "Lists",
            "type": "array",
            "description": "Used in **Story lists** mode. `top` = the front page ranking.",
            "items": {
              "type": "string",
              "enum": [
                "top",
                "new",
                "best",
                "ask",
                "show",
                "job"
              ],
              "enumTitles": [
                "Top (front page)",
                "New",
                "Best",
                "Ask HN",
                "Show HN",
                "Jobs (YC companies)"
              ]
            },
            "default": [
              "top"
            ]
          },
          "maxItemsPerList": {
            "title": "Stories per list",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Top N of each list, in HN ranking order (`rank`). HN keeps up to 500 (top/new/best) or 200 (ask/show/job).",
            "default": 30
          },
          "searchQueries": {
            "title": "Search queries / brands",
            "type": "array",
            "description": "Used in **Search & monitor** mode. One query per line, e.g. a brand, product, domain or topic. Use quotes for a phrase (`\"web scraping\"`). Each result has `matchedQuery`.",
            "items": {
              "type": "string"
            }
          },
          "searchTags": {
            "title": "Search in",
            "enum": [
              "story",
              "comment",
              "storyOrComment",
              "showHn",
              "askHn",
              "poll",
              "frontPage",
              "any"
            ],
            "type": "string",
            "description": "Which kind of items to search.",
            "default": "story"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "date",
              "relevance"
            ],
            "type": "string",
            "description": "`date` = newest first, no limit on the number of results (use this for monitoring). `relevance` = Algolia ranking (points, matches), max 1,000 results per query.",
            "default": "date"
          },
          "createdAfter": {
            "title": "Created after",
            "type": "string",
            "description": "Only items created on or after this date. Absolute (`2026-09-01`) or relative (`7 days`, `24 hours`)."
          },
          "createdBefore": {
            "title": "Created before",
            "type": "string",
            "description": "Only items created before this date."
          },
          "minPoints": {
            "title": "Min points",
            "minimum": 0,
            "type": "integer",
            "description": "Stories only (comments have no public points). 0 = off.",
            "default": 0
          },
          "minComments": {
            "title": "Min comments",
            "minimum": 0,
            "type": "integer",
            "description": "Stories only. 0 = off.",
            "default": 0
          },
          "author": {
            "title": "Author (HN username)",
            "type": "string",
            "description": "Optional. Only items by this user. Can be used without a query to get a user's latest stories or comments."
          },
          "maxResultsPerQuery": {
            "title": "Max results per query",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Newest first when sorted by date.",
            "default": 100
          },
          "exactMatch": {
            "title": "Strict matching (no typos)",
            "type": "boolean",
            "description": "Algolia matches typos by default (`rust` also finds `trust`). On: typo tolerance is switched off and every query word must appear at the start of a word in the title, text, URL or story title (`postgres` still finds `PostgreSQL`). Dropped results are free.",
            "default": true
          },
          "itemIds": {
            "title": "Item IDs or URLs",
            "type": "array",
            "description": "Used in **Items + comments** mode. HN item IDs (`8863`) or URLs (`https://news.ycombinator.com/item?id=8863`). Returns the item and all its comments.",
            "items": {
              "type": "string"
            }
          },
          "includeComments": {
            "title": "Also get comments in lists / search",
            "type": "boolean",
            "description": "In **Story lists** and **Search** mode, also save the full comment tree of each story (each comment is a row and is charged as an item). Always on in Items mode.",
            "default": false
          },
          "maxCommentDepth": {
            "title": "Max comment depth",
            "minimum": 0,
            "type": "integer",
            "description": "1 = top-level comments only, 2 = plus direct replies, 0 = all levels.",
            "default": 0
          },
          "maxCommentsPerItem": {
            "title": "Max comments per item",
            "minimum": 0,
            "type": "integer",
            "description": "0 = all. Comments are taken in thread order (top-level by HN ranking, each followed by its replies).",
            "default": 0
          },
          "includeDeletedComments": {
            "title": "Include deleted / dead comments",
            "type": "boolean",
            "description": "Off: deleted and flagged (dead) comments are skipped, their replies are kept.",
            "default": false
          },
          "commentSource": {
            "title": "Comment source",
            "enum": [
              "auto",
              "firebase"
            ],
            "type": "string",
            "description": "`auto`: whole tree from Algolia in one request (fast, top level in HN ranking order, replies by time), falls back to the official API when Algolia is incomplete. `firebase`: official API only (live, exact HN order, one request per comment - slower on big threads).",
            "default": "auto"
          },
          "hiringMonth": {
            "title": "Month",
            "type": "string",
            "description": "Used in **Who is hiring** mode. `latest`, `2026-09` or `September 2026`.",
            "default": "latest"
          },
          "hiringKeywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Optional. Keep only job posts containing these words (whole words, case-insensitive), e.g. `python`, `rust`, `Berlin`. Filtered posts are free.",
            "items": {
              "type": "string"
            }
          },
          "hiringKeywordsMode": {
            "title": "Keyword match",
            "enum": [
              "any",
              "all"
            ],
            "type": "string",
            "description": "Any keyword or all keywords.",
            "default": "any"
          },
          "remoteOnly": {
            "title": "Remote jobs only",
            "type": "boolean",
            "description": "Keep only posts detected as remote (`remote: true`).",
            "default": false
          },
          "onlyNew": {
            "title": "Only new since the last run",
            "type": "boolean",
            "description": "Remembers what was already returned (in a named key-value store derived from this input) and outputs only new stories, search results, comments or job posts. Schedule the Actor hourly or daily for brand alerts, new comments on a thread or new job posts. The first run returns the current results.",
            "default": false
          },
          "stateKey": {
            "title": "Monitoring state name",
            "type": "string",
            "description": "Optional. By default the memory is tied to this input. Set a name to keep the memory when you edit the input."
          },
          "maxItems": {
            "title": "Max rows in total",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many rows (stories + comments + job posts). 0 = no limit. You pay only for rows saved.",
            "default": 0
          },
          "includeHtml": {
            "title": "Include original HTML",
            "type": "boolean",
            "description": "Add `textHtml` with HN's HTML next to the plain `text`.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Parallel requests to the official API (Algolia is always limited to 4).",
            "default": 20
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Failed requests are retried 3 times with backoff.",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}