{
  "openapi": "3.0.1",
  "info": {
    "title": "💬 Reddit Search Alerts & Scraper",
    "description": "Automate recurring Reddit search queries to feed downstream LLM pipelines. Built-in stateful diffing ensures you only process new threads and comments.",
    "version": "0.1",
    "x-build-id": "N4PB3iYyOWcufi4Mt"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/taroyamada~reddit-keyword-monitor-alerts/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-taroyamada-reddit-keyword-monitor-alerts",
        "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/taroyamada~reddit-keyword-monitor-alerts/runs": {
      "post": {
        "operationId": "runs-sync-taroyamada-reddit-keyword-monitor-alerts",
        "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/taroyamada~reddit-keyword-monitor-alerts/run-sync": {
      "post": {
        "operationId": "run-sync-taroyamada-reddit-keyword-monitor-alerts",
        "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": "Global Keywords",
            "type": "array",
            "description": "Plain-text keywords for global Reddit monitoring. Used for post search plus recent comment scanning.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search Queries",
            "type": "array",
            "description": "Reddit search queries to monitor for new posts. Query-only routes do not search comments because public Reddit JSON does not expose comment search.",
            "items": {
              "type": "string"
            }
          },
          "subreddits": {
            "title": "Subreddits",
            "type": "array",
            "description": "Subreddits to monitor for new posts and comments (example: javascript).",
            "items": {
              "type": "string"
            }
          },
          "routes": {
            "title": "Advanced Routes",
            "type": "array",
            "description": "Optional JSON objects for combined subreddit+keyword or subreddit+query routing."
          },
          "monitorComments": {
            "title": "Monitor Comments",
            "type": "boolean",
            "description": "When enabled, scan recent comment streams where public endpoints support it.",
            "default": true
          },
          "postLimit": {
            "title": "Post Limit per Route",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many recent posts to inspect per route.",
            "default": 25
          },
          "commentLimit": {
            "title": "Comment Limit per Route",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many recent comments to inspect per route.",
            "default": 50
          },
          "sort": {
            "title": "Post Sort",
            "enum": [
              "new",
              "hot",
              "top",
              "rising",
              "relevance",
              "comments"
            ],
            "type": "string",
            "description": "Sort used for post endpoints. For recurring monitoring, \"new\" is usually best.",
            "default": "new"
          },
          "time": {
            "title": "Time Filter",
            "enum": [
              "hour",
              "day",
              "week",
              "month",
              "year",
              "all"
            ],
            "type": "string",
            "description": "Time filter used with top/relevance searches.",
            "default": "day"
          },
          "timeoutMs": {
            "title": "Timeout (ms)",
            "minimum": 3000,
            "maximum": 60000,
            "type": "integer",
            "description": "HTTP timeout per request.",
            "default": 15000
          },
          "delayMs": {
            "title": "Delay Between Routes (ms)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Polite delay between route scans.",
            "default": 1200
          },
          "snapshotKey": {
            "title": "Snapshot Key",
            "type": "string",
            "description": "KeyValueStore key / local state file used for seen-item snapshots.",
            "default": "reddit-keyword-monitor-snapshots"
          },
          "maxSnapshotItems": {
            "title": "Max Snapshot Items",
            "minimum": 100,
            "maximum": 50000,
            "type": "integer",
            "description": "Keep the latest N seen posts/comments in the snapshot.",
            "default": 5000
          },
          "emitOnFirstRun": {
            "title": "Emit On First Run",
            "type": "boolean",
            "description": "If false, the first successful run establishes a baseline without emitting alerts.",
            "default": false
          },
          "delivery": {
            "title": "Delivery",
            "enum": [
              "dataset",
              "webhook",
              "both",
              "none"
            ],
            "type": "string",
            "description": "Where to send results.",
            "default": "dataset"
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Webhook URL to receive the full payload when delivery includes webhook."
          },
          "dryRun": {
            "title": "Dry Run",
            "type": "boolean",
            "description": "Run without writing snapshots or sending external delivery.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}