{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Scraper - Search, Comments & Front Page",
    "description": "Search Hacker News stories and comments by keyword, author, points and date range with no 1000-result cap, pull the live top/new/best/Ask/Show/Jobs lists, or fetch items with their full comment trees. Clean plain-text fields. Official public APIs, no proxy.",
    "version": "0.1",
    "x-build-id": "I627XAiMCO2ihjaNN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/conversational_kermis~hacker-news-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-conversational_kermis-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/conversational_kermis~hacker-news-scraper/runs": {
      "post": {
        "operationId": "runs-sync-conversational_kermis-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/conversational_kermis~hacker-news-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-conversational_kermis-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": "What to scrape",
            "enum": [
              "search",
              "list",
              "items"
            ],
            "type": "string",
            "description": "Search: keyword/author/date search over all of Hacker News (fill in the Search section). Live list: the current Top, New, Best, Ask, Show or Jobs list. Specific items: the stories or comments whose ids or URLs you paste.",
            "default": "search"
          },
          "query": {
            "title": "Search query",
            "type": "string",
            "description": "Keywords, as you would type them into hn.algolia.com. Leave empty to match everything (useful with Type, Author or a date range). Matching is prefix-based, so \"llm\" also matches \"LLMs\"."
          },
          "type": {
            "title": "Type",
            "enum": [
              "story",
              "comment",
              "ask_hn",
              "show_hn",
              "launch_hn",
              "poll",
              "job",
              "all"
            ],
            "type": "string",
            "description": "Which kind of item to return. Ask HN, Show HN and Launch HN are stories. With Comments, every comment is its own row.",
            "default": "story"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "date"
            ],
            "type": "string",
            "description": "Relevance ranks by text match and popularity (points, comments). Date returns newest first. Past the first 1000 results a relevance search continues newest first.",
            "default": "relevance"
          },
          "author": {
            "title": "Author",
            "type": "string",
            "description": "Optional. Only items posted by this HN username (case-sensitive, as shown on the site)."
          },
          "storyId": {
            "title": "Within story",
            "type": "string",
            "description": "Optional. Only items belonging to this story: an id or a news.ycombinator.com/item?id= URL. With Type = Comments and a query, this searches inside one thread (for example \"remote\" inside a Who is hiring thread)."
          },
          "minPoints": {
            "title": "Minimum points",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Only stories with at least this many points. Ignored for comments (HN does not expose comment points)."
          },
          "minComments": {
            "title": "Minimum comments",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Only stories with at least this many comments. Ignored for comments."
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "Optional. Earliest post date (YYYY-MM-DD, UTC), inclusive."
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "Optional. Latest post date (YYYY-MM-DD, UTC), inclusive."
          },
          "listType": {
            "title": "List",
            "enum": [
              "topstories",
              "newstories",
              "beststories",
              "askstories",
              "showstories",
              "jobstories"
            ],
            "type": "string",
            "description": "Used when What to scrape = Live list. Items come in the list's own order (front-page rank for Top) with live points and comment counts. Top, New and Best hold up to 500 stories; Ask, Show and Jobs up to 200.",
            "default": "topstories"
          },
          "itemIds": {
            "title": "Item ids or URLs",
            "type": "array",
            "description": "Used when What to scrape = Specific items. HN item ids (\"8863\") or URLs (\"https://news.ycombinator.com/item?id=8863\"), one per line. Stories, comments, polls and jobs all work.",
            "items": {
              "type": "string"
            }
          },
          "includeComments": {
            "title": "Include comment threads",
            "type": "boolean",
            "description": "Add the full comment tree to each story row as a flat `comments` list (author, plain text, time, parentId, depth) plus `commentCount`. Still one row (one charge) per story. One extra request per story, so large runs take longer.",
            "default": false
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum rows to return in total. Searches go past Algolia's 1000-result cap automatically by walking back in time. 0 = no limit (a broad search can return millions of rows, so set a budget).",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}