{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Scraper - top, new and search stories, comments",
    "description": "Hacker News stories from the official public APIs: the top, new and best lists, or a full-text search by keyword, tag and date. One row per story with id, title, URL, domain, points, author, comment count, created time and HN link; optionally top comments. For trend trackers and researchers.",
    "version": "0.1",
    "x-build-id": "CaxwziqkUXSp77zKT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/retrainmap~hackernews-stories/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-retrainmap-hackernews-stories",
        "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/retrainmap~hackernews-stories/runs": {
      "post": {
        "operationId": "runs-sync-retrainmap-hackernews-stories",
        "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/retrainmap~hackernews-stories/run-sync": {
      "post": {
        "operationId": "run-sync-retrainmap-hackernews-stories",
        "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": [
              "top",
              "new",
              "best",
              "search"
            ],
            "type": "string",
            "description": "top / new / best read the official Firebase lists (500, 500 and 200 ids) in HN's own order. search runs a full-text Algolia query using the fields below.",
            "default": "top"
          },
          "query": {
            "title": "Search query (search mode)",
            "type": "string",
            "description": "Full-text query for the Algolia API (matches title, URL, author and text). Empty = no term filter (then the tags and date range alone select the rows)."
          },
          "tags": {
            "title": "Tags (search mode)",
            "uniqueItems": true,
            "type": "array",
            "description": "Algolia item tags; several tags are ORed. story = any story (Ask/Show included), comment = comments, ask_hn / show_hn = those story kinds, front_page = stories currently on the front page. Empty = story.",
            "items": {
              "type": "string",
              "enum": [
                "story",
                "comment",
                "ask_hn",
                "show_hn",
                "front_page"
              ],
              "enumTitles": [
                "Story",
                "Comment",
                "Ask HN",
                "Show HN",
                "Front page"
              ]
            }
          },
          "search_sort": {
            "title": "Search order (search mode)",
            "enum": [
              "relevance",
              "date"
            ],
            "type": "string",
            "description": "relevance uses /search (Algolia relevance, then points and comments); date uses /search_by_date (newest first).",
            "default": "relevance"
          },
          "date_from": {
            "title": "Created on or after (YYYY-MM-DD, search mode)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional, UTC, inclusive; applied as an Algolia numericFilter on created_at_i."
          },
          "date_to": {
            "title": "Created on or before (YYYY-MM-DD, search mode)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional, UTC, inclusive (through 23:59:59 of that day)."
          },
          "include_comments": {
            "title": "Include top comments per story",
            "type": "boolean",
            "description": "When on, each story row is followed by up to comments_per_story rows of its top-level comments in HN's ranked order (one extra Algolia request per story, plus one Firebase request per story in search mode). Comment rows count towards max_records and are charged as records.",
            "default": false
          },
          "comments_per_story": {
            "title": "Comments per story",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum top-level comments written per story when include_comments is on.",
            "default": 10
          },
          "max_records": {
            "title": "Maximum records",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Stop after this many rows (stories plus comment rows) have been written. The lists hold at most 500 (top, new) or 200 (best) stories; Algolia returns at most 1,000 hits per query.",
            "default": 200
          },
          "request_interval_ms": {
            "title": "Minimum interval between requests (ms)",
            "minimum": 50,
            "maximum": 10000,
            "type": "integer",
            "description": "Politeness delay towards the two APIs (one request per story in list modes). Floor 50 ms. Algolia's documented limit is 10,000 requests per hour per IP.",
            "default": 100
          },
          "contact_email": {
            "title": "Contact e-mail (From: header)",
            "type": "string",
            "description": "Sent in the standard From: request header so the data owner can reach the operator (RFC 9110 s10.1.2).",
            "default": "info@steelyardclinical.com"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}