{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Story, Comment & Karma Scraper",
    "description": "Pull Hacker News front-page, newest, best, Ask HN, Show HN, or job stories, look up specific items or user profiles, or run a full-text search across HN history. Filter by score, domain, date range, and comment count or author.",
    "version": "2.0",
    "x-build-id": "ajANmalEbfWPogs9n"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dataspryva~hacker-news-story-comment-and-karma-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dataspryva-hacker-news-story-comment-and-karma-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/dataspryva~hacker-news-story-comment-and-karma-scraper/runs": {
      "post": {
        "operationId": "runs-sync-dataspryva-hacker-news-story-comment-and-karma-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/dataspryva~hacker-news-story-comment-and-karma-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-dataspryva-hacker-news-story-comment-and-karma-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "topStories",
              "newStories",
              "bestStories",
              "askStories",
              "showStories",
              "jobStories",
              "item",
              "user",
              "search",
              "frontPage",
              "whoIsHiring"
            ],
            "type": "string",
            "description": "What to scrape. Feeds walk the live Hacker News lists. `item` looks up specific IDs, `user` loads profiles, `search` queries Hacker News history, `frontPage` reads a historical day, and `whoIsHiring` parses monthly hiring threads.",
            "default": "topStories"
          },
          "itemIds": {
            "title": "Item IDs (mode=item)",
            "type": "array",
            "description": "Hacker News item IDs to look up, as numbers or numeric strings. Stories, comments, jobs, polls, and poll options are all accepted.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "usernames": {
            "title": "Usernames (mode=user)",
            "type": "array",
            "description": "Hacker News usernames whose profiles and, optionally, submissions you want.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search queries (mode=search)",
            "type": "array",
            "description": "One or more keyword queries. Every query runs independently and the results are merged without duplicates. Leave empty to browse by tags, author, or story instead.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchSort": {
            "title": "Search order",
            "enum": [
              "relevance",
              "date"
            ],
            "type": "string",
            "description": "`relevance` ranks by keyword match. `date` returns newest first and is more reproducible.",
            "default": "relevance"
          },
          "contentTypes": {
            "title": "Search content types",
            "type": "array",
            "description": "Which Hacker News record types search should return. Selecting several types returns any of them. `front_page` covers only the current front page.",
            "items": {
              "type": "string",
              "enum": [
                "story",
                "comment",
                "poll",
                "pollopt",
                "job",
                "show_hn",
                "ask_hn",
                "front_page"
              ],
              "enumTitles": [
                "Stories",
                "Comments",
                "Polls",
                "Poll options",
                "Jobs",
                "Show HN",
                "Ask HN",
                "Current front page"
              ]
            },
            "default": [
              "story"
            ]
          },
          "author": {
            "title": "Author (mode=search)",
            "type": "string",
            "description": "Only return content written by this Hacker News username."
          },
          "storyId": {
            "title": "Story ID (mode=search)",
            "type": "string",
            "description": "Only return content attached to this story ID. Useful with `contentTypes` set to `comment` to search inside one thread."
          },
          "exhaustiveSearch": {
            "title": "Search past 1,000 results",
            "type": "boolean",
            "description": "Hacker News search exposes at most 1,000 hits per query. When enabled, the actor splits the requested date range into smaller windows so deeper result sets can be collected. Relevance order then follows each date window rather than one global ranking.",
            "default": false
          },
          "dateRangeFrom": {
            "title": "Date range from",
            "type": "string",
            "description": "Drop items posted before this date (UTC, `YYYY-MM-DD`). Empty means no lower bound."
          },
          "dateRangeTo": {
            "title": "Date range to",
            "type": "string",
            "description": "Drop items posted after this date (UTC, `YYYY-MM-DD`). Empty means no upper bound."
          },
          "minScore": {
            "title": "Minimum points",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Drop stories, jobs, and polls below this point score. Comments are unaffected because Hacker News does not publish comment scores."
          },
          "minCommentCount": {
            "title": "Minimum comment count",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Drop stories and polls with fewer than this many comments."
          },
          "domainAllowlist": {
            "title": "Domain allowlist",
            "type": "array",
            "description": "Keep only stories whose link host contains one of these text fragments. For example, `github.com` or `arxiv.org`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "domainBlocklist": {
            "title": "Domain blocklist",
            "type": "array",
            "description": "Drop stories whose link host contains one of these text fragments. For example, `twitter.com` or `x.com`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeDeadOrDeleted": {
            "title": "Exclude dead or deleted content",
            "type": "boolean",
            "description": "Drop items marked dead or deleted by Hacker News. Turning this off uses the slower exact comment path so those records can be included.",
            "default": true
          },
          "commentAuthorFilter": {
            "title": "Comment author filter",
            "type": "array",
            "description": "Only keep comments written by these usernames. Matching is case-insensitive and accepts partial names.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "commentSort": {
            "title": "Comment order",
            "enum": [
              "rank",
              "newest"
            ],
            "type": "string",
            "description": "`rank` keeps Hacker News display order. `newest` orders sibling replies newest first.",
            "default": "rank"
          },
          "maxComments": {
            "title": "Comments per story",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "How many comments to collect for each story. 0 skips comment collection. This is applied after a story passes your filters.",
            "default": 0
          },
          "maxDepth": {
            "title": "Maximum reply depth",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Deepest reply level to keep when comments are collected. Root comments are depth 0.",
            "default": 5
          },
          "enableCommentHierarchy": {
            "title": "Nest comment replies",
            "type": "boolean",
            "description": "When true, each story carries a nested `comments` tree. When false, comments are separate rows and never contain duplicate reply rows.",
            "default": false
          },
          "includeSubmissions": {
            "title": "Include user submissions",
            "type": "boolean",
            "description": "For mode `user`, also emit the user's recent stories and comments as normal records after the profile.",
            "default": false
          },
          "submissionTypes": {
            "title": "User submission types",
            "enum": [
              "all",
              "story",
              "comment"
            ],
            "type": "string",
            "description": "Which submissions to emit when `includeSubmissions` is enabled.",
            "default": "all"
          },
          "frontPageDate": {
            "title": "Front page date",
            "type": "string",
            "description": "Historical day to read in mode `frontPage`, as `YYYY-MM-DD`. Empty uses yesterday (UTC)."
          },
          "hiringMonths": {
            "title": "Hiring months",
            "minimum": 1,
            "maximum": 12,
            "type": "integer",
            "description": "How many recent monthly Who is hiring? threads to parse. Ignored when specific thread IDs are supplied.",
            "default": 1
          },
          "hiringThreadIds": {
            "title": "Hiring thread IDs",
            "type": "array",
            "description": "Specific Who is hiring? thread IDs to parse. Overrides the automatic monthly selection.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "hiringKeywords": {
            "title": "Hiring keywords",
            "type": "array",
            "description": "Keep only job posts whose text, company, role, location, or tech stack contains one of these terms.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "remoteOnly": {
            "title": "Remote jobs only",
            "type": "boolean",
            "description": "Keep only hiring posts that explicitly mention remote work.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum records",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Hard cap on emitted records across all types. Nested comments also count toward this cap.",
            "default": 50
          },
          "includeAuthorProfiles": {
            "title": "Add author karma",
            "type": "boolean",
            "description": "Add `authorKarma` and `authorCreatedAt` to stories and comments. This costs one extra lookup per unique author.",
            "default": false
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Hacker News links to read directly: item, user, historical front-page, and hiring-thread URLs. IDs and URLs are merged with the mode-specific lists.",
            "default": [],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}