USGS Earthquake Hazards Program API
Overview
The USGS Earthquake Hazards Program API provides real-time and historical earthquake data from seismic monitoring stations around the world. You can query earthquakes by location, magnitude, and time range without any API key or registration. It is an excellent API for learning to work with geospatial data and building earthquake alert or visualization tools.
Beginner Tip
Start with the GeoJSON feed format — it is the most beginner-friendly output and works directly with mapping libraries like Leaflet. Try the query endpoint with a minimum magnitude filter to start with a manageable number of significant events.
Available Data
Example Response
{
"status": "success",
"data": {
"result": "Data from USGS Earthquake Hazards Program",
"description": "Earthquakes data real-time",
"timestamp": "2025-01-15T10:00:00Z"
}
} Field Reference
features GeoJSON array of earthquake event objects matching the query filters. features[].properties.mag Richter magnitude of the earthquake. features[].properties.place Human-readable description of the earthquake location. features[].properties.time Unix timestamp in milliseconds of when the earthquake occurred. features[].geometry.coordinates Array of longitude, latitude, and depth in km for the earthquake epicenter. metadata.count Total number of earthquake events returned in this response. Implementation Example
const url = "https://earthquake.usgs.gov/fdsnws/event/1/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
Common Errors & Troubleshooting
Matrix Score Breakdown
Fully tested on Apr 5, 2026
Technical Specifications
Related Tags
Similar APIs
View All →arcsecond.io
⭐ Beginner's Pickarcsecond.io is a free astronomy API that aggregates data from multiple space databases, including stars, planets, exoplanets, and observing sites.
arXiv
arXiv provides programmatic access to curated research-sharing platform: physics, mathematics, quantitative finance, and economics via REST API.
GBIF
⭐ Beginner's PickGBIF (Global Biodiversity Information Facility) is a free, open API providing access to hundreds of millions of species occurrence records from around the world.
iDigBio
iDigBio is a free API that gives you access to millions of digitized natural history museum specimens from institutions across the United States and beyond.
inspirehep.net
INSPIRE-HEP is a free REST API for the High Energy Physics literature database, covering papers, authors, institutions, conferences, and experiments in particle physics.