API url

The FEMA Flood Data API base url is https://api.nationalflooddata.com

Endpoint

The FEMA Flood Data API has one endpoint:

endpoint description
/data Fema Flood Data query

Access, Rate Limiting

National Flood Data now uses Amazon Web Services' API Gateway for our API access. Queries to the API require a key provided by National Flood Data, and the key must be provided in a request header using the key "x-api-key". The key cannot be supplied as a parameter, and therefore the API cannot be accessed through a simple web browser. Please see the example querries below.

The API Gateway implements a rate limit of four requests per second with a burst limit of three, i.e. at most three requests will be processed simultaneously.

The legacy url https://flood.nationalflooddata.com is still maintained for implementations prior to 2018.

Parameters

A query uses either an address, parcel identifier or a latitude/longitude pair of coordinates. The requirements for each search type are the following. For address searches, the address is first geocoded and then the nearest parcel is used. For coordinate searches, the nearest parcel is used.

value description
searchtype 'addresscoord', 'addressparcel', 'coord', 'coordparcel' or 'parcel'
address address with street number, street type, city, state, zip and without punctuation, e.g. "12 Maple Pl Mapleville KS 12345". Required for searchtypes addresscoord and addressparcel. Do not include 4 digit zipcode extension.
apn assessor's parcel number. remove dashes if any. required for searchtype parcel.
county written with spaces, e.g. San Luis Obispo. required for searchtype parcel.
lat latitude. required for searchtype coord.
lng longitude. required for searchtype coord.
state state initials in all capital letters, e.g. CA. required for searchtype parcel.
getloma set to "False" or "false" to not include LOMA updates in response; default is "True". LOMAs are often a long list of entries, so excluding the query can save time.

Search type descriptions

searchtype description
addresscoord address is supplied, converted to coordinates, flood data is queried using point intersection
addressparcel address is supplied, converted to coordinates, closest parcel to coordinates selected, flood data is queried using parcel intersection
coord coordinates are supplied, flood data is queried using point intersection
coordparcel coordinates are supplied, closest parcel to coordinates selected, flood data is queried using parcel intersection
parcel parcel parameters are supplied, flood data is queried using parcel intersection

Example python queries

The examples below use the requests python module.

Example addresscoord query:

headers = {'x-api-key':'your_key'}
payload = {
    'lat':34.071783,
    'lng':-118.2596,
    'searchtype':'addresscoord',
    'getloma':'False'
    }
s = requests.get('https://api.nationalflooddata.com/data',headers=headers,params=payload)

Example addressparcel query:

headers = {'x-api-key':'your_key'}
payload = {
    'address':'703 E Maple Ave, Lompoc, CA 93436',
    'searchtype':'addressparcel',
    'getloma':'False'
    }

s = requests.get('https://api.nationalflooddata.com/data',headers=headers,params=payload)

Example coord query:

headers = {'x-api-key':'your_key'}
payload = {
    'lat':34.071783,
    'lng':-118.2596,
    'searchtype':'coord',
    'getloma':'False'
    }
s = requests.get('https://api.nationalflooddata.com/data',headers=headers,params=payload)

Example coordparcel query:

headers = {'x-api-key':'your_key'}
payload = {
    'lat':34.071783,
    'lng':-118.2596,
    'searchtype':'coordparcel',
    'getloma':'False'
    }
s = requests.get('https://api.nationalflooddata.com/data',headers=headers,params=payload)

Example parcel query:

headers = {'x-api-key':'your_key'}
payload = {
    'apn':'4034426000',
    'county':'San Diego',
    'state':'CA',
    'searchtype':'parcel',
    'getloma':'False'
    }
s = requests.get('https://api.nationalflooddata.com/data',headers=headers,params=payload)

Example curl query

Below is one example of an 'addresscoord' query using curl. The other endpoints and parameters can by adapted from this example. Note that the address has been encoded to url, in particular space has been replaced by '%20'.

    curl --request GET -H "x-api-key: your_key"  "https://api.nationalflooddata.com/data?searchtype=addresscoord&getloma=false&address=703%20E%20Maple%20Ave,%20Lompoc,%20CA%2093436"

Response

The response is in json format and has the following top level elements:

