{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Data",
    "description": "Pull stories, comments, and other items from Hacker News in two flexible ways: browse the live front-page-style category lists (Top, New, Best, Ask, Show, Jobs), or scan every item posted within a specific date and time range. Optionally fetch nested comment threads several levels deep.",
    "version": "1.0",
    "x-build-id": "rqPqJejIMPxTTi0cv"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/onescales~hacker-news-data/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-onescales-hacker-news-data",
        "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/onescales~hacker-news-data/runs": {
      "post": {
        "operationId": "runs-sync-onescales-hacker-news-data",
        "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/onescales~hacker-news-data/run-sync": {
      "post": {
        "operationId": "run-sync-onescales-hacker-news-data",
        "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": {
          "category": {
            "title": "Category [Category mode]",
            "enum": [
              "top",
              "new",
              "best",
              "ask",
              "show",
              "job"
            ],
            "type": "string",
            "description": "Which Hacker News list to pull stories from: Top, New, Best, Ask HN, Show HN, or Jobs. Only used when 'Date to scan' is left empty (Category mode). Ignored in Date mode.",
            "default": "top"
          },
          "date": {
            "title": "Date to scan [Date mode]",
            "type": "string",
            "description": "A single calendar day to scan, in YYYY-MM-DD format (e.g. 2026-07-01), based on UTC time. Filling this in switches the run to Date mode, which ignores 'Category' and instead scans every story, job posting, and poll from that day. Comments aren't returned as their own rows, but comment threads are still included on each item via 'Reply depth' below. Busy days can have more items than fit in one run — check 'range_complete' in the output, and if it's false, use 'Page token' on a follow-up run to continue scanning the same day."
          },
          "limit": {
            "title": "Limit",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "The maximum number of stories or items to return in this run. Works the same way in both Category mode and Date mode. Default is 30, maximum is 200.",
            "default": 30
          },
          "comment_limit": {
            "title": "Comments per story [Category mode]",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "How many top-level comments to fetch and embed inside each story. Set to 0 to skip comments entirely and only get story details. Default is 10, maximum is 100. Only applies in Category mode — in Date mode, comment threading is controlled separately below.",
            "default": 10
          },
          "reply_depth": {
            "title": "Reply depth",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "How many levels of replies to fetch underneath each comment. 0 means top-level comments only, no replies (default and fastest). 1 adds direct replies, 2 adds another level below that, and so on. Works in both Category mode and Date mode. Higher values mean much longer run times on busy threads, so start low (1-2) unless you specifically need deep conversations. Maximum is 5.",
            "default": 5
          },
          "replies_per_comment": {
            "title": "Replies per comment",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "The maximum number of replies to fetch at each level, per comment. Only matters if 'Reply depth' is above 0. For example, if a comment has 50 replies but this is set to 5, only the first 5 are fetched at that level. Default is 5, maximum is 20.",
            "default": 5
          },
          "page_token": {
            "title": "Page token [Date mode]",
            "type": "integer",
            "description": "Used to continue a previous Date mode run that didn't finish scanning the full day (check 'range_complete' in that run's output). Copy the 'next_page_token' value from that run's output here to pick up where it left off. Leave empty on your first run for a given day. Has no effect in Category mode."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}