Search⌘ K

Hazardous Events Using the EONET API

Explore how to retrieve data on natural events such as storms, floods, and wildfires using NASA's Earth Observatory Natural Event Tracker (EONET) API. Understand how to get event categories, ongoing events, and visualize event layers to monitor hazardous situations programmatically.

We'll cover the following...

Earth Observatory Natural Event Tracker (EONET) is a repository that contains data for natural events such as storms, floods, and earthquakes. We can use the EONET API to access this data programmatically. Along with the event data, EONET provides event-related image layers to represent these events better. This repository is updated continuously so users can stay up to date.

EONET event categories

The events are cataloged into different categories. The base URL https://eonet.gsfc.nasa.gov/api/v3/categories is used to get a list of all available categories. We can then use these categories to filter out events of a specific type.

The code below shows us how to get all available categories of events.

Javascript (babel-node)
const API_KEY = '{{API_KEY}}';
const endpointUrl = new URL('https://eonet.gsfc.nasa.gov/api/v3/categories');
const queryParameters = new URLSearchParams({
api_key: API_KEY
});
const options = {
method: 'GET'
};
async function fetchEventsCategories() {
try {
endpointUrl.search = queryParameters;
const response = await fetch(endpointUrl, options);
printResponse(response);
}
catch (error) {
printError(error);
}
}
fetchEventsCategories();

Let's look ...