{
  "openapi": "3.0.1",
  "info": {
    "title": "FEMA Disaster Recovery & Mitigation Projects",
    "description": "Project-level FEMA Public Assistance rebuild projects and Hazard Mitigation (HMGP, BRIC, FMA) applications from the official OpenFEMA API - including pending mitigation projects not yet funded. Filter by state, date, amount, keyword, category.",
    "version": "1.0",
    "x-build-id": "kHYPZJpv7mjHMTgYn"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/wishbone_data~fema-recovery-projects/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-wishbone_data-fema-recovery-projects",
        "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/wishbone_data~fema-recovery-projects/runs": {
      "post": {
        "operationId": "runs-sync-wishbone_data-fema-recovery-projects",
        "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/wishbone_data~fema-recovery-projects/run-sync": {
      "post": {
        "operationId": "run-sync-wishbone_data-fema-recovery-projects",
        "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": {
          "datasets": {
            "title": "Project types",
            "type": "array",
            "description": "Public Assistance = repair/rebuild of roads, bridges, buildings, utilities after declared disasters. Hazard Mitigation = HMGP / BRIC / FMA mitigation projects, including pending applications not yet funded.",
            "items": {
              "type": "string",
              "enum": [
                "publicAssistance",
                "hazardMitigation"
              ],
              "enumTitles": [
                "Public Assistance (rebuild/repair)",
                "Hazard Mitigation (HMGP, BRIC, FMA)"
              ]
            },
            "default": [
              "publicAssistance",
              "hazardMitigation"
            ]
          },
          "states": {
            "title": "States",
            "type": "array",
            "description": "Two-letter state/territory codes, e.g. WA, TX, FL. Leave empty for all states.",
            "items": {
              "type": "string"
            }
          },
          "sinceDate": {
            "title": "Only records since",
            "type": "string",
            "description": "YYYY-MM-DD. Public Assistance: last obligation date. Hazard Mitigation: date submitted to FEMA."
          },
          "minAmount": {
            "title": "Minimum project amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip projects below this total amount."
          },
          "keyword": {
            "title": "Keyword in title / activity",
            "type": "string",
            "description": "e.g. bridge, culvert, school, seawall, generator. Matches the project title (PA) or title/activity/sub-applicant (HMA)."
          },
          "damageCategories": {
            "title": "PA damage categories",
            "type": "array",
            "description": "Public Assistance only. A Debris, B Protective measures, C Roads & bridges, D Water control, E Buildings & equipment, F Utilities, G Parks/other.",
            "items": {
              "type": "string",
              "enum": [
                "A",
                "B",
                "C",
                "D",
                "E",
                "F",
                "G",
                "Z"
              ],
              "enumTitles": [
                "A - Debris Removal",
                "B - Protective Measures",
                "C - Roads and Bridges",
                "D - Water Control Facilities",
                "E - Public Buildings",
                "F - Public Utilities",
                "G - Recreational/Other",
                "Z - State Management"
              ]
            }
          },
          "hmaPrograms": {
            "title": "HMA programs",
            "type": "array",
            "description": "Hazard Mitigation only. Leave empty for all programs.",
            "items": {
              "type": "string",
              "enum": [
                "Hazard Mitigation Grant Program",
                "Building Resilient Infrastructure and Communities",
                "Flood Mitigation Assistance",
                "Hazard Mitigation Grant Program Post Fire",
                "Flood Mitigation Assistance Swift Current",
                "Pre-Disaster Mitigation",
                "Pre-Disaster Mitigation Congressionally Directed Spending"
              ]
            }
          },
          "constructionOnly": {
            "title": "HMA: construction projects only",
            "type": "boolean",
            "description": "Only mitigation sub-applications flagged as including construction.",
            "default": false
          },
          "pendingOnly": {
            "title": "HMA: pipeline only (pending, submitted, approved, subaward offered/accepted)",
            "type": "boolean",
            "description": "Excludes closed, withdrawn, denied and void applications - useful for finding upcoming work.",
            "default": false
          },
          "disasterNumbers": {
            "title": "Disaster numbers",
            "type": "array",
            "description": "Optional FEMA disaster numbers, e.g. 4834.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max results per project type",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many records for each selected project type. 0 = no limit.",
            "default": 1000
          },
          "includeRawRecord": {
            "title": "Include raw OpenFEMA record",
            "type": "boolean",
            "description": "Adds every original OpenFEMA field under 'raw' (HMA has 80+ fields).",
            "default": false
          },
          "enrichApplicants": {
            "title": "Add applicant names (Public Assistance)",
            "type": "boolean",
            "description": "Looks up each PA applicant ID (a public agency, district or non-profit) and adds its name, city and address. Adds a few seconds per 1,000 records.",
            "default": true
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}