{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Scraper — Stories, Comments & Users API",
    "description": "Hacker News scraper & data API. Extract front-page stories, full comment threads, Ask/Show HN, jobs, polls, search results and user profiles: title, score, author, comment count, body text, links, karma — clean JSON/CSV. Fast overview or full detail. No-code, no API key needed.",
    "version": "1.0",
    "x-build-id": "kRnTzk4AZU5dsRwGa"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sian.agency~hacker-news-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sian.agency-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/sian.agency~hacker-news-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sian.agency-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/sian.agency~hacker-news-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sian.agency-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": {
          "scrapeMode": {
            "title": "🧭 Scrape Mode",
            "enum": [
              "overview",
              "detail",
              "user"
            ],
            "type": "string",
            "description": "🧭 **CHOOSE WHAT TO EXTRACT:**\n\n- **Overview** — fast list/search results (title, score, author, comment count, link). Best for trends & monitoring.\n- **Detail** — full items including the body text, parent and the whole comment thread (`kids`). Best for deep analysis.\n- **User** — profiles by username (karma, account age, bio, submission count).\n\n💡 **TIP:** Start with Overview to discover, then run Detail on the IDs you care about.",
            "default": "overview"
          },
          "searchMode": {
            "title": "🔀 Search Mode (optional)",
            "enum": [
              "byList",
              "byQuery",
              "bySearchUrl",
              "byItemUrl",
              "byUser"
            ],
            "type": "string",
            "description": "🔀 **HOW TO FIND ITEMS.** Leave blank to auto-detect from the fields you fill in.\n\n- **byList** — a Hacker News front-page list (set *List* below).\n- **byQuery** — full-text search (set *Search Query*).\n- **bySearchUrl** — paste a `hn.algolia.com` or `news.ycombinator.com` URL.\n- **byItemUrl** — Detail mode: paste explicit item IDs or `item?id=` URLs.\n- **byUser** — User mode: set *Usernames*.",
            "default": "byList"
          },
          "list": {
            "title": "📰 Front-Page List",
            "enum": [
              "top",
              "new",
              "best",
              "ask",
              "show",
              "job"
            ],
            "type": "string",
            "description": "📰 **FRONT-PAGE LIST** (used when Search Mode = By list). Pick which Hacker News list to pull.",
            "default": "top"
          },
          "query": {
            "title": "🔎 Search Query",
            "type": "string",
            "description": "🔎 **FULL-TEXT SEARCH** (used when Search Mode = By query). Any keyword, phrase, product or company name.\n\n💡 **TIP:** Combine with *Tags* below to restrict to stories, comments, Ask HN, etc.",
            "default": ""
          },
          "tags": {
            "title": "🏷️ Search Tags",
            "type": "string",
            "description": "🏷️ **RESTRICT THE SEARCH** by item type (used with *Search Query*).\n\n- `story` · `comment` · `poll` · `job`\n- `ask_hn` · `show_hn` · `front_page`\n\n💡 You can also target one author with `author_<username>`.",
            "default": "story"
          },
          "byDate": {
            "title": "🆕 Sort By Date",
            "type": "boolean",
            "description": "🆕 **SORT BY RECENCY** instead of relevance when searching. Off = most relevant first, On = newest first.",
            "default": false
          },
          "searchUrls": {
            "title": "🔗 Search URLs",
            "uniqueItems": true,
            "type": "array",
            "description": "🔗 **PASTE URLs** (used when Search Mode = By search URL). Each line a `hn.algolia.com` search URL (filters carried through verbatim) or a `news.ycombinator.com` front-page URL.\n\n💡 **BULK EDIT:** Click \"Bulk edit\" to paste many URLs, one per line.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "itemUrls": {
            "title": "🧵 Item IDs or URLs",
            "uniqueItems": true,
            "type": "array",
            "description": "🧵 **EXPLICIT ITEMS** (Detail mode, Search Mode = By item ID/URL). Each line a numeric item ID (e.g. `48649435`) or a full `https://news.ycombinator.com/item?id=...` URL.\n\n💡 **BULK EDIT:** Click \"Bulk edit\" to paste many IDs, one per line.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "usernames": {
            "title": "👤 Usernames",
            "uniqueItems": true,
            "type": "array",
            "description": "👤 **USER PROFILES** (User mode). Each line a Hacker News username (e.g. `pg`) or a `user?id=` URL.\n\n💡 **BULK EDIT:** Click \"Bulk edit\" to paste many usernames, one per line.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "withUser": {
            "title": "👤 Enrich With Author Profile (Detail)",
            "type": "boolean",
            "description": "👤 **AUTHOR ENRICHMENT** (Detail mode). Also fetch each item author's karma, account age and submission count, adding `author_karma`, `author_created` and `author_submitted_count` to the row.\n\n⚙️ Adds one extra request per unique author.",
            "default": false
          },
          "maxResults": {
            "title": "🔢 Max Results",
            "minimum": 1,
            "type": "integer",
            "description": "🔢 **HARD CAP** on the number of items saved this run.\n\n- **FREE users:** up to 25 items per run\n- **PAID users:** unlimited\n\n💡 Lower this to keep runs cheap while testing.",
            "default": 100
          },
          "maxPages": {
            "title": "📄 Max Search Pages",
            "minimum": 1,
            "type": "integer",
            "description": "📄 **SEARCH PAGING** — how many result pages to fetch in query/search-URL modes (each page = *Hits Per Page* items).",
            "default": 2
          },
          "hitsPerPage": {
            "title": "🔢 Hits Per Page",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "🔢 **PAGE SIZE** for search modes (max 1000). Higher = fewer requests for the same number of results.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}