{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Scraper - Stories, Comments, Search, Jobs",
    "description": "Hacker News scraper: top, new, best, Ask HN, Show HN and job stories, full-text search with filters (points, comments, dates), and comment threads. Official Firebase and Algolia APIs, no usernames collected. From US$0.30 per 1,000 items.",
    "version": "0.1",
    "x-build-id": "uzDlbWHlP81vXicW6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fabrikit~hacker-news-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fabrikit-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/fabrikit~hacker-news-scraper/runs": {
      "post": {
        "operationId": "runs-sync-fabrikit-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/fabrikit~hacker-news-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-fabrikit-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": "Mode",
            "enum": [
              "lists",
              "search",
              "items"
            ],
            "type": "string",
            "description": "Lists = the live front page lists (top, new, best, Ask HN, Show HN, jobs). Search = full-text search over all of Hacker News history with filters. Items = specific stories or comments by ID or URL.",
            "default": "lists"
          },
          "lists": {
            "title": "Lists (lists mode)",
            "type": "array",
            "description": "Which Hacker News lists to read. top and new hold up to 500 stories, best 200, Show HN ~150, Ask HN and jobs ~30 each.",
            "items": {
              "type": "string",
              "enum": [
                "top",
                "new",
                "best",
                "ask",
                "show",
                "job"
              ],
              "enumTitles": [
                "Top stories",
                "New stories",
                "Best stories",
                "Ask HN",
                "Show HN",
                "Jobs"
              ]
            },
            "default": [
              "top"
            ]
          },
          "queries": {
            "title": "Search queries (search mode)",
            "type": "array",
            "description": "Keywords or phrases, one per line (`\"large language model\"`, `rust`, `postgres`). Leave empty to list everything that matches the tags and filters.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "tags": {
            "title": "Search: content types",
            "type": "array",
            "description": "story / comment / job / poll are alternatives (any of them); ask_hn, show_hn and front_page narrow the result further (all selected must match). Default: stories.",
            "items": {
              "type": "string",
              "enum": [
                "story",
                "comment",
                "ask_hn",
                "show_hn",
                "front_page",
                "job",
                "poll"
              ],
              "enumTitles": [
                "Stories",
                "Comments",
                "Ask HN",
                "Show HN",
                "Ever on the front page",
                "Jobs",
                "Polls"
              ]
            },
            "default": [
              "story"
            ]
          },
          "sortBy": {
            "title": "Search: sort by",
            "enum": [
              "date",
              "relevance"
            ],
            "type": "string",
            "description": "Newest first (can go back through the whole history, any number of results) or relevance (the API returns at most the 1,000 most relevant hits per query).",
            "default": "date"
          },
          "dateFrom": {
            "title": "Search: created on or after (YYYY-MM-DD)",
            "type": "string",
            "description": "Optional start date (UTC)."
          },
          "dateTo": {
            "title": "Search: created on or before (YYYY-MM-DD)",
            "type": "string",
            "description": "Optional end date (UTC, inclusive)."
          },
          "minPoints": {
            "title": "Minimum points",
            "minimum": 0,
            "type": "integer",
            "description": "Only items with at least this many points (stories). Applies to search and lists."
          },
          "minComments": {
            "title": "Minimum comments",
            "minimum": 0,
            "type": "integer",
            "description": "Only stories with at least this many comments. Applies to search and lists."
          },
          "itemIds": {
            "title": "Item IDs or URLs (items mode)",
            "type": "array",
            "description": "Hacker News item IDs (8863) or links (https://news.ycombinator.com/item?id=8863).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeComments": {
            "title": "Include comments of each story",
            "type": "boolean",
            "description": "Adds the comment thread of every story as extra items (type comment, with parentId and storyId). Each comment is billed as one item.",
            "default": false
          },
          "maxCommentsPerStory": {
            "title": "Max comments per story",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap for comments collected per story (top-level comments first, then replies).",
            "default": 100
          },
          "maxItemsPerQuery": {
            "title": "Max items per list / query",
            "minimum": 1,
            "maximum": 10000000,
            "type": "integer",
            "description": "Cap for each list or search query. Leave empty for no per-source cap."
          },
          "maxItems": {
            "title": "Max items in total",
            "minimum": 1,
            "maximum": 10000000,
            "type": "integer",
            "description": "Hard cap for the whole run, comments included. Each item is billed once.",
            "default": 50
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Both Hacker News APIs are open, so no proxy is used by default. If they reject the Actor's IP (HTTP 403/429), it automatically switches to a residential proxy for the rest of the run.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}