# FEMA Disaster Declarations Feed (`your_friendly_developer/fema-disaster-feed`) Actor

- **URL**: https://apify.com/your_friendly_developer/fema-disaster-feed.md
- **Developed by:** [Jason Ramirez](https://apify.com/your_friendly_developer) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 declaration rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Declarations Feed

An Apify Actor that requests disaster declaration records from the public OpenFEMA DisasterDeclarationsSummaries endpoint and writes normalized rows to the default dataset. No API key is required according to the supplied project brief. Live endpoint behavior has not been verified in this build.

For restoration and roofing contractors watching declared counties, insurance and mortgage teams, and researchers.

One declaration produces one row per designated area. A single disaster therefore appears once per county or area it covers. The Actor preserves these API records without combining areas or inventing missing values.

### Inputs

All filters are optional. Dates are UTC calendar dates, inclusive at both ends. The query uses `ge` on the start and `lt` on the day after the end. Defaults are computed at runtime: from 90 days before today through today. The default limit is 200 rows, with an allowed range of 1 through 10000. States are normalized to uppercase. Multiple values within a filter are ORed; different filters are ANDed.

```json
{
  "states": ["FL", "TX"],
  "declarationTypes": ["DR", "EM"],
  "incidentTypes": ["Hurricane", "Flood"],
  "declaredFrom": "2026-09-01",
  "declaredTo": "2026-10-31",
  "limit": 200
}
```

Use `{}` for the runtime defaults. Declaration types are DR (major disaster), EM (emergency), and FM (fire), as described in the project brief. Incident values are passed through exactly, with OData string escaping.

### Output

| Field | Value |
| --- | --- |
| disasterNumber | API disaster identifier, or null |
| femaDeclarationString | API declaration string, or null |
| state | API state code, or null |
| declarationType | API declaration type, or null |
| incidentType | API incident type, or null |
| title | declarationTitle, or null |
| declarationDate | API date string, or null |
| incidentBeginDate | API date string, or null |
| incidentEndDate | API date string, or null |
| designatedArea | API designated area, or null |
| fiscalYearDeclared | fyDeclared, or null |
| iaProgramDeclared | Boolean or null |
| paProgramDeclared | Boolean or null |
| hmProgramDeclared | Boolean or null |
| retrievedAt | Run timestamp in UTC ISO format |
| source | OpenFEMA |

Program flags accept booleans, numeric 0/1, and strings `0`, `1`, `true`, `false`. Missing or unrecognized flags remain null.

### Summary and limits

The default key-value store receives `LAST_RUN_SUMMARY` with `runAt`, `windowFrom`, `windowTo`, `totalReportedByApi`, `emitted`, `complete`, and `notes`. Unknown totals remain null. A successful empty result is valid and explicitly noted. A paging failure retains gathered rows and sets `complete: false` with the failed offset. A first-page failure stores the summary and throws to fail the run. Reaching the row limit with additional or unknown records sets `complete: false`.

Requests use a maximum page size of 1000, skip offsets, descending declaration date order, and a 60-second request timeout. There are no automatic retries. Offset paging is not a transactional snapshot; concurrent source changes can affect results, and equal-date records have no additional sort key. API counts are reported as supplied rather than independently verified.

Declarations are added and amended by FEMA on its own schedule. This feed is not a forecast or an assurance of eligibility, coverage, or funding. The API response shape and live filter compatibility are asserted from the supplied brief; tests use synthetic fixtures only.

### Local run

Node.js 20 or later is required. Install dependencies with `npm install`, then run `npm start`. For local Apify storage, place input JSON at `storage/key_value_stores/default/INPUT.json`. Dataset output and `LAST_RUN_SUMMARY` use the SDK default stores. The Dockerfile uses the Apify Node 22 base image.

Run `npm test` for offline tests. They use Node's built-in test runner, injected fetch functions, and local fixtures; no dependency installation or network is needed for these tests.

### Publication gate

This build does not publish or configure billing. Pay-per-event per-row monetization, including any required SDK charge integration and event identifier, must be configured and verified by the owner before publication. No price or demand claim is made. No live API run, dependency installation, Docker build, or Apify runtime integration has been performed here.

# Actor input Schema

## `states` (type: `array`):

US state codes to filter declarations by, for example FL or TX.

## `declarationTypes` (type: `array`):

Declaration types to include, for example DR (major disaster), EM (emergency), or FM (fire management).

## `incidentTypes` (type: `array`):

Incident types to include, for example Hurricane, Flood, or Fire.

## `declaredFrom` (type: `string`):

Only return declarations on or after this date (YYYY-MM-DD).

## `declaredTo` (type: `string`):

Only return declarations on or before this date (YYYY-MM-DD).

## `limit` (type: `integer`):

Maximum number of declaration rows to return. One row per designated area.

## Actor input object example

```json
{
  "limit": 200
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing all normalized declaration rows

## `keyValueStore` (type: `string`):

Default key-value store holding the LAST_RUN_SUMMARY record

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("your_friendly_developer/fema-disaster-feed").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("your_friendly_developer/fema-disaster-feed").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 '{}' |
apify call your_friendly_developer/fema-disaster-feed --silent --output-dataset

```

## MCP server setup

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

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/fjSSdOYdcMFJ4FLPZ/builds/hekfO8ZU8iiLTYswy/openapi.json
