{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Scraper: Stories, Comments, Search & Alerts",
    "description": "Hacker News front page, new, best, Ask HN, Show HN and job lists, or keyword search with date, points and comment filters. Optional comments, flattened with depth. Schedule it with \"Only new items\" for brand and topic alerts. Official HN and Algolia APIs. USD 0.50 per 1,000 stories.",
    "version": "1.0",
    "x-build-id": "O0gZucc6t7N49cymR"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jtpalms~hacker-news/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jtpalms-hacker-news",
        "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/jtpalms~hacker-news/runs": {
      "post": {
        "operationId": "runs-sync-jtpalms-hacker-news",
        "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/jtpalms~hacker-news/run-sync": {
      "post": {
        "operationId": "run-sync-jtpalms-hacker-news",
        "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 get",
            "enum": [
              "lists",
              "search"
            ],
            "type": "string",
            "description": "Lists: the stories on Hacker News lists right now (front page, newest, best, Ask HN, Show HN, jobs), in the order HN shows them. Search: stories or comments matching keywords, with date, points and comment filters, from the whole HN archive.",
            "default": "lists"
          },
          "lists": {
            "title": "Lists",
            "type": "array",
            "description": "Used with \"Lists\". Top is the front page ranking (up to 500 stories), New the newest submissions (500), Best the highest-voted recent stories (200), plus Ask HN, Show HN and Jobs.",
            "items": {
              "type": "string",
              "enum": [
                "top",
                "new",
                "best",
                "ask",
                "show",
                "job"
              ],
              "enumTitles": [
                "Top (front page)",
                "New",
                "Best",
                "Ask HN",
                "Show HN",
                "Jobs"
              ]
            },
            "default": [
              "top"
            ]
          },
          "searchQueries": {
            "title": "Search keywords",
            "type": "array",
            "description": "Used with \"Keyword search\". One search per line, for example your brand, a product or a topic. Put a phrase in quotes for an exact match (\"open source\"). Each line is searched and monitored on its own. Leave empty to match everything that passes the other filters.",
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "Search in",
            "enum": [
              "story",
              "comment",
              "all",
              "ask_hn",
              "show_hn",
              "launch_hn",
              "front_page",
              "job",
              "poll"
            ],
            "type": "string",
            "description": "Used with \"Keyword search\". Which items to search: stories, comments, or both, or only Ask HN (which also covers Tell HN and other text posts), Show HN, Launch HN, jobs, polls, or the stories on the front page right now.",
            "default": "story"
          },
          "sortBy": {
            "title": "Sort search results by",
            "enum": [
              "date",
              "relevance"
            ],
            "type": "string",
            "description": "Used with \"Keyword search\". Newest first can read any number of results; relevance (best match, then points) stops at 1,000 results per keyword. With \"Only new items\" the search always runs newest first.",
            "default": "date"
          },
          "dateFrom": {
            "title": "Posted after",
            "type": "string",
            "description": "Optional. Only items posted on or after this date. A date like 2026-09-01, or a relative value like \"7 days\" or \"24 hours\" (counted back from the start of each run)."
          },
          "dateTo": {
            "title": "Posted before",
            "type": "string",
            "description": "Optional. Only items posted on or before this date (the whole day is included), or a relative value like \"1 day\"."
          },
          "minPoints": {
            "title": "Minimum points",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Only stories with at least this many points (upvotes). Does not apply to comments, because Hacker News does not publish comment scores."
          },
          "minComments": {
            "title": "Minimum comments",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Only stories with at least this many comments."
          },
          "keywords": {
            "title": "Must contain (any of)",
            "type": "array",
            "description": "Optional extra filter on the title, text and link. Whole words, not case-sensitive: \"AI\" does not match \"said\". End a word with * for any ending (\"startup*\"), or write /pattern/ for a regular expression. Useful with Lists, for example front page stories that mention your field.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max stories per list or keyword",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "At most this many results per list or per search keyword in each run, not counting comments. With \"Only new items\", new results beyond this number are kept for the next run.",
            "default": 100
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Add each story's comments, in the order Hacker News ranks them, as separate rows right after the story. Every comment row has the story ID, parent ID, depth and plain text. Comments are billed per comment.",
            "default": false
          },
          "maxCommentDepth": {
            "title": "Comment depth",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How deep into reply threads to go. 1 is only top-level comments, 2 adds their direct replies, and so on.",
            "default": 2
          },
          "maxCommentsPerStory": {
            "title": "Max comments per story",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "At most this many comments per story. Top-level comments are taken first, in HN's ranking, then replies, so a low number gives you the best comments.",
            "default": 30
          },
          "onlyNew": {
            "title": "Only new items",
            "type": "boolean",
            "description": "Remember what earlier runs returned and output only stories or comments not seen before. Schedule the actor (every hour, every morning) to use it as an alert: runs with nothing new output nothing and cost nothing. The memory is kept in your \"hacker-news-monitor\" key-value store.",
            "default": false
          },
          "firstRunOutput": {
            "title": "First run with \"Only new items\"",
            "enum": [
              "all",
              "none"
            ],
            "type": "string",
            "description": "What the first monitor run outputs. All: what matches now (up to the maximum; for searches without \"Posted after\", the last 7 days). None: nothing; it only records what is there now, so you get only items that appear after today.",
            "default": "all"
          },
          "monitorId": {
            "title": "Monitor name",
            "type": "string",
            "description": "Optional. Keeps a separate memory of seen items. Use a different name for each schedule that watches the same list or keyword with different filters, so they do not share what counts as new."
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "How many API requests to run at the same time. The default is fast and polite.",
            "default": 10
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. Only needed if the search API answers HTTP 429 (too many requests from a shared IP address)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}