{
  "openapi": "3.0.1",
  "info": {
    "title": "US Fire Department Leads Scraper - Fire & Rescue Contacts",
    "description": "Scrape every US fire department from the official USFA Registry (FEMA): name, phone, fax, address, website, type (career/volunteer/combination), stations, firefighter staffing, org type & lead score. Filter by state, type & size; monitor only-new. Keyless, no browser.",
    "version": "0.1",
    "x-build-id": "YeoUUXmZBjEbrVUbn"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~us-fire-department-leads-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-us-fire-department-leads-scraper",
        "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/scrapesage~us-fire-department-leads-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-us-fire-department-leads-scraper",
        "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/scrapesage~us-fire-department-leads-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-us-fire-department-leads-scraper",
        "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": "Filter to one or more US states by 2-letter postal code, e.g. `CA`, `TX`, `NY`. Leave empty for the entire country (~27,000 departments).",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Filter by headquarters city name(s), e.g. `Houston`, `Phoenix`. Case-insensitive. One per row.",
            "items": {
              "type": "string"
            }
          },
          "counties": {
            "title": "Counties",
            "type": "array",
            "description": "Filter by county name(s), e.g. `Maricopa`, `Cook`, `Harris` (the word \"County\" is optional). One per row.",
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes (prefix)",
            "type": "array",
            "description": "Filter by ZIP code or ZIP prefix, e.g. `770` matches all `770xx` ZIPs. One per row.",
            "items": {
              "type": "string"
            }
          },
          "departmentTypes": {
            "title": "Department types",
            "type": "array",
            "description": "Filter by staffing model. `career`, `volunteer`, `combination` (mostly career + mostly volunteer), `mostlyCareer`, `mostlyVolunteer`. Career & combination departments tend to have larger equipment budgets; volunteer departments are prime grant-writing / PPE prospects.",
            "items": {
              "type": "string",
              "enum": [
                "career",
                "volunteer",
                "combination",
                "mostlyCareer",
                "mostlyVolunteer"
              ]
            }
          },
          "organizationTypes": {
            "title": "Organization types",
            "type": "array",
            "description": "Filter by organization type. `local`, `tribal`, `state`, `airport` (transit/airport authority), `federal` (incl. DoD), `military` (DoD only), `private` (industrial brigade), `contract`, `other`.",
            "items": {
              "type": "string",
              "enum": [
                "local",
                "tribal",
                "state",
                "airport",
                "federal",
                "military",
                "private",
                "contract",
                "other"
              ]
            }
          },
          "departmentNameQuery": {
            "title": "Department name contains",
            "type": "string",
            "description": "Only return departments whose name contains this text (case-insensitive), e.g. `rural`, `township`, `airport`."
          },
          "minStations": {
            "title": "Min stations",
            "minimum": 0,
            "type": "integer",
            "description": "Only departments operating at least this many fire stations."
          },
          "maxStations": {
            "title": "Max stations",
            "minimum": 0,
            "type": "integer",
            "description": "Only departments operating at most this many fire stations."
          },
          "minFirefighters": {
            "title": "Min total active firefighters",
            "minimum": 0,
            "type": "integer",
            "description": "Only departments with at least this many active firefighters (career + volunteer + paid-per-call). Use to target larger, higher-budget departments."
          },
          "maxFirefighters": {
            "title": "Max total active firefighters",
            "minimum": 0,
            "type": "integer",
            "description": "Only departments with at most this many active firefighters. Use to target small / rural departments."
          },
          "minCareerFirefighters": {
            "title": "Min career firefighters",
            "minimum": 0,
            "type": "integer",
            "description": "Only departments with at least this many full-time (career) firefighters — a strong budget / procurement-capacity signal."
          },
          "hasWebsiteOnly": {
            "title": "Has website only",
            "type": "boolean",
            "description": "Only return departments that publish a website.",
            "default": false
          },
          "hasPhoneOnly": {
            "title": "Has phone only",
            "type": "boolean",
            "description": "Only return departments that list a headquarters phone number.",
            "default": false
          },
          "primaryEmergencyMgmtOnly": {
            "title": "Primary emergency-management agency only",
            "type": "boolean",
            "description": "Only departments flagged as the primary agency for emergency management in their jurisdiction.",
            "default": false
          },
          "fdids": {
            "title": "FDIDs (lookup)",
            "type": "array",
            "description": "Look up specific departments by their USFA Fire Department ID (FDID). One per row.",
            "items": {
              "type": "string"
            }
          },
          "includeStations": {
            "title": "Include per-station addresses",
            "type": "boolean",
            "description": "Also join the registry's station-level export so each department record carries a `stations[]` array of individual station names & addresses (available for departments that submitted station detail).",
            "default": false
          },
          "minLeadScore": {
            "title": "Minimum lead score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Only return departments with a derived lead score at or above this value (0–100)."
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "leadScore",
              "firefightersHigh",
              "stationsHigh",
              "name",
              "none"
            ],
            "type": "string",
            "description": "Result ordering. `leadScore` = best leads first (size + contactability).",
            "default": "leadScore"
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of fire-department records to return.",
            "default": 1000
          },
          "monitorMode": {
            "title": "Monitor mode (only new / changed)",
            "type": "boolean",
            "description": "Remember departments seen in previous runs (per monitor key) and emit ONLY newly-registered or updated departments (new phone, website, staffing or station count) on each run. Ideal on a schedule to receive a fresh feed. Works alongside Apify Schedules.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "Names the monitor state so different saved tasks keep separate memory. Use one key per saved search.",
            "default": "default"
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional proxy. The USFA registry download needs no proxy; the actor falls back automatically (direct → Apify datacenter → US residential) if a network hiccup occurs. Leave disabled for the cheapest runs.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}