API url

The flood map content api allows partners to access flood polygons in geojson and present them on the partner's map. Flood polygons are delivered for the bounding box with sides of length "size" and center at the lat/lng query point in EPSG 4326.

The flood map content API base url is https://api.nationalflooddata.com

Endpoint

The FEMA Flood Data API has one endpoint:

endpoint description
/floodmap flood map content query

Parameters

value description
lat latitude. required.
lng longitude. required.
size optional degree value for size of square that polygons are returned for. Default is size=0.08. Accepted values are "0.04", "0.06" and "0.08".
getgeojson optional value. When set to "False" or "false", geojson content will not be included. The geojson content can be large, so not including it is often faster. The default setting is for geojson to be included.
excludex optional value. When set to "True", polygons with flood zone (fld_zone) "X" will not be included in the query. This generally makes the response load much smaller and easier to process quickly. The default setting is for all zones, i.e. including "X", to be included in the query.
getbfe optional value. When set to "True" or "true", base flood elevations (BFE) will be included in geojson format.
Note: BFEs are available only in sample counties (e.g. Bergen, NJ) and are not currently maintained nationwide.

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.

Example python flood map content query:

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

Response

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

response element description
status response status code (string)
result list of one or more results (list of dictionaries)

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
UNKNOWN_ERROR a unknown server error occurred

Result

The flood map content API returns datafrom the s_fld_haz_ar and s_bfe FEMA shapefile layers that interstects the square centered at the point lat/lng and with sides of length twice the size parameter.

Result has the following keys:

key description
floodregions list format with keys:
dfirm_id (flood insurance rate map id),
distkm (shortest distance from query point to polygon in km),
fld_zone (flood zone),
geojson (flood polygon in geojson),
ogc_fid (polygon id),
zone_subty (zone description)
bfelist list format with keys:
bfe_ln_id (line identifier),
dfirm_id (flood insurance rate map id),
distkm (shortest distance from query point to line in km),
elev (elevation in feet),
geojson (BFE lines in geojson),
ogc_fid (polygon id),
source_cit (source citation),
version_id (version identifier),
v_datum (vertical datum)