{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Scraper: Search Stories, Comments, Front Page",
    "description": "Search Hacker News stories and comments by keyword, date, points and comment count, read the front page and the top, best, new, ask and show lists, or pull the full comment tree of any story. Official APIs, every record links back to its item on news.ycombinator.com.",
    "version": "0.0",
    "x-build-id": "uAMks32vMm1nRxyCp"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/groundtruth~hacker-news-search/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-groundtruth-hacker-news-search",
        "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/groundtruth~hacker-news-search/runs": {
      "post": {
        "operationId": "runs-sync-groundtruth-hacker-news-search",
        "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/groundtruth~hacker-news-search/run-sync": {
      "post": {
        "operationId": "run-sync-groundtruth-hacker-news-search",
        "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": {
          "mode": {
            "title": "What to fetch",
            "enum": [
              "search",
              "front_page",
              "top",
              "best",
              "new",
              "ask",
              "show",
              "story_comments"
            ],
            "type": "string",
            "description": "search: keyword search over stories and comments. front_page: the 30 stories on the first page right now. top, best, new, ask, show: the official lists in rank order. story_comments: the full comment tree of the stories you name in Story IDs.",
            "default": "search"
          },
          "query": {
            "title": "Search words",
            "type": "string",
            "description": "Used in search mode. Leave empty to match everything (combine with minimum points or dates). Put a phrase in double quotes to match it exactly, and a minus sign before a word to exclude it. Up to 500 characters.",
            "default": "web scraping"
          },
          "content_type": {
            "title": "Search in",
            "enum": [
              "stories",
              "comments",
              "both"
            ],
            "type": "string",
            "description": "Search mode only. Stories, comments, or both. With both, stories fill up to half of Maximum items and comments take the rest.",
            "default": "stories"
          },
          "sort_by": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "date"
            ],
            "type": "string",
            "description": "Search mode only. Relevance returns at most 1,000 results per run. Date (newest first) can return up to 10,000.",
            "default": "relevance"
          },
          "search_in": {
            "title": "Match the words against",
            "enum": [
              "all",
              "title",
              "url",
              "text"
            ],
            "type": "string",
            "description": "Search mode only. Everything (title, link, text), only titles, only the submitted link (for example github.com to find everything submitted from that site), or only post and comment text.",
            "default": "all"
          },
          "story_tag": {
            "title": "Kind of story",
            "enum": [
              "any",
              "show_hn",
              "ask_hn",
              "poll"
            ],
            "type": "string",
            "description": "Narrow stories to Show HN posts, Ask HN posts or polls. Applies to stories in search mode and to the list modes.",
            "default": "any"
          },
          "date_from": {
            "title": "From date",
            "type": "string",
            "description": "Only items created on or after this day (UTC), written YYYY-MM-DD."
          },
          "date_to": {
            "title": "To date",
            "type": "string",
            "description": "Only items created on or before this day (UTC), written YYYY-MM-DD. The whole day is included."
          },
          "min_points": {
            "title": "Minimum points",
            "minimum": 0,
            "type": "integer",
            "description": "Only stories with at least this many points. Does not apply to comments, which have no public points."
          },
          "min_comments": {
            "title": "Minimum comments",
            "minimum": 0,
            "type": "integer",
            "description": "Only stories with at least this many comments."
          },
          "max_items": {
            "title": "Maximum items",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "The most records this run returns, and the most you can be charged for. Raise it to read whole threads. Up to 10,000.",
            "default": 25
          },
          "story_ids": {
            "title": "Story IDs or links",
            "type": "array",
            "description": "For story_comments mode. Item numbers such as 8863, or links such as https://news.ycombinator.com/item?id=8863. Up to 200.",
            "items": {
              "type": "string"
            }
          },
          "include_story": {
            "title": "Include the story itself",
            "type": "boolean",
            "description": "For story_comments mode. Adds the story as the first record of each thread. It counts as one item.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}