{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Scraper",
    "description": "Collect public Hacker News stories, comments, monthly hiring posts, item trees, and user profiles. Records include author, title, text, points, comment count, dates, URLs, and related item IDs. Search by keyword and filters, or split date windows to work around Algolia’s result limit.",
    "version": "1.0",
    "x-build-id": "Jf9wzub8CQf5bFuo4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/axiomworks~hacker-news-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-axiomworks-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/axiomworks~hacker-news-scraper/runs": {
      "post": {
        "operationId": "runs-sync-axiomworks-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/axiomworks~hacker-news-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-axiomworks-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": "Collection mode, e.g. search",
            "enum": [
              "search",
              "whoIsHiring",
              "item",
              "user"
            ],
            "type": "string",
            "description": "Choose search (default: newest stories), whoIsHiring (monthly top-level hiring comments), item (story and comment tree), or user (public profiles). Example: \"item\" requires itemIds; \"user\" requires usernames. Unavailable targets are skipped; an empty run succeeds with guidance.",
            "default": "search"
          },
          "searchQueries": {
            "title": "Search keywords, e.g. web scraping",
            "type": "array",
            "description": "Search-mode keywords as a list, e.g. [\"web scraping\", \"python\"]. Each query runs separately; duplicates are removed. Default [] searches all items matching the search filters. For no matches, broaden keywords or remove filters.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "itemIds": {
            "title": "Item-mode IDs or URLs, e.g. 22180559",
            "type": "array",
            "description": "Required for mode=\"item\": a list of numeric IDs or Hacker News item URLs, e.g. [\"22180559\"] or [\"https://news.ycombinator.com/item?id=22180559\"]. Returns each root and its nested comments within the shared maxItems budget. Missing targets are skipped; ignored in other modes.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "usernames": {
            "title": "User-mode names or profile URLs, e.g. pg",
            "type": "array",
            "description": "Required for mode=\"user\": a list of public usernames or Hacker News profile URLs, e.g. [\"pg\"] or [\"https://news.ycombinator.com/user?id=pg\"]. Names accept letters, digits, underscores and hyphens, 1-64 characters. Unknown users are skipped.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "hiringMonth": {
            "title": "Hiring month, e.g. latest or 2026-09",
            "type": "string",
            "description": "For mode=\"whoIsHiring\", use \"latest\" (default) or a YYYY-MM month, e.g. \"2026-09\". Searches the latest 100 matching monthly threads by whoishiring. If no thread is found, try latest or a more recent month.",
            "default": "latest"
          },
          "keywordFilter": {
            "title": "Hiring text substring, e.g. remote",
            "type": "string",
            "description": "For mode=\"whoIsHiring\", require this case-insensitive substring in each hiring comment, e.g. \"remote\" or \"python\". Default \"\" keeps every top-level post. This is a text match, so \"remote\" can also match \"no remote\". Clear it if no posts match.",
            "default": ""
          },
          "contentType": {
            "title": "Search content tag, e.g. story or comment",
            "enum": [
              "story",
              "comment",
              "show_hn",
              "ask_hn",
              "poll",
              "job",
              "front_page"
            ],
            "type": "string",
            "description": "For mode=\"search\", choose story (default), comment, show_hn, ask_hn, poll, job, or front_page. Example: \"comment\" returns discussion comments; \"show_hn\" uses Algolia’s Show HN tag.",
            "default": "story"
          },
          "sortBy": {
            "title": "Search order, e.g. date or relevance",
            "enum": [
              "date",
              "relevance"
            ],
            "type": "string",
            "description": "For mode=\"search\", use \"date\" (default: newest first) or \"relevance\" (Algolia relevance), e.g. \"relevance\" for topic research. Searches exceeding the API window are divided by creation date, so large exports are not globally relevance-sorted.",
            "default": "date"
          },
          "minPoints": {
            "title": "Minimum search points, e.g. 50",
            "minimum": 0,
            "type": "integer",
            "description": "Optional nonnegative integer score threshold for mode=\"search\", e.g. 50. Omitted means no score minimum. Useful for stories; comments may lack points. Remove this filter if the search returns no records."
          },
          "minComments": {
            "title": "Minimum search discussion count, e.g. 10",
            "minimum": 0,
            "type": "integer",
            "description": "Optional nonnegative integer discussion-count threshold for mode=\"search\", e.g. 10. Omitted means no minimum. Useful for stories; comments may lack num_comments. Remove this filter if no records match."
          },
          "dateFrom": {
            "title": "Search start date, e.g. 2026-01-01",
            "type": "string",
            "description": "Optional inclusive creation-date boundary for mode=\"search\", e.g. \"2026-01-01\" or \"2026-01-01T00:00:00Z\". Omitted starts at the Unix epoch. Use explicit UTC timestamps for precise intervals and choose a date earlier than dateTo."
          },
          "dateTo": {
            "title": "Search end date, e.g. 2026-10-01",
            "type": "string",
            "description": "Optional exclusive creation-date boundary for mode=\"search\", e.g. \"2026-10-01\" or \"2026-10-01T00:00:00Z\". Omitted uses the current time. A date-only value excludes that day from midnight; widen the interval if empty."
          },
          "author": {
            "title": "Search author username, e.g. pg",
            "type": "string",
            "description": "Optional exact public username for mode=\"search\", e.g. \"pg\"; applies Algolia’s author tag. Omitted searches all authors. Use usernames with mode=\"user\" to retrieve profiles instead."
          },
          "exactPhrase": {
            "title": "Quote search phrases, e.g. true",
            "type": "boolean",
            "description": "For mode=\"search\", set true to wrap each nonempty query in quotes before sending it to Algolia, e.g. \"web scraping\" becomes a quoted phrase. Default false uses normal Algolia search. Turn off if too few records match.",
            "default": false
          },
          "maxItems": {
            "title": "Shared result limit, e.g. 20",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum unique dataset rows across all queries, item trees or usernames: 1-100000, default 50, e.g. 20. Includes root items and comments in item mode. Stops when this shared limit or your run cost limit is reached; fewer rows are returned when fewer matches exist.",
            "default": 50
          },
          "enrich": {
            "title": "Enable AI categories or sentiment, e.g. false",
            "type": "boolean",
            "description": "Set true to send relevant text to TypeSafe AI, a third-party AI processor. Default false. Hiring mode can fill jobCategory; other modes attempt sentiment using the first search query as the subject. Requires configured runtime access; errors leave classifications null. Successful enrichment has a separate event.",
            "default": false
          },
          "maxJevCalls": {
            "title": "AI call limit, e.g. 100",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum TypeSafe AI calls shared across fallback extraction and enrichment: integer 0-500, default 500, e.g. 100. Set 0 to disable all AI calls. Calls require configured runtime access; exceeding this cap leaves optional classifications null.",
            "default": 500
          },
          "proxyConfiguration": {
            "title": "Optional Apify Proxy, e.g. disabled",
            "type": "object",
            "description": "Apify Proxy settings for Algolia requests, e.g. {\"useApifyProxy\":false} (default). Direct requests are tried first; when enabled, retries use fresh proxy sessions. Persistent failures skip the target. If blocked, enable a suitable proxy or retry later; no Hacker News login is used.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}