{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Threads & Who is Hiring Exporter",
    "description": "Hacker News exporter using the official Firebase and Algolia APIs: front/new/best/ask/show/jobs lists, search, full story threads as Markdown, and Who-is-Hiring threads parsed into structured jobs (company, role, location, remote, salary hints). Pay per story or job.",
    "version": "0.2",
    "x-build-id": "aRQSdVlT4wmF6hdF5"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/vellumlabs~hn-threads-and-hiring/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-vellumlabs-hn-threads-and-hiring",
        "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/vellumlabs~hn-threads-and-hiring/runs": {
      "post": {
        "operationId": "runs-sync-vellumlabs-hn-threads-and-hiring",
        "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/vellumlabs~hn-threads-and-hiring/run-sync": {
      "post": {
        "operationId": "run-sync-vellumlabs-hn-threads-and-hiring",
        "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": [
              "front",
              "new",
              "best",
              "ask",
              "show",
              "jobs",
              "search",
              "who-is-hiring",
              "story"
            ],
            "type": "string",
            "description": "What to export. `front`/`new`/`best`/`ask`/`show`/`jobs` read the official Firebase lists; `search` uses Algolia HN Search with **Query**; `story` exports the stories in **Story IDs**; `who-is-hiring` finds the latest 'Ask HN: Who is hiring?' thread (or the ones in **Story IDs**) and parses every job post.",
            "default": "front"
          },
          "query": {
            "title": "Query",
            "type": "string",
            "description": "Keyword query for `search` mode (Algolia syntax, e.g. `rust async`, `\"local-first\"`). Ignored in other modes.",
            "default": ""
          },
          "searchSort": {
            "title": "Search sort",
            "enum": [
              "date",
              "relevance"
            ],
            "type": "string",
            "description": "`date` returns the newest matching stories first (Algolia `search_by_date`); `relevance` uses Algolia ranking (points, comments, recency).",
            "default": "date"
          },
          "storyIds": {
            "title": "Story IDs",
            "type": "array",
            "description": "HN item IDs or item URLs (e.g. `49522897` or `https://news.ycombinator.com/item?id=49522897`) for `story` and `who-is-hiring` modes. Leave empty in `who-is-hiring` mode to use the newest thread automatically.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on dataset items per run: stories in story modes, parsed job posts in `who-is-hiring`. Each stored item is one billing event (`story-exported` or `job-parsed`), so this also caps your cost.",
            "default": 100
          },
          "sinceDays": {
            "title": "Only items from the last N days",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "`0` = no date filter. In list modes stories older than this are skipped; in `search` mode it becomes an Algolia `created_at_i` filter; in `who-is-hiring` mode it selects all hiring threads posted in the window (default: newest thread only).",
            "default": 0
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Fetch each story's comment tree (one Algolia request per story) and store the comments flattened with their depth, plus the whole thread rendered as Markdown.",
            "default": true
          },
          "maxCommentDepth": {
            "title": "Max comment depth",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "Deepest reply level kept. `0` = top-level comments only, `1` = replies to them, and so on.",
            "default": 3
          },
          "maxCommentsPerStory": {
            "title": "Max comments per story",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Cap on comments stored per story (depth-first order, so parents come before their replies).",
            "default": 200
          },
          "maxConcurrency": {
            "title": "Max concurrent API requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Parallel requests against the HN APIs. Algolia allows 10,000 requests per hour per IP; the Actor also backs off automatically on HTTP 429.",
            "default": 5
          },
          "stateKey": {
            "title": "Watch mode: state key (only new items since the last run)",
            "type": "string",
            "description": "Name of a key-value store that remembers every story / job post already exported, e.g. `hn-hiring-watch`. With a state key, each run returns and bills **only items that no previous run with the same key exported**, so a daily schedule on `who-is-hiring` gives you just the new job posts, and on `front` or `search` just the new stories. After the first run, `who-is-hiring` also re-checks last month's thread. Leave empty for a normal one-off export. Use a different key per schedule / per filter set.",
            "default": ""
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}