{
  "openapi": "3.0.1",
  "info": {
    "title": "Stories, Search and Who Is Hiring for Hacker News",
    "description": "Get top, new, best, Ask HN, Show HN and job stories for Hacker News, run full text search with filters and read Who is hiring job posts with company and remote hints. Official HN API and HN Search API. Pay per item. Not affiliated with Y Combinator or Hacker News.",
    "version": "0.1",
    "x-build-id": "kHjX0whc6ncInyzla"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/forgeloop~hacker-news-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-forgeloop-hacker-news-api",
        "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/forgeloop~hacker-news-api/runs": {
      "post": {
        "operationId": "runs-sync-forgeloop-hacker-news-api",
        "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/forgeloop~hacker-news-api/run-sync": {
      "post": {
        "operationId": "run-sync-forgeloop-hacker-news-api",
        "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",
              "whoIsHiring"
            ],
            "type": "string",
            "description": "\"list\" reads one of the Hacker News story lists. \"search\" runs a full text search through the HN Search API by Algolia. \"whoIsHiring\" returns the job posts of the latest (or a given) \"Ask HN: Who is hiring?\" thread.",
            "default": "list"
          },
          "list": {
            "title": "Story list",
            "enum": [
              "top",
              "new",
              "best",
              "ask",
              "show",
              "job"
            ],
            "type": "string",
            "description": "List mode only. Which Hacker News list to read. Top and new hold up to 500 stories, the others up to 200.",
            "default": "top"
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of stories (list mode), search hits (search mode) or job posts (Who is hiring mode). Comments loaded with \"Include comments\" come on top. Default 30 in list mode (max 500), 100 in search mode (max 1,000, the limit of the search API) and 100 in Who is hiring mode (max 1,000)."
          },
          "query": {
            "title": "Search query",
            "type": "string",
            "description": "Search mode: full text query, for example \"rust\" or \"openai\". Leave empty to get the newest items that match the tags and filters. Who is hiring mode: optional keyword, only job posts that contain it are returned, for example \"rust\" or \"berlin\"."
          },
          "tags": {
            "title": "Item types",
            "type": "array",
            "description": "Search mode only. Limit the search to these item types. Several types are combined with OR. Empty means all types.",
            "items": {
              "type": "string",
              "enum": [
                "story",
                "comment",
                "ask_hn",
                "show_hn",
                "job",
                "poll"
              ],
              "enumTitles": [
                "Stories",
                "Comments",
                "Ask HN",
                "Show HN",
                "Jobs",
                "Polls"
              ]
            }
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "relevance",
              "date"
            ],
            "type": "string",
            "description": "Search mode only. \"relevance\" puts the best matches with many points first. \"date\" puts the newest first, best for monitoring.",
            "default": "relevance"
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Search mode only. Only items created on or after this date (UTC). Format YYYY-MM-DD, an ISO date time, or a relative value like \"7 days\" or \"24 hours\"."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "Search mode only. Only items created on or before this date (UTC, the whole day counts). Same formats as \"Date from\"."
          },
          "minPoints": {
            "title": "Minimum points",
            "minimum": 0,
            "type": "integer",
            "description": "Search mode only. Only stories with at least this many points. Comments have no public points, so they never match this filter."
          },
          "minComments": {
            "title": "Minimum comments",
            "minimum": 0,
            "type": "integer",
            "description": "Search mode only. Only stories with at least this many comments."
          },
          "month": {
            "title": "Who is hiring month",
            "type": "string",
            "description": "Who is hiring mode only. Month of the thread, for example \"2026-10\" or \"October 2026\". Empty means the latest thread."
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "List and search mode. Also load the comments of each story. Comments are returned as separate items right after their story, with storyId, parentId and depth.",
            "default": false
          },
          "maxCommentsPerStory": {
            "title": "Max comments per story",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "With \"Include comments\": the most comments loaded per story. Direct replies come first, then replies to replies.",
            "default": 50
          },
          "contentFormat": {
            "title": "Text format",
            "enum": [
              "text",
              "html",
              "none"
            ],
            "type": "string",
            "description": "\"text\" returns the text of Ask HN posts, jobs and comments as plain text. \"html\" also adds the original HN HTML in the field html. \"none\" leaves the text out.",
            "default": "text"
          },
          "maskContacts": {
            "title": "Mask e-mails and phone numbers",
            "type": "boolean",
            "description": "Replace e-mail addresses and phone numbers in post and comment texts with [email removed] and [phone removed]. On by default.",
            "default": true
          },
          "monitorMode": {
            "title": "Only new items (monitor mode)",
            "type": "boolean",
            "description": "Return only items that earlier runs with the same settings did not return yet. The IDs are kept in the named key-value store \"hn-monitor\" (the last 5,000 per setting). The first run returns everything. Schedule the Actor to watch a list, a search or the Who is hiring thread.",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}