{
  "openapi": "3.0.1",
  "info": {
    "title": "US Law Enforcement, Corrections & Public Safety Leads Scraper",
    "description": "Scrape every US law enforcement agency (police, sheriff, state, federal, tribal & campus), correctional facility, EMS station & 911/EOC: name, address, phone, type, staffing, capacity, NAICS, website, geo + lead score. Filter by category, state & size. Official HIFLD gov data + monitor mode.",
    "version": "0.1",
    "x-build-id": "Js5uGQLTdPvUHRWP1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~us-law-enforcement-leads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-us-law-enforcement-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/scrapesage~us-law-enforcement-leads/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-us-law-enforcement-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/scrapesage~us-law-enforcement-leads/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-us-law-enforcement-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": {
          "categories": {
            "title": "Agency categories",
            "type": "array",
            "description": "Which public-safety agency types to pull. <b>Law enforcement</b> (~23k local/county/state/federal/tribal/campus police agencies — with sworn-officer staffing) and <b>Corrections</b> (~6k prisons, jails & detention facilities — with capacity & security level) are the core. <b>EMS / ambulance</b> (~42k stations) and <b>911 / Emergency Operations Centers</b> (~6k, many with email) are optional add-ons. Note: fire departments are covered by our separate US Fire Department Leads actor.",
            "items": {
              "type": "string",
              "enum": [
                "lawEnforcement",
                "corrections",
                "ems",
                "eoc"
              ],
              "enumTitles": [
                "Law enforcement (police, sheriff, state, federal, tribal, campus)",
                "Corrections (prisons, jails & detention facilities)",
                "EMS / ambulance stations (optional)",
                "911 / Emergency Operations Centers (optional)"
              ]
            },
            "default": [
              "lawEnforcement",
              "corrections"
            ]
          },
          "states": {
            "title": "States",
            "type": "array",
            "description": "Filter by state — two-letter USPS codes, e.g. <code>CA</code>, <code>TX</code>, <code>NY</code>, <code>FL</code>. Leave empty for all states & territories (slower; scans the whole country).",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Filter by city name (case-insensitive contains), e.g. <code>Houston</code>, <code>Phoenix</code>. Combine with a state for accuracy.",
            "items": {
              "type": "string"
            }
          },
          "counties": {
            "title": "Counties",
            "type": "array",
            "description": "Filter by county name (case-insensitive contains), e.g. <code>Harris</code>, <code>Maricopa</code>.",
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes (prefix)",
            "type": "array",
            "description": "Filter by ZIP — full ZIP (<code>77002</code>) or a prefix (<code>770</code> matches all 770xx).",
            "items": {
              "type": "string"
            }
          },
          "nameQuery": {
            "title": "Name contains",
            "type": "string",
            "description": "Only return agencies whose name contains this text (case-insensitive), e.g. <code>county</code>, <code>university</code>, or a specific agency name."
          },
          "agencyTypes": {
            "title": "Agency types",
            "type": "array",
            "description": "Keep only agencies whose normalized or raw type contains one of these words (case-insensitive), e.g. <code>Sheriff</code>, <code>State Police</code>, <code>Campus</code>, <code>Tribal</code>, <code>Federal</code>, <code>County Jail</code>, <code>State Prison</code>. Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "tribalOnly": {
            "title": "Tribal law enforcement only",
            "type": "boolean",
            "description": "Only return tribal / Native American law enforcement agencies.",
            "default": false
          },
          "minSwornOfficers": {
            "title": "Min sworn officers (law enforcement)",
            "type": "integer",
            "description": "Only law-enforcement agencies with at least this many sworn officers (full-time + part-time). Great for targeting larger, higher-budget departments. E.g. <code>25</code>."
          },
          "minInmateCapacity": {
            "title": "Min inmate capacity (corrections)",
            "type": "integer",
            "description": "Only correctional facilities with at least this rated inmate capacity. E.g. <code>250</code>."
          },
          "hasPhone": {
            "title": "Has phone only",
            "type": "boolean",
            "description": "Only return agencies that include a phone number.",
            "default": false
          },
          "hasWebsite": {
            "title": "Has website only",
            "type": "boolean",
            "description": "Only return agencies that include a website.",
            "default": false
          },
          "hasEmail": {
            "title": "Has email only",
            "type": "boolean",
            "description": "Only return agencies that include an email address (primarily 911 / Emergency Operations Centers).",
            "default": false
          },
          "maxResults": {
            "title": "Max results",
            "type": "integer",
            "description": "Maximum number of agency records to return. The actor ranks by your chosen sort order and returns the top N. Lower this for quick, cheap test runs.",
            "default": 1000
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "leadScore",
              "agencySize",
              "name",
              "state",
              "source"
            ],
            "type": "string",
            "description": "Ordering of the returned records.",
            "default": "leadScore"
          },
          "deduplicateResults": {
            "title": "De-duplicate",
            "type": "boolean",
            "description": "Drop duplicate agencies (by category + agency ID) within a run.",
            "default": true
          },
          "monitorMode": {
            "title": "Monitor mode (only new / changed)",
            "type": "boolean",
            "description": "Remember which agencies were already returned (in a per-key store) and, on later runs, emit only <b>new</b> or <b>changed</b> records — each tagged with <code>monitorEvent</code>. Combine with Apify Schedules to auto-detect new agencies, openings, contact changes and capacity changes. Does not conflict with scheduling — it simply de-duplicates across runs.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "Names the memory used by monitor mode. Use a different key per saved search / market (e.g. <code>tx-sheriffs</code>) so they track independently.",
            "default": "default"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. HIFLD open data is served directly from US government ArcGIS endpoints and needs no proxy — the default (no proxy) is fastest. You may enable Apify Proxy if you prefer.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}