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.
Measurement Record
What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.
- Request
- GET https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&starttime=2024-01-01&endtime=2024-01-07&minmagnitude=5
- Result
- HTTP 200 · application/json · 20,567 bytes · compressed
- Response time
- 144 ms (median of 3) · fastest 139 ms
- Transport
- TLSv1.3 · TLS_AES_128_GCM_SHA256 · certificate issued by DigiCert Inc
- Browser CORS
- Allowed — Access-Control-Allow-Origin: *
- Served by
- nginx
- Recorded
- 2026-08-10
Fields Returned
Top-level fields present in the response we captured, with the type and value we actually received.
| Field | Type | Value received |
|---|---|---|
| type | string | FeatureCollection |
| metadata | object | {6 fields} |
| features | array | [1 item] |
| bbox | array | [1 item] |
Captured Response
Captured from a real request to https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&starttime=2024-01-01&endtime=2024-01-07&minmagnitude=5 on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.
{
"type": "FeatureCollection",
"metadata": {
"generated": 1786391608000,
"url": "https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&starttime=2024-01-01&endtime=2024-01-07&minmagnitude=5",
"title": "USGS Earthquakes",
"status": 200,
"api": "2.7.0",
"count": 28
},
"features": [
{
"type": "Feature",
"properties": {
"…": "(26 more fields)"
},
"geometry": {
"…": "(2 more fields)"
},
"id": "us6000m27f"
}
],
"bbox": [
-176.5067
]
} Field Reference
features GeoJSON array of earthquake event objects matching the query filters. Implementation Example
Calls a real endpoint of this API. Replace any placeholder credentials with your own key.
const url = "https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&starttime=2024-01-01&endtime=2024-01-07&minmagnitude=5";
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.
How This API Fails
We deliberately sent this API a broken request and recorded exactly what came back on 2026-08-10. Knowing the shape of an error before you hit it makes error handling much easier to write.
Returned an HTML error page rather than JSON — worth knowing if your client assumes every response can be parsed as JSON.
Error 400: Bad Request Bad format value "!!!invalid!!!". Valid values are: "quakeml", "geojson", "csv", "kml", "kmlraw", "xml", "text", "cap". Usage details are available from https://earthquake.usgs.gov/fdsnws/event/1 Request: /fdsnws/event/1/query?format=%21%21%21invalid%21%21%21&starttime=
Common Errors & Troubleshooting
Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.
Measured Score Breakdown
Live HTTP request to the API endpoint
Fully tested on Aug 10, 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.
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.
ISRO
⭐ Beginner's PickISRO is a free, no-auth API that provides detailed information about the Indian Space Research Organisation spacecraft and missions.