{
  "openapi": "3.0.1",
  "info": {
    "title": "OpenFEMA Scraper",
    "description": "Scrape FEMA's free public OpenFEMA API: disaster declarations, public assistance funded projects, housing assistance aggregates, and the OpenFEMA dataset catalog. Filter by state, incident type, region, disaster number, and date range.",
    "version": "1.0",
    "x-build-id": "VlgPMJcUtO6jU30bf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~openfema-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-openfema-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/crawlerbros~openfema-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-openfema-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/crawlerbros~openfema-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-openfema-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Dataset",
            "enum": [
              "disasterDeclarations",
              "webDisasterDeclarations",
              "publicAssistanceProjects",
              "housingAssistance",
              "datasets"
            ],
            "type": "string",
            "description": "Which OpenFEMA dataset to query.",
            "default": "disasterDeclarations"
          },
          "state": {
            "title": "State / territory",
            "enum": [
              "AL",
              "AK",
              "AZ",
              "AR",
              "CA",
              "CO",
              "CT",
              "DE",
              "DC",
              "FL",
              "GA",
              "HI",
              "ID",
              "IL",
              "IN",
              "IA",
              "KS",
              "KY",
              "LA",
              "ME",
              "MD",
              "MA",
              "MI",
              "MN",
              "MS",
              "MO",
              "MT",
              "NE",
              "NV",
              "NH",
              "NJ",
              "NM",
              "NY",
              "NC",
              "ND",
              "OH",
              "OK",
              "OR",
              "PA",
              "RI",
              "SC",
              "SD",
              "TN",
              "TX",
              "UT",
              "VT",
              "VA",
              "WA",
              "WV",
              "WI",
              "WY",
              "PR",
              "VI",
              "GU",
              "AS",
              "MP",
              "FM",
              "MH",
              "PW"
            ],
            "type": "string",
            "description": "Two-letter state or territory code. Applies to all modes except the dataset catalog."
          },
          "incidentType": {
            "title": "Incident type",
            "enum": [
              "Hurricane",
              "Flood",
              "Severe Storm",
              "Fire",
              "Tornado",
              "Snowstorm",
              "Severe Ice Storm",
              "Winter Storm",
              "Coastal Storm",
              "Earthquake",
              "Drought",
              "Typhoon",
              "Tropical Storm",
              "Biological",
              "Mud/Landslide",
              "Dam/Levee Break",
              "Volcanic Eruption",
              "Freezing",
              "Fishing Losses",
              "Straight-Line Winds",
              "Toxic Substances",
              "Chemical",
              "Tsunami",
              "Human Cause",
              "Terrorist",
              "Other"
            ],
            "type": "string",
            "description": "Type of incident. Applies to disaster declaration and public assistance modes."
          },
          "declarationType": {
            "title": "Declaration type",
            "enum": [
              "DR",
              "EM",
              "FM"
            ],
            "type": "string",
            "description": "Declaration category. Applies to the primary disaster declarations mode only."
          },
          "region": {
            "title": "FEMA region",
            "enum": [
              "1",
              "2",
              "3",
              "4",
              "5",
              "6",
              "7",
              "8",
              "9",
              "10"
            ],
            "type": "string",
            "description": "FEMA region number (1-10). Applies to disaster declaration modes."
          },
          "programType": {
            "title": "Assistance program declared",
            "enum": [
              "any",
              "individualAndHouseholds",
              "individualAssistance",
              "publicAssistance",
              "hazardMitigation"
            ],
            "type": "string",
            "description": "Only return declarations where the chosen FEMA assistance program was activated. Applies to the disaster declaration modes (ignored for other datasets).",
            "default": "any"
          },
          "disasterNumber": {
            "title": "Disaster number",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Restrict results to a single FEMA disaster number (e.g. 4844 for Hurricane Milton)."
          },
          "fyDeclaredMin": {
            "title": "Fiscal year declared (min)",
            "minimum": 1953,
            "maximum": 2100,
            "type": "integer",
            "description": "Only declarations from this federal fiscal year onward. Applies to the primary disaster declarations mode."
          },
          "fyDeclaredMax": {
            "title": "Fiscal year declared (max)",
            "minimum": 1953,
            "maximum": 2100,
            "type": "integer",
            "description": "Only declarations up to this federal fiscal year. Applies to the primary disaster declarations mode."
          },
          "declarationDateFrom": {
            "title": "Declaration date from",
            "type": "string",
            "description": "Only declarations on or after this date (YYYY-MM-DD). Applies to disaster declaration modes."
          },
          "declarationDateTo": {
            "title": "Declaration date to",
            "type": "string",
            "description": "Only declarations on or before this date (YYYY-MM-DD). Applies to disaster declaration modes."
          },
          "county": {
            "title": "County",
            "type": "string",
            "description": "County name filter (exact match). Applies to public assistance and housing assistance modes."
          },
          "zipCode": {
            "title": "ZIP code",
            "type": "string",
            "description": "5-digit ZIP code filter (exact match). Applies to the housing assistance mode."
          },
          "projectSize": {
            "title": "Project size",
            "enum": [
              "any",
              "Small",
              "Large"
            ],
            "type": "string",
            "description": "Filter public assistance projects by FEMA project size. Applies to the public assistance projects mode.",
            "default": "any"
          },
          "damageCategory": {
            "title": "Damage category",
            "enum": [
              "any",
              "A",
              "B",
              "C",
              "D",
              "E",
              "F",
              "G",
              "Z"
            ],
            "type": "string",
            "description": "Filter public assistance projects by FEMA damage category. Applies to the public assistance projects mode.",
            "default": "any"
          },
          "housingAssistanceType": {
            "title": "Housing assistance type",
            "enum": [
              "owners",
              "renters"
            ],
            "type": "string",
            "description": "Owners or renters aggregate. Applies to the housing assistance mode.",
            "default": "owners"
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Maximum number of records to return.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}