{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Scraper: Story & Comment Search",
    "description": "Hacker News Scraper: search stories, comments and user profiles by keyword with points, comment counts, dates and links. Filter Ask HN, Show HN, jobs, front page, minimum points and dates. Export CSV, Excel, JSON, XML. No login or API key. Covers about 50M items.",
    "version": "0.1",
    "x-build-id": "F1GbxBvnAiejswvBG"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/recordsdata~hackernews-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-recordsdata-hackernews-search-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/recordsdata~hackernews-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-recordsdata-hackernews-search-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/recordsdata~hackernews-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-recordsdata-hackernews-search-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": {
          "includeStories": {
            "title": "Stories",
            "type": "boolean",
            "description": "Scrape Hacker News stories (posts) that match the search query and filters. Turn off to get only comments or user profiles.",
            "default": true
          },
          "searchQuery": {
            "title": "Search query (optional)",
            "type": "string",
            "description": "Keyword or phrase for full-text search across Hacker News titles and story text, for example \"web scraping\" or \"postgres\". Leave empty to return all items matching the other filters.",
            "default": "web scraping"
          },
          "storyType": {
            "title": "Story type",
            "enum": [
              "story",
              "ask_hn",
              "show_hn",
              "job",
              "poll",
              "front_page"
            ],
            "type": "string",
            "description": "Kind of Hacker News post to search: stories, Ask HN, Show HN, jobs, polls, or the current front page.",
            "default": "story"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "date"
            ],
            "type": "string",
            "description": "Sort by relevance (best text match, popularity-weighted) or by date (newest first, best for monitoring new mentions).",
            "default": "relevance"
          },
          "minPoints": {
            "title": "Minimum points",
            "minimum": 0,
            "type": "integer",
            "description": "Only return items with at least this many upvotes. Use 100 or more to keep only high-signal stories. 0 means any.",
            "default": 0
          },
          "minComments": {
            "title": "Minimum comments",
            "minimum": 0,
            "type": "integer",
            "description": "Only return stories with at least this many comments. Use it to keep discussions that took off. Does not apply to comment or profile rows.",
            "default": 0
          },
          "author": {
            "title": "Author (username)",
            "type": "string",
            "description": "Only return stories and comments written by this Hacker News user, for example pg or dang. Leave empty for all authors.",
            "default": ""
          },
          "domain": {
            "title": "Linked domain",
            "type": "string",
            "description": "Only return stories that link to this domain (subdomains included), for example github.com or nytimes.com. Hacker News search cannot filter by domain, so the actor searches the url field and keeps exact host matches; very broad domains are capped by the search backend at about 1,000 results per query. Your keyword (if any) must also appear in the title or text.",
            "default": ""
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "whoIsHiring",
              "whoWantsToBeHired",
              "freelancer"
            ],
            "type": "string",
            "description": "Search finds stories and comments by keyword. The three monthly threads by the user whoishiring return one row per top-level post: Who is hiring, Who wants to be hired, Freelancer / seeking freelancer.",
            "default": "search"
          },
          "hiringMonth": {
            "title": "Thread month (YYYY-MM)",
            "type": "string",
            "description": "Which monthly thread to read when Mode is one of the monthly threads, format YYYY-MM, for example 2026-09. Leave empty for the latest thread.",
            "default": ""
          },
          "dateFrom": {
            "title": "From date (optional)",
            "type": "string",
            "description": "Only items created on or after this date, format YYYY-MM-DD, for example 2024-01-01. Leave empty for no lower bound.",
            "default": ""
          },
          "dateTo": {
            "title": "To date (optional)",
            "type": "string",
            "description": "Only items created on or before this date, format YYYY-MM-DD, for example 2024-12-31. Leave empty for no upper bound.",
            "default": ""
          },
          "itemIds": {
            "title": "Item IDs or URLs",
            "type": "array",
            "description": "Look up specific stories or comments by id or by news.ycombinator.com/item?id=... URL. Each one returns its row, and its comment tree when Comment tree is on. Unknown ids give a free error row.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeComments": {
            "title": "Comments",
            "type": "boolean",
            "description": "Also search comments that match the query and return one row per comment with author, parent story and date. Billed as comment rows.",
            "default": false
          },
          "includeCommentTree": {
            "title": "Comment tree",
            "type": "boolean",
            "description": "For every story returned (and for each Item ID), also return its comments as rows with a depth column, 1 = top-level reply. Every comment row counts toward Max Items and is billed as a comment record.",
            "default": false
          },
          "maxDepth": {
            "title": "Comment tree depth",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many reply levels of the comment tree to return (1 = top-level comments only). Used when Comment tree is on, and for the monthly threads when Comment tree is on.",
            "default": 3
          },
          "usernames": {
            "title": "User profiles (optional)",
            "type": "array",
            "description": "Hacker News usernames to fetch profile rows for (karma, about text, account creation date), for example \"pg\" or \"dang\". Billed as user rows.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeAuthorProfile": {
            "title": "Author karma and account age",
            "type": "boolean",
            "description": "Add authorKarma and authorCreatedAt to every story and comment row (one profile lookup per distinct author). Billed per enriched row as an author profile event.",
            "default": false
          },
          "includeGithubRepo": {
            "title": "GitHub repo stats",
            "type": "boolean",
            "description": "Add githubStars, githubLanguage and githubPushedAt to every story whose link is a GitHub repository page (one lookup per distinct repository, no token needed). GitHub allows only 60 anonymous lookups per hour per IP address, shared with other users of that address, so in practice about the first 50 distinct repositories of a run are enriched; the remaining stories are delivered without these fields. No extra charge.",
            "default": false
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum rows to return across stories, comments and profiles. Defaults to 10 for a quick test. Free users are limited to 10; paid users can set up to 1,000,000.",
            "default": 10
          },
          "onlyNew": {
            "title": "Only new results (monitor mode)",
            "type": "boolean",
            "description": "Only new results: skip every story and comment this same search already returned in an earlier run, so scheduled runs return just what is new, and you are not charged for skipped records. Max Items then means N new rows. User profile rows are not tracked.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor name (optional)",
            "type": "string",
            "description": "Optional label to keep several independent monitors for the same search. Runs that share the same query, filters and name share one list of seen records. Leave empty to use the default monitor.",
            "default": ""
          },
          "resetSeen": {
            "title": "Reset seen records",
            "type": "boolean",
            "description": "Clear the stored list of already-seen records for this search and monitor name before the run, so every matching story and comment counts as new again.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}