{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Keyword Monitor — Deduplicated Stories & Comments",
    "description": "Batch-monitor Hacker News stories and comments across multiple keyword queries in one call, deduplicating overlapping hits. Returns itemId, itemType, title, text, discussionUrl, points, commentCount, changeStatus, and matchEvidence. Pay-Per-Event $0.003/item ($3.00/1k), zero cookies.",
    "version": "0.3",
    "x-build-id": "5SxtYXjUe6RrAadZe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/natstandridge~hacker-news-discussion-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-natstandridge-hacker-news-discussion-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/natstandridge~hacker-news-discussion-monitor/runs": {
      "post": {
        "operationId": "runs-sync-natstandridge-hacker-news-discussion-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/natstandridge~hacker-news-discussion-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-natstandridge-hacker-news-discussion-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 or exact phrases",
            "minItems": 1,
            "maxItems": 10,
            "type": "array",
            "description": "1–10 words or phrases. Literal case-insensitive matching in returned title/text; stories also match their source URL. Overlapping queries produce one discussion row. Duplicate queries are merged.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "itemType": {
            "title": "Discussion type",
            "enum": [
              "both",
              "story",
              "comment"
            ],
            "type": "string",
            "description": "Comments include parent story context when provided by the index; no user profile requests.",
            "default": "both"
          },
          "since": {
            "title": "Window start (optional)",
            "type": "string",
            "description": "ISO 8601 timestamp with timezone. Overrides lookbackDays. Window ends just before the run's fixed collection timestamp, using creation date rather than edit date."
          },
          "lookbackDays": {
            "title": "Lookback days",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Creation-date window used when since is absent. Index limits can truncate busy or broad searches.",
            "default": 7
          },
          "minPoints": {
            "title": "Minimum story points",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Applied only to stories. Comments keep points=null and remain eligible.",
            "default": 0
          },
          "maxResults": {
            "title": "Maximum delivered discussions",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Newest deduplicated eligible matches. Query diagnostics and completion flags remain in OUTPUT. Charging cap can lower this further.",
            "default": 100
          },
          "maxPagesPerQuery": {
            "title": "Maximum source pages per keyword",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "100 source hits per page. Source supports at most 1000 accessible hits per query. Queries are paged round-robin.",
            "default": 3
          },
          "maxRequests": {
            "title": "Maximum source requests",
            "minimum": 1,
            "maximum": 120,
            "type": "integer",
            "description": "Total GET attempts including robots and safe-read retries. Hitting this bound is explicitly incomplete.",
            "default": 35
          },
          "requestTimeoutSeconds": {
            "title": "Request deadline (seconds)",
            "minimum": 3,
            "maximum": 30,
            "type": "integer",
            "description": "Hard bound per DNS/TLS/response attempt. Up to two safe-read retries within the total request/work budget.",
            "default": 15
          },
          "maxRunSeconds": {
            "title": "Work deadline (seconds)",
            "minimum": 40,
            "maximum": 180,
            "type": "integer",
            "description": "Collection reserves 25 seconds for frozen-plan storage and delivery; storage operations have independent short bounds.",
            "default": 120
          },
          "previousItems": {
            "title": "Previous OUTPUT.nextSnapshot (optional)",
            "maxItems": 10000,
            "type": "array",
            "description": "Paste the exact nextSnapshot array from the previous run. Caller-owned, no cross-run hidden state. Up to 10000 keys; unmatched previous entries are retained and never treated as deleted.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "itemId",
                "contentHash"
              ],
              "properties": {
                "itemId": {
                  "title": "Hacker News item ID",
                  "description": "The exact itemId string from an earlier OUTPUT.nextSnapshot record.",
                  "type": "string",
                  "pattern": "^[1-9][0-9]{0,17}$"
                },
                "contentHash": {
                  "title": "Previous content hash",
                  "description": "The exact contentHash from the same previous snapshot record.",
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$"
                }
              }
            }
          },
          "changesOnly": {
            "title": "Deliver new or edited discussions only",
            "type": "boolean",
            "description": "Requires previousItems explicitly (an empty array is valid). Unchanged content is skipped and uncharged; score/comment-count changes alone do not count as edits.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}