{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Scraper - Stories, Comments & Who's Hiring Jobs",
    "description": "Scrape Hacker News with the official APIs: keyword search with date, points & author filters, front page, new, best, Ask & Show HN, full comment threads, plus monthly Who is hiring? posts parsed into jobs (company, role, remote, salary, tech stack, apply link). No login.",
    "version": "0.2",
    "x-build-id": "mtlL9oI52IyRzaVtX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/consequential_programmer~hacker-news-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-consequential_programmer-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/consequential_programmer~hacker-news-scraper/runs": {
      "post": {
        "operationId": "runs-sync-consequential_programmer-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/consequential_programmer~hacker-news-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-consequential_programmer-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": "What to scrape",
            "enum": [
              "search",
              "lists",
              "whoIsHiring",
              "items"
            ],
            "type": "string",
            "description": "search = keyword search across all of HN history; lists = front page / new / best / Ask / Show / jobs right now; whoIsHiring = the monthly 'Ask HN: Who is hiring?' thread parsed into structured job posts; items = specific stories or comments by ID/URL.",
            "default": "search"
          },
          "maxResults": {
            "title": "Max results (per query / list / thread)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum stories, comments or job posts per search query, per list or per hiring thread. 0 = no limit. Comment threads (if enabled) are counted separately.",
            "default": 50
          },
          "queries": {
            "title": "Search queries",
            "type": "array",
            "description": "Keywords to search for (mode: search). Leave empty to list everything matching the filters.",
            "default": [
              "AI agents"
            ],
            "items": {
              "type": "string"
            }
          },
          "itemType": {
            "title": "Item type",
            "enum": [
              "story",
              "comment",
              "ask",
              "show",
              "job",
              "poll",
              "frontPage",
              "any"
            ],
            "type": "string",
            "description": "What to search for.",
            "default": "story"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "date"
            ],
            "type": "string",
            "description": "Relevance (max 1,000 results per query) or newest first (no limit).",
            "default": "relevance"
          },
          "dateFrom": {
            "title": "Created from",
            "type": "string",
            "description": "Only items created on/after this date (YYYY-MM-DD, UTC)."
          },
          "dateTo": {
            "title": "Created until",
            "type": "string",
            "description": "Only items created on/before this date (YYYY-MM-DD, UTC)."
          },
          "minPoints": {
            "title": "Min points",
            "minimum": 0,
            "type": "integer",
            "description": "Only stories with at least this many points (search & lists).",
            "default": 0
          },
          "minComments": {
            "title": "Min comments",
            "minimum": 0,
            "type": "integer",
            "description": "Only stories with at least this many comments (search).",
            "default": 0
          },
          "author": {
            "title": "Author username",
            "type": "string",
            "description": "Only items by this HN user (search)."
          },
          "lists": {
            "title": "Lists",
            "type": "array",
            "description": "Which live HN lists to scrape (mode: lists): top (front page), new, best, ask, show, job.",
            "items": {
              "type": "string",
              "enum": [
                "top",
                "new",
                "best",
                "ask",
                "show",
                "job"
              ],
              "enumTitles": [
                "Front page (top)",
                "Newest",
                "Best",
                "Ask HN",
                "Show HN",
                "Jobs"
              ]
            },
            "default": [
              "top"
            ]
          },
          "itemIds": {
            "title": "Item IDs or URLs",
            "type": "array",
            "description": "Story/comment IDs or news.ycombinator.com/item?id=... URLs (mode: items).",
            "items": {
              "type": "string"
            }
          },
          "includeComments": {
            "title": "Include full comment threads",
            "type": "boolean",
            "description": "For every story, also save its comments (with depth and parent) as separate items.",
            "default": false
          },
          "maxCommentsPerStory": {
            "title": "Max comments per story",
            "minimum": 0,
            "type": "integer",
            "description": "0 = all comments.",
            "default": 100
          },
          "maxCommentDepth": {
            "title": "Max comment depth",
            "minimum": 0,
            "type": "integer",
            "description": "1 = top-level comments only. 0 = all levels.",
            "default": 0
          },
          "hiringMonths": {
            "title": "How many recent months",
            "minimum": 1,
            "maximum": 24,
            "type": "integer",
            "description": "Mode whoIsHiring: scrape the latest N monthly 'Who is hiring?' threads.",
            "default": 1
          },
          "hiringThreadIds": {
            "title": "...or specific hiring thread IDs",
            "type": "array",
            "description": "Optional: exact thread IDs/URLs instead of the latest months.",
            "items": {
              "type": "string"
            }
          },
          "remoteOnly": {
            "title": "Remote jobs only",
            "type": "boolean",
            "description": "Keep only posts that mention REMOTE in their header line.",
            "default": false
          },
          "jobKeywords": {
            "title": "Job keywords",
            "type": "array",
            "description": "Keep only posts containing any of these words (case-insensitive), e.g. Python, Rust, founding engineer.",
            "items": {
              "type": "string"
            }
          },
          "jobLocation": {
            "title": "Job location contains",
            "type": "string",
            "description": "Keep only posts mentioning this text, e.g. London, Berlin, Sydney."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}