{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Data Scraper",
    "description": "Scrape Hacker News stories by keyword, front page, Ask HN, Show HN, jobs, user or story link. Get points, comments, authors, dates, domains, trend rows and comment threads. Export JSON, CSV or Excel, and schedule runs.",
    "version": "0.1",
    "x-build-id": "PiyPjICphbmfE6UgA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawl_craft~hacker-news-data-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawl_craft-hacker-news-data-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/crawl_craft~hacker-news-data-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawl_craft-hacker-news-data-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/crawl_craft~hacker-news-data-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawl_craft-hacker-news-data-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": [
          "queries"
        ],
        "properties": {
          "queries": {
            "title": "🔎 Keywords, sections, users or story links",
            "type": "array",
            "description": "One entry per line, mixed freely. A keyword (python), a section (FRONTPAGE, NEWEST, ASK, SHOW, JOBS, BEST), a user (user:pg or @pg or a profile link) or a story (an ID like 8863 or a news.ycombinator.com item link). Each entry is collected on its own up to the limit below.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "🔢 Max stories per input",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum stories collected for each entry. 20 is a quick test; raise it for more. Search by relevance stops at about 1,000 per keyword; sort by date goes further.",
            "default": 20
          },
          "sort": {
            "title": "🔃 Sort keyword search",
            "enum": [
              "relevance",
              "date"
            ],
            "type": "string",
            "description": "How keyword searches are ordered. Sections, users and story links keep their own order.",
            "default": "relevance"
          },
          "dateRange": {
            "title": "📅 Time window",
            "enum": [
              "all",
              "1d",
              "7d",
              "30d",
              "90d",
              "6m",
              "1y",
              "2y"
            ],
            "type": "string",
            "description": "Only stories from this period (keyword, user and trend entries). Overridden by the exact dates below.",
            "default": "all"
          },
          "maxCommentsPerStory": {
            "title": "💬 Max comments per story",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Comments added to each story as a threaded list. 0 skips comments and saves time. Also fills the text of Ask HN and Show HN posts.",
            "default": 0
          },
          "resultType": {
            "title": "📊 Result type",
            "enum": [
              "stories",
              "trends"
            ],
            "type": "string",
            "description": "Stories gives one row per story. Trends gives one summary row per keyword: story count, points, comments, top domains and a trend score (default window 7 days).",
            "default": "stories"
          },
          "minPoints": {
            "title": "⭐ Minimum points",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Only stories with at least this many points. 0 means no filter. Not applied to story links.",
            "default": 0
          },
          "minComments": {
            "title": "🗣️ Minimum comments",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Only stories with at least this many comments. 0 means no filter. Not applied to story links.",
            "default": 0
          },
          "commentDepth": {
            "title": "🌳 Comment reply levels",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "How deep to read comment threads: 0 = every level, 1 = top-level comments only, 2 = top-level plus direct replies.",
            "default": 0
          },
          "commentSort": {
            "title": "↕️ Comment order",
            "enum": [
              "rank",
              "newest"
            ],
            "type": "string",
            "description": "Which comments are kept when you set a comment limit.",
            "default": "rank"
          },
          "dateFrom": {
            "title": "🗓️ From date",
            "type": "string",
            "description": "Only stories on or after this day (YYYY-MM-DD). Replaces the time window."
          },
          "dateTo": {
            "title": "🏁 To date",
            "type": "string",
            "description": "Only stories on or before this day (YYYY-MM-DD). Replaces the time window."
          },
          "fetchArticleText": {
            "title": "📰 Add article description",
            "type": "boolean",
            "description": "For link stories, add a short description of the linked article to the text field. Turn off for the fastest run.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy configuration",
            "type": "object",
            "description": "Optional. Leave off to use the default.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}