{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Scraper & Keyword Monitor",
    "description": "Hacker News scraper and keyword monitor using the official HN API and Algolia search. Track keywords, domains and users, and get only new stories and comments since the last run, with points/comments thresholds and front-page, Ask and Show HN feeds.",
    "version": "0.2",
    "x-build-id": "kfgR5Icw07HfMK7BC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/heaped_qualm~hackernews-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-heaped_qualm-hackernews-monitor",
        "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/heaped_qualm~hackernews-monitor/runs": {
      "post": {
        "operationId": "runs-sync-heaped_qualm-hackernews-monitor",
        "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/heaped_qualm~hackernews-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-heaped_qualm-hackernews-monitor",
        "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": {
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Full-text searches across Hacker News titles, URLs and text (Algolia HN Search), one per line, e.g. postgres, \"large language model\", your brand or competitor. Leave every source empty to watch the keyword AI.",
            "items": {
              "type": "string"
            }
          },
          "domains": {
            "title": "Domains",
            "type": "array",
            "description": "Get items whose link points to these sites, e.g. github.com, yourcompany.com, nytimes.com. Matched against the story URL.",
            "items": {
              "type": "string"
            }
          },
          "users": {
            "title": "HN users",
            "type": "array",
            "description": "Hacker News usernames to follow (their stories or comments, depending on item types), e.g. patio11, tptacek.",
            "items": {
              "type": "string"
            }
          },
          "feeds": {
            "title": "Official HN feeds",
            "type": "array",
            "description": "Lists from the official Hacker News Firebase API. Items are checked against the filters below (type, age, points, comments).",
            "items": {
              "type": "string",
              "enum": [
                "topstories",
                "newstories",
                "beststories",
                "askstories",
                "showstories",
                "jobstories"
              ],
              "enumTitles": [
                "Front page (top stories)",
                "New stories",
                "Best stories",
                "Ask HN",
                "Show HN",
                "Jobs"
              ]
            }
          },
          "itemTypes": {
            "title": "Item types",
            "type": "array",
            "description": "Which kinds of items to return. Add Comments to catch mentions in discussions (score thresholds do not apply to comments, which have no public score).",
            "items": {
              "type": "string",
              "enum": [
                "story",
                "comment",
                "job",
                "poll"
              ],
              "enumTitles": [
                "Stories",
                "Comments",
                "Jobs",
                "Polls"
              ]
            },
            "default": [
              "story"
            ]
          },
          "minPoints": {
            "title": "Minimum points",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Only stories, jobs and polls with at least this score. A story below the threshold is not remembered, so it is reported later once it crosses the threshold.",
            "default": 0
          },
          "minComments": {
            "title": "Minimum comments",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Only stories with at least this many comments. Same delayed reporting as Minimum points.",
            "default": 0
          },
          "lastHours": {
            "title": "Look back (hours)",
            "minimum": 0,
            "maximum": 8760,
            "type": "integer",
            "description": "Only items created in the last N hours. 0 = no limit (search results are newest first).",
            "default": 24
          },
          "maxItemsPerSource": {
            "title": "Max items per source",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum items checked per source and item type per run (newest first). For feeds: how many list entries are fetched.",
            "default": 100
          },
          "onlyNew": {
            "title": "Only new since last run",
            "type": "boolean",
            "description": "Monitor mode: return only items not seen in earlier runs under the same monitor name. The first run returns everything as BASELINE. It starts switched off in the form, so a manual test run always shows results (already seen items are marked SEEN). Switch it on in the task you schedule. API calls that omit this field get monitor mode on.",
            "default": true
          },
          "stateKey": {
            "title": "Monitor name",
            "type": "string",
            "description": "Name of this monitor's memory (letters, digits and dashes; other characters become dashes). Use a different name for each saved task or schedule.",
            "default": "default"
          },
          "includeText": {
            "title": "Include comment / post text",
            "type": "boolean",
            "description": "Adds the plain text of comments and Ask/Show HN posts. Switch off for smaller rows. Texts are written by HN users; check reuse rights before republishing them.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}