{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Historical Archive Scraper — Old Stories by Date",
    "description": "Bulk-export the entire Hacker News archive between any two dates in chronological order. Stories, comments, Ask/Show HN, polls and jobs since 2006 via the keyless Algolia HN API. Time-windowed firehose yields hundreds of thousands of rows. No API key, no login.",
    "version": "1.0",
    "x-build-id": "HaFwMFbm9cFpcymYn"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/logiover~hacker-news-historical-archive-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-logiover-hacker-news-historical-archive-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/logiover~hacker-news-historical-archive-scraper/runs": {
      "post": {
        "operationId": "runs-sync-logiover-hacker-news-historical-archive-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/logiover~hacker-news-historical-archive-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-logiover-hacker-news-historical-archive-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",
        "required": [
          "startDate",
          "endDate"
        ],
        "properties": {
          "contentType": {
            "title": "Content Type",
            "enum": [
              "story",
              "comment",
              "show_hn",
              "ask_hn",
              "poll",
              "job",
              "front_page",
              "all"
            ],
            "type": "string",
            "description": "Which kind of Hacker News item to export. 'Stories' = link + text posts (the classic front-page firehose). 'Comments' = every comment body with its parent/story. 'Show HN' / 'Ask HN' = those two dedicated categories. 'Polls', 'Jobs' = those item types. 'All' = stories + comments + polls + jobs combined in one chronological stream.",
            "default": "story"
          },
          "startDate": {
            "title": "Start Date (inclusive, UTC)",
            "type": "string",
            "description": "The oldest date to include, as YYYY-MM-DD (UTC). Everything created on or after this date is exported. HN launched in 2006, so any date from 2006-10-01 onward is reachable. Example: '2024-01-01'."
          },
          "endDate": {
            "title": "End Date (inclusive, UTC)",
            "type": "string",
            "description": "The newest date to include, as YYYY-MM-DD (UTC). Everything created on or before the END of this day is exported. Combine with Start Date to define your window. Example: '2024-01-08'."
          },
          "query": {
            "title": "Keyword filter (optional)",
            "type": "string",
            "description": "OPTIONAL keyword to narrow the export (matched against titles, text and comment bodies). Leave EMPTY for a pure firehose that returns every item in the date window. Use this only if you want a topic slice, e.g. 'openai', 'rust', 'layoffs'.",
            "default": ""
          },
          "authors": {
            "title": "Authors (optional)",
            "type": "array",
            "description": "OPTIONAL list of Hacker News usernames to restrict the export to (no @ prefix). Each username is queried separately across the date window. Leave empty to include all authors. Example: ['pg', 'dang', 'patio11'].",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minPoints": {
            "title": "Minimum Points",
            "minimum": 0,
            "type": "integer",
            "description": "Only include items with at least this many points (upvotes). 0 = no filter. Useful to pull only high-engagement stories. Note: comments and jobs do not carry points, so a non-zero value effectively limits results to stories/polls.",
            "default": 0
          },
          "minComments": {
            "title": "Minimum Comments",
            "minimum": 0,
            "type": "integer",
            "description": "Only include items with at least this many comments. 0 = no filter. Applies to stories/Ask/Show/polls (comments themselves have no comment count).",
            "default": 0
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 0,
            "type": "integer",
            "description": "Global hard cap on rows returned by the run. Default 5000 is a sane starting point; raise it (e.g. 100000+) to pull a full multi-year corpus. 0 = unlimited (bounded only by the date window and the run timeout).",
            "default": 5000
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify Proxy configuration. The Algolia HN Search API is a fast public CDN endpoint that works over a direct connection, so datacenter proxy (the default) is plenty and keeps cost low. A fresh proxy session is minted per retry to rotate away from any throttled IP.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}