# FEMA Disaster & Emergency Declarations Scraper (`datapilot/fema-disaster-emergency-declarations-scraper`) Actor

Scrapes recent FEMA disaster declarations with optional state and incident-type filters. Returns disaster notice, type, location, date, FEMA link, and scrape timestamp.

- **URL**: https://apify.com/datapilot/fema-disaster-emergency-declarations-scraper.md
- **Developed by:** [Data Pilot](https://apify.com/datapilot) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 scraped results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

🚨 **FEMA Disaster & Emergency Declarations** Scraper is a powerful Apify Actor designed to discover, track, and collect official **FEMA Disaster & Emergency Declarations** directly from FEMA's OpenFEMA API. This tool provides comprehensive **FEMA Disaster & Emergency Declarations** intelligence including declaration title, incident type, affected location, declaration date, and direct listing link for any state or incident type. Whether you're building an emergency-response dashboard, tracking disaster trends, or conducting risk research, the FEMA Disaster & Emergency Declarations Scraper delivers actionable **FEMA Disaster & Emergency Declarations** insights efficiently.

With direct OpenFEMA API integration, OData filtering, automatic historical fallback, and reliable Apify Dataset delivery, the FEMA Disaster & Emergency Declarations Scraper ensures comprehensive **FEMA Disaster & Emergency Declarations** coverage across any state, incident type, or date window. It focuses on key **FEMA Disaster & Emergency Declarations** signals including type, location, and date, making it an essential tool for emergency management research and disaster-risk intelligence.

***

### 📋 Table of Contents

- [Features](#-features)
- [Data Source](#-data-source)
- [How It Works](#-how-it-works)
- [Input](#-input)
- [Output](#-output)
- [Technical Stack](#-technical-stack)
- [Data Fields](#-data-fields-explained)
- [Use Cases](#-use-cases)
- [Quick Start](#-quick-start)
- [Configuration](#-configuration)
- [Performance](#-performance)
- [Important Notes](#-important-notes)
- [License & Legal](#-license--legal)

***

### 🔥 Features

- **OpenFEMA API Integration** – Direct integration with FEMA's official Disaster Declarations Summaries API for accurate **FEMA Disaster & Emergency Declarations** data.
- **State-Level Filtering** – Narrow **FEMA Disaster & Emergency Declarations** results to a specific U.S. state using standard state codes.
- **Incident Type Filtering** – Filter declarations by incident type (e.g., Fire, Hurricane, Severe Storm) with automatic title-case normalization.
- **Configurable Date Window** – Search declarations from any number of days back via `daysBack`.
- **OData Query Building** – Constructs proper OData `$filter` expressions combining date, state, and incident type conditions.
- **Automatic Historical Fallback** – Falls back to the most recent matching declarations if no results are found within the requested date window.
- **Paginated Fetching** – Automatically pages through results using `$top`/`$skip` until `maxResults` is reached.
- **Proxy Fallback Handling** – Automatically retries without a proxy if a proxied request fails.
- **Residential Proxy Support** – Optional Apify residential proxy for reliable **FEMA Disaster & Emergency Declarations** access.
- **Retry Logic with Backoff** – Automatically retries failed requests with increasing delay between attempts.
- **Incremental Dataset Push** – Pushes each page's **FEMA Disaster & Emergency Declarations** records to Apify Dataset immediately.
- **Detailed Logging** – Comprehensive progress logging for every stage of the **FEMA Disaster & Emergency Declarations** run.

***

### 📊 Data Source

#### **OpenFEMA Disaster Declarations Summaries API**

- **Authority**: Official U.S. Federal Emergency Management Agency (FEMA) open data platform
- **Endpoint**: `fema.gov/api/open/v2/DisasterDeclarationsSummaries`
- **Coverage**: All U.S. states and territories with federally declared disasters and emergencies
- **Data**: Declaration title, incident type, location, declaration date, and disaster page link
- **Access**: Public, key-less JSON API
- **Update Frequency**: Reflects FEMA's current official declarations at time of run

***

### ⚙️ How It Works

The FEMA Disaster & Emergency Declarations Scraper accepts an optional state, incident type, and lookback window, then builds an OData filter expression combining all three conditions. It queries the OpenFEMA API in pages, ordered by most recent declaration date, normalizing each result into a clean record with title, incident type, location, date, and a direct link to the disaster's FEMA page. If no declarations are found within the requested date window, the Actor automatically falls back to fetching the most recent historical declarations matching the same state/type filters, so a run never returns empty due to an overly narrow date range. Every batch of **FEMA Disaster & Emergency Declarations** records is pushed to the Apify Dataset as it's collected.

**Key Processing Steps:**

1. **Input Parsing** – Accept state, incident type, days-back window, and result cap
2. **Proxy Setup** – Configure Apify residential proxy if enabled
3. **Filter Construction** – Build an OData `$filter` expression from date, state, and incident type
4. **Session Init** – Create a Chrome-impersonated HTTP session for reliable API access
5. **Page Loop** – Request successive pages of **FEMA Disaster & Emergency Declarations** using `$top`/`$skip`
6. **Record Normalization** – Build a clean record with notice, type, location, date, and link
7. **Incremental Push** – Push each page's records immediately as they're fetched
8. **Result Capping** – Stop once `maxResults` is reached or no further items are returned
9. **Historical Fallback** – Re-query without a date filter if zero results were found initially
10. **Proxy Fallback** – Retry without a proxy if the proxied request fails
11. **Rate Limiting** – Apply a short delay between page requests
12. **Summary Logging** – Report the total number of declarations collected

**Key Benefits:**

- Pull official **FEMA Disaster & Emergency Declarations** for any state or incident type without manual searching
- Never come back empty thanks to automatic historical fallback
- Track new federal disaster activity as it's declared
- Feed emergency-response dashboards, risk-assessment tools, or research pipelines
- Automate recurring **FEMA Disaster & Emergency Declarations** checks as new events are declared

***

### 📥 Input

The Actor accepts the following input parameters:

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `state` | string | `""` | Two-letter U.S. state code to filter **FEMA Disaster & Emergency Declarations** by (e.g., "CA", "TX"). |
| `incidentType` | string | `""` | Incident type to filter by (e.g., "Fire", "Hurricane", "Severe Storm"). |
| `daysBack` | integer | `90` | Number of days back from today to search for declarations. |
| `maxResults` | integer | `100` | Maximum number of **FEMA Disaster & Emergency Declarations** records to collect. |
| `proxyConfiguration` | object | `{"useApifyProxy": true}` | Apify Proxy configuration. |

**Example Input:**

```json
{
  "state": "FL",
  "incidentType": "Hurricane",
  "daysBack": 180,
  "maxResults": 100
}
```

**Search Nationwide for Recent Declarations:**

```json
{
  "daysBack": 30
}
```

**Search a Specific State Only:**

```json
{
  "state": "CA",
  "maxResults": 50
}
```

***

### 📤 Output

The Actor pushes **FEMA Disaster & Emergency Declarations** records with the following structure:

| Field | Type | Description |
|-------|------|-------------|
| `notice` | string | Official declaration title |
| `type` | string | Incident type (e.g., Fire, Flood, Hurricane) |
| `location` | string | Affected area and state |
| `date` | string | Declaration date (`YYYY-MM-DD`) |
| `link` | string | Direct URL to the **FEMA Disaster & Emergency Declarations** page |
| `scraped_at` | string | ISO 8601 timestamp of when the record was scraped |

**Example FEMA Disaster & Emergency Declarations Record:**

```json
{
  "notice": "Florida Hurricane Milton",
  "type": "Hurricane",
  "location": "Sarasota County, FL",
  "date": "2026-07-22",
  "link": "https://www.fema.gov/disaster/4801",
  "scraped_at": "2026-08-17T09:00:00.000Z"
}
```

***

### 🧰 Technical Stack

- **API:** OpenFEMA Disaster Declarations Summaries API (JSON, OData-filterable)
- **HTTP Client:** `curl_cffi` with Chrome TLS fingerprint impersonation for reliable **FEMA Disaster & Emergency Declarations** access
- **Query Language:** OData `$filter`, `$orderby`, `$top`, `$skip` for filtering and pagination
- **Date Handling:** `date`/`datetime` with timezone-aware UTC timestamps
- **Async:** `asyncio` with executor-run blocking requests for non-blocking page fetching
- **Proxy:** Apify Proxy, optional via `useApifyProxy`, with automatic no-proxy fallback on failure
- **Logging:** Apify Actor logging system
- **Platform:** Apify Actor serverless environment

***

### 📊 Data Fields Explained

#### **Identification**

- **notice / link**: The official declaration title and direct link to the **FEMA Disaster & Emergency Declarations** page

#### **Incident Details**

- **type**: The category of disaster or emergency (e.g., Hurricane, Fire, Flood)
- **location**: The designated area and state affected

#### **Timing**

- **date**: The official declaration date
- **scraped\_at**: When this **FEMA Disaster & Emergency Declarations** record was collected

***

### 🎯 Use Cases

- **Emergency Management** – Track active and historical **FEMA Disaster & Emergency Declarations** by state or type
- **Risk Assessment** – Analyze disaster frequency and type patterns for insurance or planning purposes
- **Academic Research** – Study disaster trends and federal response patterns at scale
- **News & Media Monitoring** – Source authoritative declaration data for disaster reporting
- **Nonprofit & Relief Coordination** – Identify newly declared disaster areas for aid deployment
- **Policy Analysis** – Monitor federal disaster response activity over time
- **Real Estate & Insurance Research** – Cross-reference property locations against declared disaster history
- **Alert Systems** – Build recurring state or incident-type alerts for new declarations

***

### 🚀 Quick Start

#### **1. Prepare Input**

Go to Apify Console and enter:

```json
{
  "state": "TX",
  "daysBack": 60,
  "maxResults": 50
}
```

#### **2. Run the Actor**

Click **Start**. The Actor will:

- Build an OData filter from your state, type, and date window
- Query the OpenFEMA API and page through results
- Fall back to historical data automatically if nothing matches the date window
- Push each batch of **FEMA Disaster & Emergency Declarations** records to the Dataset

#### **3. Monitor Progress**

Console shows:

```
🚨 Querying FEMA declarations for the last 60 days (State: TX)...
🎉 Complete! Successfully collected 18 FEMA declarations.
```

#### **4. View & Download Results**

- **Results Tab**: All **FEMA Disaster & Emergency Declarations** records
- **Export**: JSON, CSV, Excel, or HTML
- **Filter**: By state, incident type, or date
- **API Access**: Available via the Apify API

***

### ⚙️ Configuration

State and type filtered:

```json
{
  "state": "LA",
  "incidentType": "Flood"
}
```

Nationwide, most recent:

```json
{
  "daysBack": 14,
  "maxResults": 100
}
```

No filters, broad historical pull:

```json
{
  "daysBack": 365,
  "maxResults": 200
}
```

***

### 📈 Performance

#### **Processing Speed**

- One request per page of up to 100 declarations, with automatic retry on failures
- 0.3 second delay between page requests to reduce blocking
- Automatic historical fallback adds one additional request only when needed

#### **Resource Usage**

- Memory: Low, since no browser instance is launched
- Network: One request per result page, plus a fallback request if applicable
- Proxy: Optional residential proxy tunnel with automatic no-proxy fallback on failure

***

### ⚠️ Important Notes

#### **Legal & Compliance**

- **Fair Use**: Respects the OpenFEMA public API and applies pacing delays between requests
- **Public Data Only**: Retrieves only publicly published **FEMA Disaster & Emergency Declarations**
- **Legal**: Not legal, emergency-management, or insurance advice — consult official FEMA resources and qualified professionals for decisions based on this data

#### **Data Quality**

- **Freshness**: Reflects OpenFEMA's published declarations at time of run
- **Completeness**: Very recent or narrow date windows may trigger the historical fallback if no declarations exist yet
- **Accuracy**: Sourced directly from FEMA's official OpenFEMA API
- **Verification**: Cross-check high-stakes figures against the official FEMA disaster page for each declaration

#### **Best Practices**

- Combine `state` and `incidentType` filters together for the most targeted **FEMA Disaster & Emergency Declarations** results
- Increase `daysBack` for broader historical coverage, or keep it short for the freshest declarations
- Watch the logs for the historical fallback notice, which indicates your date window returned no fresh matches
- Re-run periodically to catch newly issued declarations
- Always verify details directly on the official FEMA disaster page before using them for critical decisions

***

### 📄 License & Legal

**Terms of Use:**

- Use for legitimate research, emergency planning, and risk-assessment purposes
- Respect FEMA's OpenFEMA API terms of use
- Attribute FEMA/OpenFEMA as the original data source where required
- Use data responsibly

**Disclaimer:**
FEMA Disaster & Emergency Declarations Scraper is provided as-is for research and informational purposes. Users are responsible for compliance with OpenFEMA's terms of use. This is not legal, emergency-management, or insurance advice — always verify critical details directly on FEMA's official website.

***

### ⚖️ FEMA Disaster & Emergency Declarations Excellence

This Actor is optimized for **FEMA Disaster & Emergency Declarations** research with:

- ✅ State and incident-type filtered search
- ✅ OData-powered date, state, and type filtering
- ✅ Automatic historical fallback for zero-result windows
- ✅ Incremental, real-time Dataset push
- ✅ Retry logic with proxy fallback
- ✅ Production-ready code

# Actor input Schema

## `state` (type: `string`):

Two-letter US state or territory code (e.g., 'FL', 'CA', 'TX'). Leave empty for nationwide.

## `incidentType` (type: `string`):

Filter by disaster type (e.g., 'Hurricane', 'Flood', 'Fire', 'Severe Storm'). Leave blank for all types.

## `daysBack` (type: `integer`):

How many days back to search by declaration date.

## `maxResults` (type: `integer`):

Maximum number of declarations to fetch.

## `proxyConfiguration` (type: `object`):

Proxy settings to prevent IP bans or network blocks.

## Actor input object example

```json
{
  "state": "FL",
  "incidentType": "",
  "daysBack": 90,
  "maxResults": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `crawlResults` (type: `string`):

No description

## `declarationsOverview` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "state": "FL",
    "incidentType": "",
    "daysBack": 90,
    "maxResults": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("datapilot/fema-disaster-emergency-declarations-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "state": "FL",
    "incidentType": "",
    "daysBack": 90,
    "maxResults": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("datapilot/fema-disaster-emergency-declarations-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "state": "FL",
  "incidentType": "",
  "daysBack": 90,
  "maxResults": 50
}' |
apify call datapilot/fema-disaster-emergency-declarations-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datapilot/fema-disaster-emergency-declarations-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/dken5HMvE2a8iDICw/builds/g8gXY4f23AFLuvtc9/openapi.json
