{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Scraper & Keyword Monitor (Stories, Comments)",
    "description": "Unofficial; not affiliated with Y Combinator or Algolia. Search and monitor Hacker News stories and comments for keywords, brands and domains via the official HN Search API. Points/comments filters, clean text, only-new items for scheduled runs. By Harlo.",
    "version": "0.1",
    "x-build-id": "UDARwEP1KrBB43JFx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/brightish_ascent~hacker-news-keyword-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-brightish_ascent-hacker-news-keyword-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/brightish_ascent~hacker-news-keyword-monitor/runs": {
      "post": {
        "operationId": "runs-sync-brightish_ascent-hacker-news-keyword-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/brightish_ascent~hacker-news-keyword-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-brightish_ascent-hacker-news-keyword-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": {
          "queries": {
            "title": "Keywords",
            "type": "array",
            "description": "Words or phrases to search for in titles, URLs, story text and comments (HN Search full-text). One search per keyword. Leave empty (and domains empty) to get the latest items.",
            "items": {
              "type": "string"
            }
          },
          "domains": {
            "title": "Domains (link mentions)",
            "type": "array",
            "description": "Find stories that link to these sites, e.g. \"github.com\" or \"yourcompany.com\" (subdomains included). Matches story URLs only. queries + domains max 25 per run.",
            "items": {
              "type": "string"
            }
          },
          "contentTypes": {
            "title": "Content types",
            "type": "array",
            "description": "What to return. \"story\" already includes Show HN and Ask HN posts.",
            "items": {
              "type": "string",
              "enum": [
                "story",
                "comment",
                "show_hn",
                "ask_hn",
                "poll"
              ],
              "enumTitles": [
                "Stories (incl. Show/Ask HN)",
                "Comments",
                "Show HN only",
                "Ask HN only",
                "Polls"
              ]
            },
            "default": [
              "story"
            ]
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "newest",
              "relevance",
              "front_page"
            ],
            "type": "string",
            "description": "newest = most recent first; relevance = HN Search ranking (relevance, then points); front_page = stories on the HN front page right now (ignores lookbackHours).",
            "default": "newest"
          },
          "lookbackHours": {
            "title": "Lookback (hours)",
            "minimum": 0,
            "maximum": 175200,
            "type": "integer",
            "description": "Only items created in the last N hours. 0 = no time limit (all-time search, up to 1,000 hits per keyword).",
            "default": 24
          },
          "minPoints": {
            "title": "Min points (stories)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only stories with at least this many points. Not applied to comments.",
            "default": 0
          },
          "minComments": {
            "title": "Min comments (stories)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only stories with at least this many comments. Not applied to comments.",
            "default": 0
          },
          "typoTolerance": {
            "title": "Fuzzy (typo-tolerant) matching",
            "type": "boolean",
            "description": "Off (default) = exact keyword matching, so \"rust\" does not also return \"just\" or \"must\". On = HN Search's default typo tolerance (more results, more noise).",
            "default": false
          },
          "includeAuthor": {
            "title": "Include author username",
            "type": "boolean",
            "description": "Add the public HN username of each post. No user profiles are fetched.",
            "default": true
          },
          "includeText": {
            "title": "Include text",
            "type": "boolean",
            "description": "Add story/comment text as plain text (HTML removed, links kept, email-like strings replaced with \"[email removed]\").",
            "default": true
          },
          "maxTextChars": {
            "title": "Max text length",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Trim text to this many characters (0 = no limit).",
            "default": 2000
          },
          "onlyNewSinceLastRun": {
            "title": "Only new since last run (monitor mode)",
            "type": "boolean",
            "description": "Remember delivered items per input set in a named key-value store in your account (hacker-news-keyword-monitor-state). Later runs return only new items, plus items whose title, URL or text was edited. First run = baseline (returns current matches).",
            "default": false
          },
          "maxItems": {
            "title": "Max rows",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum dataset rows per run (each row is one charged event). In monitor mode, rows over the limit are delivered on the next run.",
            "default": 100
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "full",
              "compact"
            ],
            "type": "string",
            "description": "full = all fields; compact = id, kind, title, url, hnUrl, points, numComments, createdAt, storyTitle, text, matchedQueries, updateType.",
            "default": "full"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}