Disaster Response Data Sources
Tags: disasters, api
Published: 2019-10-24 22:35:13

I recently wrapped up work on a few different disaster related apps and wanted to share some of my thoughts on the data sources I used. I’ll talk about my use cases for each source and discuss other important details like cost and the overall quality/usefulness of the data exposed. Obviously this isn’t an exhaustive list but my hope is that this will help jumpstart someone’s research as they start planning a disaster focused app. 

##HERE Weather

**[API Documentation](https://developer.here.com/documentation/weather/topics/overview.html)**

- HERE Weather provides weather forecasts, reports, and detailed information about the current  conditions at specific places. 
- The API can also compile NWS alerts (for US locations) and international weather alerts based on a search query. 
- Astrology related data can be queried (sun rise, sun set, moon phases). 
- The most coverage seems to be North America + EU countries.
- Other international locations can be limited to current conditions and basic forecast data (no weather alerts). 
- Overall, HERE Weather features are similar to other major weather related APIs except for its generous freemium plan (250k monthly requests for free).

For one app, I used HERE Weather to get near real time data on a list of cities that were within the general radius of an ongoing disaster. Here’s an example of the endpoint and it’s resulting data.

`https://weather.api.here.com/weather/1.0/report.json?app_id={APP ID}&app_code={APP CODE}&product=observation&name=Berlin-Tegel`

**[Result](https://developer.here.com/documentation/weather/topics/example-weather-observation.html)** (*You'll be able to see the example data after scrolling down the page*)

Thanks to the 250,000 monthly calls available (about 8,333 daily) in the free tier of the API, I was able to poll the HERE servers every fairly often from my own server and then forward the updates to the front end of my app resulting in near real time weather data being displayed. I think this is the biggest area where HERE really stands out because many competitors would charge a significant amount to let you poll their servers at higher rates. Getting prototypes off the ground and keeping costs low should be much easier with HERE. 

I did run into an issue with the alerts endpoint where I had expected results for a location in Asia but never ended up getting this data after a major storm passed directly through the region. From what I understand the alerts endpoint is much more reliable for US/EU locations so I wanted to mention that since it may not be obvious from the API documentation.

## National Weather Service API

**[API Documentation](https://www.weather.gov/documentation/services-web-api)**

- Provides weather forecasts, reports, and alerts about the US and its territories
- Free to use
- Currently uses an authentication string to identify your app - this can be whatever you want, no account creation needed
- No published rate limits although users should use best practices and not bombard the system. 

HERE Weather and the NWS API overlap a little bit but I wanted to mention the NWS API because it’s a great source of free and reliable data for the US and its territories. While the forecasts and report endpoints are great, in my opinion their alerts endpoint is the most useful feature of the API. For my use case I wanted to get a list of all weather alerts for a given US state.  
             
Example GET request - `https://api.weather.gov/alerts/active/area/CA`

The above URL will list every active alert in California along with the areas impacted and a text summary of the event.  You may need to do a little data cleanup/formatting because some of the raw data can be tough to read but overall this API can give your end users access to some very insightful data.

**[List of the full range of events the API returns data for](https://www.weather.gov/lwx/WarningsDefined)**

It should also be mentioned that many other weather related APIs incorporate NWS data into their own systems.

##USGS Earthquakes

**[API Documentation](https://www.weather.gov/documentation/services-web-api)**

- Returns detailed earthquake information from USGS resources
- Results can be narrowed down by magnitude, location, time, PAGER level, etc.
- CSV, GeoJSON. KML, Quakeml, text, XML, formats
- Free to use

Another resource I found to be very useful was the US Geological Survey API. The data can be used as a source for up to date seismic event information and can also be used as a way to query historical earthquake data.  Each event that the API returns usually includes a link to a visual summary of the raw data. 

**[Here’s an example](https://earthquake.usgs.gov/earthquakes/eventpage/us70005xr7/executive.)**

**[Example of all recent significant earthquakes](https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/significant_day.geojson)**

During the July 2019 earthquakes in California I ran into an issue where the API suddenly started returning CORS errors. I followed up with the webmasters in charge of the API and they confirmed that this was due to a sudden spike of up to 50k requests a second in the immediate aftermath of the earthquakes. They did mention that work was ongoing to make sure these services remain stable during disasters. 

##Relief Web

**[API Documentation](https://apidoc.rwlabs.org/)**

- Grants access to Relief Web archives going back to 1970s
- Free to use - 1000 calls a day
- Endpoints - reports, disasters, countries, jobs, training, sources, faq, blog, book and references.
- Bulk of content is humanitarian reports on past and ongoing disasters. 

Relief Web in my experience has been a really solid source for in depth summary information that helps give perspective to some of the raw data being displayed elsewhere in my apps. Obviously these reports take time to be written/published so they aren’t always available immediately after a disaster. The data returned by the API is usually linked to other related hrefs that will expose additional data in even more detail. 

**[Here’s a simple example that returns all reports related to Yemen]
(https://api.reliefweb.int/v1/reports?appname=apidoc&query[value]=yemen)**

## CIA World Factbook

- Mostly static data/statistics
- Covers history, people and society, government, economy, energy, geography, communications, transportation, military, and transnational issues for countries
- Also includes maps, comparative data, and world flags. 
- Free but needs to be self hosted in some way

The CIA World factbook is a great resource which can be viewed in web page format **[here](https://www.cia.gov/library/publications/the-world-factbook/)**

The only problem is that the CIA does not serve this data through an API. Luckily someone took the time to scrape the data and **[put it into JSON format](https://iancoleman.io/exploring-the-cia-world-factbook)**.

You can even download the web scraping code to do it yourself or take the easy way and download a copy of the latest data (seems to be updated every 1-2 months). Either way this unofficial API is a great way to allow your users to quickly get up to speed on an impacted region during a disaster. In addition, the world ranking statistics that are available for certain data points help to highlight the vulnerabilities a country might have in a way that other data sources cannot.   

## ArcGIS

**[API Documentation](https://developers.arcgis.com/javascript/)**

- Geographic information system used for creating and interacting with maps, 
- You can compile, analyze, and share your creations
- ArcGIS online includes a large searchable database of public layers/services
- Many disaster focused layers that are free to use and updated as often as every 5 minutes

ArcGIS is probably my favorite of this list and is basically a system for displaying data on maps. For my use case I wanted to display weather alerts, earthquake data, forest fires, and other disaster related info onto a map and have some elements of my UI be able to change what location the map centered over. Achieving this did not take a lot of code but I personally felt a bit overwhelmed by the amount of options the API gives you. There are a number of tutorials available to help get you off the ground though and it’s likely that there’s already a tutorial out there for whatever you’re looking to do.

**[Here’s a list of some of the more popular public layers out there](https://www.esri.com/arcgis-blog/products/arcgis-living-atlas/real-time/putting-the-live-in-living-atlas-of-the-world/)**

That’s about it for my favorite disaster related resources. If anyone has any other useful resources please free to share them!