{
  "openapi": "3.0.1",
  "info": {
    "title": "US Liquor License Monitor: New, Pending & Changed Filings",
    "description": "Track new, pending, and changed US alcohol-license filings across 7 states (CA, TX, NY, CO, MO, OR, WA) from official state open data. One deduplicated feed with change detection, expiry alerts, and self-healing source health.",
    "version": "0.1",
    "x-build-id": "p1btpLXZhEbypTQqp"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/wallman_3rd~liquor-license-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-wallman_3rd-liquor-license-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/wallman_3rd~liquor-license-monitor/runs": {
      "post": {
        "operationId": "runs-sync-wallman_3rd-liquor-license-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/wallman_3rd~liquor-license-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-wallman_3rd-liquor-license-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": {
          "states": {
            "title": "States",
            "type": "array",
            "description": "US states to include. Currently live: NY, TX, CA, CO, MO, OR, WA, CT. More states are added over time.",
            "default": [
              "NY",
              "TX",
              "CA",
              "CO",
              "MO",
              "OR",
              "WA",
              "CT"
            ],
            "items": {
              "type": "string"
            }
          },
          "includePending": {
            "title": "Include pending applications",
            "type": "boolean",
            "description": "Include newly-filed, not-yet-issued license applications, the high-intent 'new business opening soon' signal. Currently available for NY.",
            "default": true
          },
          "includeActive": {
            "title": "Include active licenses",
            "type": "boolean",
            "description": "Include currently issued/active licenses.",
            "default": true
          },
          "retailOnly": {
            "title": "Retail only (TX)",
            "type": "boolean",
            "description": "For Texas, return only Retail-tier licenses (storefronts), excluding wholesale/distributor tiers.",
            "default": true
          },
          "onlyOutputChanges": {
            "title": "Monitor mode, output only changes",
            "type": "boolean",
            "description": "Push only new/changed/removed records to the dataset instead of the full list. Ideal for a scheduled run: the first run builds the baseline, each later run reports only what changed.",
            "default": false
          },
          "maxRecordsPerSource": {
            "title": "Max records per source",
            "minimum": 0,
            "type": "integer",
            "description": "Cap per source (per sub-source for NY pending/active). 0 = unlimited. Kept modest by default so a first run is quick and cheap.",
            "default": 1000
          },
          "suppressInitialChanges": {
            "title": "Suppress changes on first run",
            "type": "boolean",
            "description": "On the very first run (no baseline yet), don't emit a 'new' event for every record. Leave on to avoid a flood.",
            "default": true
          },
          "licenseExpiryAlertDays": {
            "title": "License expiry alert windows (days)",
            "type": "array",
            "description": "Days-before-expiry windows for the EXPIRING_LICENSES report.",
            "default": [
              30,
              60,
              90
            ]
          },
          "geocodeMissingCoordinates": {
            "title": "Geocode missing coordinates",
            "type": "boolean",
            "description": "Fill lat/lng for records whose state does not publish coordinates (TX, CA, MO, OR, CT), via free OpenStreetMap Nominatim. Results are cached across runs. Best used in monitor mode; a large first pull only geocodes up to the per-run cap.",
            "default": false
          },
          "maxGeocodePerRun": {
            "title": "Max new geocodes per run",
            "minimum": 0,
            "type": "integer",
            "description": "Cap on new (uncached) geocode lookups per run, to respect Nominatim's rate limit. Cached addresses do not count.",
            "default": 500
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "HTTPS endpoint to receive change events as a POST after each run (fires only when there are changes and a baseline exists)."
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional Socrata app token to raise open-data rate limits on large pulls. Not required for normal runs."
          },
          "testMode": {
            "title": "Test mode",
            "type": "boolean",
            "description": "Cap every source at 3 records and skip the snapshot update. Free smoke test to confirm the Actor works before a full run.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}