{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Scraper: Stories, Comments, Search, Users (API)",
    "description": "Get Hacker News data from the official APIs: top, new, best, Ask HN, Show HN and job stories, keyword and date search, full comment threads, and user profiles. Points, comments, authors and dates as clean rows, with an only-new mode for monitoring.",
    "version": "0.0",
    "x-build-id": "3vgHoJsYy3G5IVRYT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/charlesmarkette~hacker-news-scraper-stories-comments-search/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-charlesmarkette-hacker-news-scraper-stories-comments-search",
        "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/charlesmarkette~hacker-news-scraper-stories-comments-search/runs": {
      "post": {
        "operationId": "runs-sync-charlesmarkette-hacker-news-scraper-stories-comments-search",
        "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/charlesmarkette~hacker-news-scraper-stories-comments-search/run-sync": {
      "post": {
        "operationId": "run-sync-charlesmarkette-hacker-news-scraper-stories-comments-search",
        "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": [
              "lists",
              "search",
              "items",
              "users"
            ],
            "type": "string",
            "description": "Lists: the stories on HN's front-page lists. Search: Algolia's HN search by keyword, tag, date and points. Items: specific stories or comments by ID or URL. Users: user profiles, optionally with their latest submissions.",
            "default": "lists"
          },
          "lists": {
            "title": "Lists",
            "type": "array",
            "description": "Lists mode. One or more of the official story lists. A story on several lists is output once (with its rank in each list in listRanks).",
            "items": {
              "type": "string",
              "enum": [
                "top",
                "new",
                "best",
                "ask",
                "show",
                "job"
              ],
              "enumTitles": [
                "Top (front page)",
                "New",
                "Best",
                "Ask HN",
                "Show HN",
                "Jobs"
              ]
            },
            "default": [
              "top"
            ]
          },
          "maxItems": {
            "title": "Max stories",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Lists mode: how many stories to read from the top of each list (the API gives up to 500 for top, new and best, 200 for Ask, Show and jobs). Search mode: how many search results to read in total (more than 1,000 needs Sort = Date; see the README).",
            "default": 30
          },
          "query": {
            "title": "Search words",
            "type": "string",
            "description": "Search mode. Words to look for in titles, URLs, story text and comments (Algolia full-text search). Leave empty to get everything that matches the tags and dates."
          },
          "tags": {
            "title": "Tags",
            "type": "array",
            "description": "Search mode. All must match: story, comment, poll, ask_hn, show_hn, front_page, author_USERNAME, story_ID (comments of one story). An OR group: (story,poll).",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "date",
              "relevance"
            ],
            "type": "string",
            "description": "Search mode. Date: newest first, and can read more than 1,000 results (it moves to older time windows automatically). Relevance: Algolia's ranking (text match, then points), at most 1,000 results.",
            "default": "date"
          },
          "dateFrom": {
            "title": "Posted after",
            "type": "string",
            "description": "Search mode. A date (2026-10-01), a time (2026-10-01T08:00:00Z) or a period back from now ('7 days', '24 hours')."
          },
          "dateTo": {
            "title": "Posted before",
            "type": "string",
            "description": "Search mode. Same formats. A date on its own includes that whole day (UTC)."
          },
          "minPoints": {
            "title": "Min points",
            "minimum": 0,
            "type": "integer",
            "description": "Search mode. Only stories with at least this many points (comments have no points, so this leaves them out)."
          },
          "minComments": {
            "title": "Min comments",
            "minimum": 0,
            "type": "integer",
            "description": "Search mode. Only stories with at least this many comments."
          },
          "items": {
            "title": "Items",
            "type": "array",
            "description": "Items mode. Item IDs (8863) or Hacker News URLs (https://news.ycombinator.com/item?id=8863): stories, comments, jobs or polls.",
            "items": {
              "type": "string"
            }
          },
          "users": {
            "title": "Users",
            "type": "array",
            "description": "Users mode. Usernames (case-sensitive) or profile URLs (https://news.ycombinator.com/user?id=pg). Each gives one row: created date, karma, about text and number of submissions.",
            "items": {
              "type": "string"
            }
          },
          "userSubmissions": {
            "title": "Latest submissions per user",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Users mode. Also output each user's latest N submissions, newest first (0 = profile only, up to 1,000). Each submission is an output row.",
            "default": 0
          },
          "userSubmissionTypes": {
            "title": "Submission types",
            "enum": [
              "stories",
              "comments",
              "all"
            ],
            "type": "string",
            "description": "Users mode. Which submissions to list.",
            "default": "stories"
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Also get each story's comment thread (one Algolia request per story with comments). Each included comment is charged like a row; see the pricing section.",
            "default": false
          },
          "commentsFormat": {
            "title": "Comments format",
            "enum": [
              "nested",
              "flat"
            ],
            "type": "string",
            "description": "Nested: a 'comments' array on the story row, replies inside replies. Flat: one row per comment after its story, with storyId, parentId and depth (best for spreadsheets and filtering).",
            "default": "nested"
          },
          "maxCommentsPerStory": {
            "title": "Max comments per story",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Comments are taken in thread order (top-level comments in HN's ranking, each followed by its replies) up to this many.",
            "default": 200
          },
          "textFormat": {
            "title": "Text format",
            "enum": [
              "text",
              "markdown",
              "html"
            ],
            "type": "string",
            "description": "Story text, comments and user 'about' come from HN as HTML. Plain text (links written out), Markdown, or the original HTML.",
            "default": "text"
          },
          "includeDeleted": {
            "title": "Include deleted and dead items",
            "type": "boolean",
            "description": "Off: deleted and dead (flagged or killed) stories are left out, and deleted comments are dropped unless they have replies (then they stay as a free placeholder row so the thread stays connected). On: all are output with deleted / dead set to true.",
            "default": false
          },
          "onlyNew": {
            "title": "Only new items",
            "type": "boolean",
            "description": "Output only stories (and search results) not output by an earlier run with the same settings. The first run outputs everything it finds. Memory: the last 50,000 IDs, in the key-value store 'hacker-news-scraper-state'.",
            "default": false
          },
          "stateKey": {
            "title": "Memory name",
            "type": "string",
            "description": "Optional. Runs with the same memory name share their 'only new' memory. By default each saved task has its own memory per set of settings. Letters, digits, '-', '_' and '.'."
          },
          "concurrency": {
            "title": "Parallel requests (Firebase API)",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many item requests to send to HN's Firebase API at the same time (1–20). Algolia requests are always limited to 2 at a time and spaced out to stay within its public rate limit.",
            "default": 10
          },
          "maxResults": {
            "title": "Max output rows",
            "minimum": 1,
            "type": "integer",
            "description": "Optional cap on output rows for the whole run (stories, users and, in flat mode, comment rows)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}