Skip to content
This repository was archived by the owner on Jan 18, 2023. It is now read-only.

FEMA NFIP

Kelvin edited this page May 20, 2021 · 9 revisions

FEMA NFIP Method

fema.get_nfip(
    search_items, 
    location_type, 
    csv=False, 
    output_dir='/output'
)

Provides information on the number of policies, number of claims, amount of coverage, and amount paid on claims for buildings and contents as well as the increased cost of compliance for the location.

This method returns an array of FemaNfip product for the given IDs and location_type. Optionally creates a csv file.

(More information on the FEMA NFIP product can be found on the FEMA NFIP Page on the First Street Foundation API Data Dictionary)

Arguments:

  • search_items: list/file of SearchItems, parcels to retrieve NFIP details for.
  • location_type: string, one of {zcta, tract, county, state}, for the search item type.
  • csv: bool, whether to create a CSV for the retrieved data.
  • output_dir: string, location to output the created CSV (if csv is True).

Example (Command Line):

Call fema.get_nfip on a list of FSIDs

python -m firststreet -p fema.get_nfip -s 50156;50158;43935 -l zcta
python -m firststreet -p fema.get_nfip -s 19153004900;39061007100;39153531702 -l tract
python -m firststreet -p fema.get_nfip -s 19163;19047;39027 -l county
python -m firststreet -p fema.get_nfip -s 19;39 -l state

Call fema.get_nfip on a lat/lng or address

python -m firststreet -p fema.get_nfip -s 37.16314,-76.55782;38.50303,-106.72863 -l zcta
python -m firststreet -p fema.get_nfip -s "New York";"Ohio" -l state

Call fema.get_nfip on a file of SearchItems

python -m firststreet -p fema.get_nfip -s sample_zcta.txt -l zcta
python -m firststreet -p fema.get_nfip -s sample_tract.txt -l tract
python -m firststreet -p fema.get_nfip -s sample_county.txt -l county
python -m firststreet -p fema.get_nfip -s sample_state.txt -l state

Example (Python File):

# Contents of sample.py
# Create a `FirstStreet` object.  
import firststreet
fs = firststreet.FirstStreet("api-key")

import firststreet
api_key = os.getenv("FSF_API_KEY")
fs = firststreet.FirstStreet(api_key)

# Call fema.get_nfip on a list of FSIDs
fema_nfip = fs.fema.get_nfip(search_items=[50156, 50158, 43935], location_type="zcta", csv=True)
fema_nfip = fs.fema.get_nfip(search_items=[19153004900, 39061007100, 39153531702], location_type="tract", csv=True)
fema_nfip = fs.fema.get_nfip(search_items=[19163, 19047, 39027], location_type="county", csv=True)
fema_nfip = fs.fema.get_nfip(search_items=[19, 39], location_type="state", csv=True)

# Call fema.get_nfip on a lat/lng or address
fema_nfip = fs.fema.get_nfip(search_items=[(37.16314,-76.55782)], location_type="county", csv=True)
fema_nfip = fs.fema.get_nfip(search_items=["New York"], location_type="state", csv=True)

# Call fema.get_nfip on a file of SearchItems
fema_nfip = fs.fema.get_nfip(search_items="sample_zcta.txt", location_type="zcta", csv=True)
fema_nfip = fs.fema.get_nfip(search_items="sample_tract.txt", location_type="tract", csv=True)
fema_nfip = fs.fema.get_nfip(search_items="sample_county.txt", location_type="county", csv=True)
fema_nfip = fs.fema.get_nfip(search_items="sample_state.txt", location_type="state", csv=True)

FemaNfip Objects

FemaNfip Object

Key Type Description Example
fsid str First Street ID (FSID) is a unique identifier assigned to each location. 392804911
valid_id bool Whether the input FSID returned valid data from the server. True
claimCount int The total count of entries in the claims dataset for the location. The claims data is sourced from FEMA's release of anonymized claims data in March of 2019. For county and tract queries, the geography is matched to the FIPS code. For ZIP queries, the reported ZIP of the property is used. 8
policyCount int The total count of National Flood Insurance Program (NFIP) insurance policies for the location from the Federal Emergency Management Agency (FEMA) dataset. 2
buildingPaid int The total sum cost in US dollars paid on the claims related to buildings. The claims data is sourced from FEMA's release of anonymized claims data in March of 2019. For county and tract queries, the geography is matched to the FIPS code. For ZIP queries, the reported ZIP of the property is used. 10000
contentPaid int The total sum cost in US dollars paid on the claims related to the contents of buildings. The claims data is sourced from FEMA's release of anonymized claims data in March of 2019. For county and tract queries, the geography is matched to the FIPS code. For ZIP queries, the reported ZIP of the property is used. 5000
buildingCoverage int The total sum in US dollars of insurance coverage on buildings through National Flood Insurance Program (NFIP) insurance policies for the location. 20000
contentCoverage int The total sum in US dollars of insurance coverage on contents of buildings through National Flood Insurance Program (NFIP) insurance policies for the location. 12350
iccPaid int The total sum in US dollars paid on the Increased Cost of Compliance (ICC) claims for the location. ICC coverage is one of several flood insurances resources for policyholders who need additional help rebuilding after a flood. It provides up to $30,000 to help cover the cost of mitigation measures that will reduce the flood risk. 1000
Clone this wiki locally