USGS Earthquake Hazards Program API

⭐ Beginner's Pick Science & Math / No Auth Required Beginner HTTPS
Free to Use Varies (check documentation)

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

Use case: Integrate earthquakes data real-time data into web and mobile applications
USGS Earthquake Hazards Program data via REST API
JSON-formatted response data
Freely accessible without authentication

Example Response

JSON 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

400 Bad Request — time range too large Requesting data without a time range limit can return millions of records which the API rejects.
Always specify both starttime and endtime parameters; limit your range to a few days and use minmagnitude to reduce result size.
No features in response No earthquakes matched the combination of filters you provided.
Broaden your filters by lowering minmagnitude or expanding the time range; try removing location filters first to confirm data exists.
Slow response time Very broad queries with low magnitude thresholds can match thousands of small earthquakes worldwide.
Add minmagnitude=2.5 or higher and restrict the geographic area using latitude/longitude bounding box parameters to speed up responses.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 15/20
🔒 Security 15/15
🛠 Developer XP 20/20
✓ Reliability 7/15
Response Time 215ms

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS NO
Category Science & Math
Difficulty Beginner
Verified: 2026-04-04

Similar APIs

View All →