{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Search & Threads: Stories, Comments & Users",
    "description": "Search Hacker News stories, comments and users, fetch a story's full comment tree, or read the front page, from the official free Algolia HN API. Filter by query, tag, date range, points and author. Flat rows out, one per story or comment. Free on errors.",
    "version": "0.1",
    "x-build-id": "BpPy87n1eHIOnKg9F"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/data-done-right~hacker-news-search/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-data-done-right-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/data-done-right~hacker-news-search/runs": {
      "post": {
        "operationId": "runs-sync-data-done-right-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/data-done-right~hacker-news-search/run-sync": {
      "post": {
        "operationId": "run-sync-data-done-right-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "What to fetch",
            "enum": [
              "search",
              "comments",
              "user",
              "frontPage"
            ],
            "type": "string",
            "description": "search = keyword/tag/date search. comments = every comment of the stories in 'Story IDs or links'. user = profiles of the names in 'Usernames'. frontPage = stories currently on the front page. Default: search.",
            "default": "search"
          },
          "query": {
            "title": "Search query",
            "type": "string",
            "description": "Words to search for in stories or comments (search mode). Example: apify scraping. Leave empty if you filter by author or dates only."
          },
          "contentType": {
            "title": "Content type",
            "enum": [
              "stories",
              "comments",
              "ask_hn",
              "show_hn",
              "jobs",
              "polls",
              "all"
            ],
            "type": "string",
            "description": "What to search in (search mode). Default: stories.",
            "default": "stories"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "date"
            ],
            "type": "string",
            "description": "relevance returns at most the best 1000 hits. Newest first can read further back than 1000 rows by moving through time. Default: relevance.",
            "default": "relevance"
          },
          "dateFrom": {
            "title": "From date",
            "type": "string",
            "description": "Only items created on or after this UTC day. Format YYYY-MM-DD, example 2026-01-01."
          },
          "dateTo": {
            "title": "To date",
            "type": "string",
            "description": "Only items created on or before this UTC day (inclusive). Format YYYY-MM-DD, example 2026-01-31."
          },
          "author": {
            "title": "Author",
            "type": "string",
            "description": "Only items posted by this Hacker News user. Example: pg. 2-15 letters, digits, _ or -."
          },
          "inStoryId": {
            "title": "Only inside this story",
            "type": "string",
            "description": "Restrict the search to one story's thread: a story id or link. Example: 8863 or https://news.ycombinator.com/item?id=8863. Best with content type Comments."
          },
          "minPoints": {
            "title": "Minimum points",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Keep only items with at least this many points (stories and jobs have points, comments do not). Example: 100. Default 0 = no filter.",
            "default": 0
          },
          "minComments": {
            "title": "Minimum comments",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Keep only stories with at least this many comments. Example: 50. Default 0 = no filter.",
            "default": 0
          },
          "storyIds": {
            "title": "Story IDs or links",
            "type": "array",
            "description": "For mode 'comments': one story id or link per line. Example: 8863 or https://news.ycombinator.com/item?id=8863. The full tree is read in one API request per story.",
            "items": {
              "type": "string"
            }
          },
          "maxDepth": {
            "title": "Maximum comment depth",
            "minimum": 0,
            "maximum": 200,
            "type": "integer",
            "description": "Comment trees only: keep comments down to this nesting level (1 = top-level comments only). Default 0 = whole tree.",
            "default": 0
          },
          "includeStoryRow": {
            "title": "Include the story row",
            "type": "boolean",
            "description": "Comment trees only: add one row for the story itself before its comments. Default: on.",
            "default": true
          },
          "usernames": {
            "title": "Usernames",
            "type": "array",
            "description": "For mode 'user': one Hacker News user name per line. Example: pg. Gives karma and the 'about' text. Unknown names are listed in FAILED and are free.",
            "items": {
              "type": "string"
            }
          },
          "plainText": {
            "title": "Convert text to plain text",
            "type": "boolean",
            "description": "Hacker News stores comments as HTML. On = readable plain text (links keep their full address); off = the original HTML. Default: on.",
            "default": true
          },
          "maxItems": {
            "title": "Maximum rows",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Most rows delivered (and charged) in this run. Example: 500. Default 100.",
            "default": 100
          },
          "maxRequests": {
            "title": "Maximum API requests",
            "minimum": 1,
            "maximum": 9000,
            "type": "integer",
            "description": "Safety cap on requests to the Algolia API in one run. The API allows 10,000 requests per hour per IP; this Actor sends at most 2 per second. Default 3000.",
            "default": 3000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}