{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Data (unofficial)",
    "description": "Unofficial Hacker News lists, keyword search, comment trees, profiles, and new-item alerts from the public Firebase and Algolia APIs. Not affiliated with Y Combinator.",
    "version": "0.1",
    "x-build-id": "2KoG65e6Oqx1ELufL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/plusonets~hacker-news-data/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-plusonets-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/plusonets~hacker-news-data/runs": {
      "post": {
        "operationId": "runs-sync-plusonets-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/plusonets~hacker-news-data/run-sync": {
      "post": {
        "operationId": "run-sync-plusonets-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "list",
              "search",
              "item",
              "user",
              "monitor"
            ],
            "type": "string",
            "description": "list reads top, new, best, ask, show, or jobs. search queries Algolia. item loads one item and, optionally, its comments. user loads a public profile. monitor searches newest stories and skips ids already saved for this state namespace.",
            "default": "list"
          },
          "list": {
            "title": "List",
            "enum": [
              "top",
              "new",
              "best",
              "ask",
              "show",
              "jobs"
            ],
            "type": "string",
            "description": "Which Firebase list to read when mode is list.",
            "default": "top"
          },
          "query": {
            "title": "Search query",
            "type": "string",
            "description": "Keywords for search and monitor modes. Monitor requires a query. Search can be empty to browse recent stories, but a query is more useful."
          },
          "itemId": {
            "title": "Item id",
            "minimum": 1,
            "type": "integer",
            "description": "Numeric Hacker News item id. Required when mode is item."
          },
          "username": {
            "title": "Username",
            "type": "string",
            "description": "Public Hacker News username. Required when mode is user. The profile includes karma and recent submission ids, not every submission."
          },
          "since": {
            "title": "Since",
            "type": "string",
            "description": "Keep items created on or after this ISO date or datetime."
          },
          "until": {
            "title": "Until",
            "type": "string",
            "description": "Keep items created on or before this ISO date or datetime."
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "For list and item modes, also save comments under each story. Each comment is its own dataset item and its own charge. Deleted and dead comments are skipped.",
            "default": false
          },
          "maxComments": {
            "title": "Maximum comments per story",
            "minimum": 0,
            "maximum": 200,
            "type": "integer",
            "description": "How many comments to walk for each story when include comments is on.",
            "default": 20
          },
          "maxCommentDepth": {
            "title": "Comment depth",
            "minimum": 0,
            "maximum": 6,
            "type": "integer",
            "description": "How many reply levels to follow. 1 is direct replies only.",
            "default": 2
          },
          "newItemsOnly": {
            "title": "New items only",
            "type": "boolean",
            "description": "Skip ids already saved for this state namespace. Monitor mode always does this. Leave it off for a fresh export. A quiet monitor run with nothing new still succeeds.",
            "default": false
          },
          "stateNamespace": {
            "title": "State namespace",
            "type": "string",
            "description": "Separate saved-id lists when you run more than one alert in the same account.",
            "default": "default"
          },
          "maxItems": {
            "title": "Maximum stories or profiles",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Cap on stories, search hits, or the number of recent submission ids stored on a profile. Comments are extra, up to the comment cap.",
            "default": 5
          },
          "maxChargeUsd": {
            "title": "Maximum charge (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Optional extra cap. The Actor also stops at the run maximum charge Apify passes in ACTOR_MAX_TOTAL_CHARGE_USD. The lower of the two wins."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}