{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Scraper: Stories, Comments, Search, Jobs",
    "description": "Scrape Hacker News: the live front page, newest, best, Ask HN, Show HN and jobs lists, keyword search with dates and minimum points, full comment threads, any user's submissions and the monthly Who is hiring thread. One item per story or comment with points, comments, author, date and plain text.",
    "version": "1.0",
    "x-build-id": "lrgY38ZECTupun1en"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fernandosord~hacker-news-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fernandosord-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/fernandosord~hacker-news-scraper/runs": {
      "post": {
        "operationId": "runs-sync-fernandosord-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/fernandosord~hacker-news-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-fernandosord-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": [
              "front",
              "new",
              "best",
              "ask",
              "show",
              "jobs",
              "search",
              "comments",
              "user",
              "hiring"
            ],
            "type": "string",
            "description": "A live list (front page, newest, best, Ask HN, Show HN, jobs), a keyword search over all of Hacker News, the comments of given stories, the submissions of given users, or a monthly Who is hiring thread.",
            "default": "front"
          },
          "query": {
            "title": "Search query",
            "type": "string",
            "description": "Search mode: keywords to find in titles, URLs, story text and comments. User mode: only keep that user's items matching these words. Who is hiring mode: only keep job posts that contain all of these words (for example: rust remote)."
          },
          "contentType": {
            "title": "Content type (search and user modes)",
            "enum": [
              "story",
              "comment",
              "all",
              "ask_hn",
              "show_hn",
              "job",
              "poll",
              "front_page"
            ],
            "type": "string",
            "description": "What to return in Search and User modes.",
            "default": "story"
          },
          "searchSort": {
            "title": "Search order",
            "enum": [
              "relevance",
              "date"
            ],
            "type": "string",
            "description": "Relevance ranks by match quality and points, at most 1,000 results per search. Date returns newest first and can go past 1,000 results.",
            "default": "relevance"
          },
          "storyIds": {
            "title": "Story IDs or URLs (comments mode)",
            "type": "array",
            "description": "Story IDs (8863) or links (https://news.ycombinator.com/item?id=8863). The Actor returns every comment, nested replies included, up to Max comments per story.",
            "items": {
              "type": "string"
            }
          },
          "usernames": {
            "title": "Usernames (user mode)",
            "type": "array",
            "description": "Hacker News usernames (pg, dang) or profile links (https://news.ycombinator.com/user?id=pg). Usernames are case-sensitive. Newest submissions first.",
            "items": {
              "type": "string"
            }
          },
          "hiringMonth": {
            "title": "Month (Who is hiring mode)",
            "type": "string",
            "description": "latest for the current thread, or a month such as 2026-10 or October 2026.",
            "default": "latest"
          },
          "hiringThread": {
            "title": "Thread (Who is hiring mode)",
            "enum": [
              "hiring",
              "wants_to_be_hired",
              "freelancer"
            ],
            "type": "string",
            "description": "Which of the monthly threads to read. Each top-level comment becomes one item. The Freelancer thread ran until October 2025.",
            "default": "hiring"
          },
          "dateFrom": {
            "title": "From date",
            "type": "string",
            "description": "Optional. Only items posted on or after this date (2026-01-31) or within a relative period (7 days, 3 months)."
          },
          "dateTo": {
            "title": "To date",
            "type": "string",
            "description": "Optional. Only items posted on or before this date. A bare date includes the whole day (UTC)."
          },
          "minPoints": {
            "title": "Minimum points",
            "minimum": 0,
            "type": "integer",
            "description": "Skip stories with fewer points. Comments have no public points and are not affected.",
            "default": 0
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "Stories per live list or search, items per user in user mode, job posts in Who is hiring mode. Comments mode uses Max comments per story instead, and comments added with Include comments do not count here. 0 means no cap.",
            "default": 100
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "List, search and user modes: after each story, add its comments as separate items (one extra request per story). Every comment is an item.",
            "default": false
          },
          "maxCommentsPerStory": {
            "title": "Max comments per story",
            "minimum": 1,
            "type": "integer",
            "description": "Cap on comments saved for each story, nested replies included, in comments mode and with Include comments. Top-level comments follow Hacker News's own ranking, replies are in time order.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}