response element description
status response status code (string)
request initial request parameters (dictionary)
parceladdress address of the parcel (dictionary)
geocode geocode details for searchtypes addresscoord and addressparcel (dictionary)
coords lat/lng, centroid of parcel for searchtypes 'addressparcel', 'coordparcel' and 'parcel' (dictionary)
result list of one or more results (list of dictionaries)
mappng hyperlink to map png file for searchtype addresscoord

Status codes are the following.

status code description
OK no errors occurred
INVALID_KEY authentication key denied or not provided
INVALID_REQUEST invalid or missing request parameters
INVALID_ADDRESS address invalid because it does not have 'address' place_type, as explained below
NO_PARCEL_FOUND parcel not in parcel records
UNKNOWN_ERROR a unknown server error occurred

Address fields are the following.

fields
parceladdress addr_number, addr_street_prefix, addr_street_name, addr_street_suffix, addr_street_type, county_name, county_id, muni_name, parcel_id, physcity, physzip, state_abbr

National Flood Data uses the MapBox geocoder, and the geocode fields are those returned by MapBox.

The geocode fields are:

fields
lat latitude
lng longitude
place_name a text version of the address, e.g. "92 Pike St, Seattle, WA 98101"
place_type 'address', 'city', etc. Only 'address' should be used; all others are two general.
relevance the quality of the match on a range from 0 to 1.

Warning: If the address provided does not include a street number, the geocoder will still return a latitude and longitude for the street, and the api will return the flood data for this latitude and longitude. This response should not be used or relayed to another party because it does not correspond to a specific address.

Result

The FEMA Flood Data API returns data from interstections of the parcel with feature layers of FEMA shapefiles, as well as the community participation status and the census tract number.

Result has the following keys:

key description
s_fld_haz_ar list of fields from the intersection with FEMA layer s_fld_haz_ar; one dictionary per intersection (details below)
s_firm_pan list of fields from the intersection with FEMA layer s_firm_pan; one dictionary per intersection (details below)
s_pol_ar list of fields from the intersection with FEMA layer s_pol_ar; one dictionary per intersection (details below)
comm_part community participation: True or False. See the NFIP Community Status Book
fhbm Date of first flood hazard boundary map. Returned as unformatted text.
firm Date of first flood insruance rate map. Returned as unformatted text.
curreff Date current firm became effective. Returned as unformatted text. Can be several weeks into the future, in which case (>) follows the date. The date may also be followed by (M) for "No elevation determined", (S) for "Suspended Community" or (E) for "Indicates Entry in Emergency Program"notes
tribal Whether or not the community is identified as Tribal in the NFIP Community Status Book
census_block census tract number (State id + county id + census tract + block group number)
loma list of letters of map ammendment (details below)

The layers, fields and descriptions of those fields are below. All notation and names are those provided by FEMA.

Layer: s_fld_haz_ar
field description
dfirm_id flood insurance rate map id
fld_ar_id polygon id
fld_zone flood zone
sfha_tf special flood hazard area
source_cit source
version_id version id
zone_subty text description of zone, available occasionally
Layer: s_firm_pan
field description
eff_date effective date
dfirm_id flood insurance rate map id
fimr_pan NFIP Map Number of Community-Panel Number onb a Standard Flood Hazard Determination Form
firm_id polygon id
panel panel
panel_typ panel type (e.g. countywide, village, city)
pnp_reason
st_fips state id or fips
suffix
Layer: s_pol_ar
field description
cid community id or number
comm_no community number
com_nfo_id community id (state id + community number)
co_fips county id or county fips
pol_ar_id polygon id
pol_name1 municipal name, e.g. city or county
Letters of Map Ammendment
field description
casenumber case number
cid community id or number
communityn community name
dateended document date
determinat almost always "DetermLetter"
lat latitude provided by FEMA
lon longitude provided by FEMA
miles distance from lat/lng provided in query or center of parcel to FEMA lat/lng georeference for LOMA in miles
pdfhyperli primary component provided by FEMA for url of pdf letter, e.g. 12-09-2853A-060284
pdflink url of pdf letter, e.g.
https://msc.fema.gov/portal/downloadProduct?productID=12-09-2853A-060284
projectcat project category: LOMA, LOMR-F, LOMR-FW, LOMR-VZ
projectnam project name (often an address)
status almost always "completed"