{
  "openapi": "3.0.1",
  "info": {
    "title": "Construction Site Leads from EPA Stormwater Permits + AI Tags",
    "description": "New construction sites from EPA stormwater permit filings: site, acres, start date and the operator's contact name, title, phone and e-mail, plus AI tags for project type and which trades should call. Utah, Illinois, South Dakota, New Mexico, Massachusetts, NH, DC, PR, tribal lands.",
    "version": "0.1",
    "x-build-id": "OivQz48s3FHveEhB5"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/wickedome~stormwater-construction-leads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-wickedome-stormwater-construction-leads",
        "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/wickedome~stormwater-construction-leads/runs": {
      "post": {
        "operationId": "runs-sync-wickedome-stormwater-construction-leads",
        "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/wickedome~stormwater-construction-leads/run-sync": {
      "post": {
        "operationId": "run-sync-wickedome-stormwater-construction-leads",
        "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": {
          "lookbackDays": {
            "title": "Lookback days",
            "minimum": 1,
            "maximum": 31,
            "type": "integer",
            "description": "How many days of filings to pull, counting back from today (UTC). Ignored if Date from is set. For a daily schedule use 2-3 with \"Only new sites\" on.",
            "default": 7
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Optional start of the submission date range (YYYY-MM-DD). Use it for backfills: the range can cover up to 2 years and is read a month at a time, newest first, so Max sites stops the run at the most recent matches."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "Optional end of the range (YYYY-MM-DD). Defaults to today."
          },
          "states": {
            "title": "States",
            "type": "array",
            "description": "Two-letter codes of the site state, e.g. UT, IL, SD, NM, MA, NH, DC, PR. Leave empty for all. Other states only appear for tribal lands and some federal sites.",
            "items": {
              "type": "string"
            }
          },
          "counties": {
            "title": "Counties",
            "type": "array",
            "description": "Only sites in these counties, e.g. Salt Lake, Utah, Cook, Bernalillo. Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Only sites in these cities, e.g. Saint George, Albuquerque, Sioux Falls. Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "minAcres": {
            "title": "Minimum acres disturbed",
            "minimum": 0,
            "type": "number",
            "description": "Skip smaller sites. 1 acre is the usual permit threshold; single house lots are often under 1 acre.",
            "default": 0
          },
          "maxAcres": {
            "title": "Maximum acres disturbed",
            "minimum": 0,
            "type": "number",
            "description": "Optional upper limit."
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Only sites whose name, operator or city contains one of these words (any match, not case-sensitive), e.g. solar, apartments, school.",
            "items": {
              "type": "string"
            }
          },
          "submissionTypes": {
            "title": "Filing types",
            "type": "array",
            "description": "New = a new construction site (the lead). Change = updated details or a new operator. Termination = the site is finished. Renewal / Reapplication = a site still under way.",
            "items": {
              "type": "string",
              "enum": [
                "New",
                "Change",
                "Renewal",
                "Reapplication",
                "Termination"
              ],
              "enumTitles": [
                "New site (Notice of Intent)",
                "Change",
                "Renewal",
                "Reapplication",
                "Termination (site finished)"
              ]
            },
            "default": [
              "New"
            ]
          },
          "onlyWithEmail": {
            "title": "Only sites with a contact e-mail",
            "type": "boolean",
            "description": "Skip filings with no operator e-mail. Almost all filings have one.",
            "default": false
          },
          "includeWithdrawn": {
            "title": "Include withdrawn and denied filings",
            "type": "boolean",
            "description": "Withdrawn and denied filings never became a permit, so they are skipped by default.",
            "default": false
          },
          "aiTags": {
            "title": "AI tags",
            "type": "boolean",
            "description": "Adds project type, operator type, which trades should call the site, and a one-line lead summary (billed as \"AI tags\" per site). Contact details are never sent to the AI.",
            "default": true
          },
          "projectTypes": {
            "title": "Project types",
            "type": "array",
            "description": "Only these AI project types. Leave empty for all. Needs AI tags.",
            "items": {
              "type": "string",
              "enum": [
                "single_family_home",
                "residential_subdivision",
                "multifamily_residential",
                "commercial_retail_office",
                "industrial_warehouse",
                "data_center",
                "solar_wind_battery",
                "oil_gas",
                "utility_pipeline_telecom",
                "road_bridge_transportation",
                "airport_military",
                "school_government_institutional",
                "healthcare",
                "parks_recreation",
                "water_wastewater",
                "mining_quarry_landfill",
                "agricultural",
                "demolition_remediation",
                "other"
              ],
              "enumTitles": [
                "Single-family home",
                "Residential subdivision",
                "Multifamily (apartments, townhomes)",
                "Commercial (retail, office)",
                "Industrial / warehouse",
                "Data center",
                "Solar, wind or battery storage",
                "Oil & gas",
                "Utility, pipeline or telecom",
                "Road, bridge or transportation",
                "Airport / military",
                "School, government or institutional",
                "Healthcare",
                "Parks & recreation",
                "Water / wastewater",
                "Mining, quarry or landfill",
                "Agricultural",
                "Demolition / remediation",
                "Other"
              ]
            }
          },
          "operatorTypes": {
            "title": "Operator types",
            "type": "array",
            "description": "Only these AI operator types, e.g. homebuilders or general contractors. Leave empty for all. Needs AI tags.",
            "items": {
              "type": "string",
              "enum": [
                "homebuilder",
                "general_contractor",
                "site_excavation_contractor",
                "developer_owner",
                "utility_company",
                "energy_developer",
                "government_agency",
                "individual_owner",
                "other"
              ],
              "enumTitles": [
                "Homebuilder",
                "General contractor",
                "Site / excavation contractor",
                "Developer or owner",
                "Utility company",
                "Energy developer",
                "Government agency",
                "Individual owner",
                "Other"
              ]
            }
          },
          "sellTo": {
            "title": "Sells to (your trade)",
            "type": "array",
            "description": "Only sites the AI marks as a fit for at least one of these trades or suppliers. Leave empty for all. Needs AI tags.",
            "items": {
              "type": "string",
              "enum": [
                "erosion_control_swppp",
                "excavation_grading",
                "surveying_engineering",
                "concrete_ready_mix",
                "aggregates_materials",
                "equipment_rental",
                "portable_toilets_site_services",
                "dumpsters_waste",
                "temporary_fencing_security",
                "underground_utilities",
                "paving_asphalt",
                "framing_lumber",
                "roofing",
                "plumbing_hvac_electrical",
                "landscaping_irrigation",
                "steel_structures",
                "solar_electrical_installers",
                "well_septic",
                "insurance_bonding"
              ],
              "enumTitles": [
                "Erosion control / SWPPP inspections",
                "Excavation & grading",
                "Surveying & engineering",
                "Concrete / ready-mix",
                "Aggregates & materials",
                "Equipment rental",
                "Portable toilets & site services",
                "Dumpsters & waste",
                "Temporary fencing & security",
                "Underground utilities",
                "Paving & asphalt",
                "Framing & lumber",
                "Roofing",
                "Plumbing, HVAC & electrical",
                "Landscaping & irrigation",
                "Steel structures",
                "Solar & electrical installers",
                "Well & septic",
                "Insurance & bonding"
              ]
            }
          },
          "onlyNew": {
            "title": "Only new sites",
            "type": "boolean",
            "description": "Skip filings this monitor already returned in earlier runs. Turn on for scheduled daily or weekly runs.",
            "default": false
          },
          "monitorId": {
            "title": "Monitor ID",
            "type": "string",
            "description": "Name for the \"Only new sites\" memory. Use a different ID for each saved search you schedule.",
            "default": "default"
          },
          "maxItems": {
            "title": "Max sites",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Stop after this many sites. Each site is billed once. For large backfills, also raise the run timeout (Run options) so the run has time to finish.",
            "default": 100
          },
          "sendDiagnostics": {
            "title": "Send anonymous diagnostics",
            "type": "boolean",
            "description": "Send the Actor's author a short anonymous record of each run: status, duration, row count, error message, and which options were used (never their values). This helps find and fix failures. See Diagnostics in the README.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}