TL;DR
The USGS Earthquake Hazards API provides real-time access to global seismic event data from the US Geological Survey. You can query earthquakes by magnitude, time window, geographic region, and significance. Results return in GeoJSON format with magnitude, depth, location coordinates, time (Unix timestamp), and detailed event metadata. The FDSN event API is the standard interface used by seismologists worldwide.
Quick start: https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&minmagnitude=5
No API key needed — just make a request!
How to Use This API
1. Recent M5+ Earthquakes
https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&minmagnitude=5
2. Past 24 Hours, All Magnitudes
https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&starttime=2026-06-15&endtime=2026-06-16
3. Near a Specific Location
https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&latitude=35&longitude=-118&maxradiuskm=200&minmagnitude=3
4. JavaScript — Latest Earthquakes
fetch('https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&minmagnitude=4.5&limit=10')
.then(r => r.json())
.then(d => {
d.features.forEach(eq => {
const p = eq.properties;
console.log(`${p.mag} — ${p.place} (${new Date(p.time).toISOString()})`);
});
});
5. Python — Quake Map Data
import requests
resp = requests.get('https://earthquake.usgs.gov/fdsnws/event/1/query', params={
'format': 'geojson',
'minmagnitude': 2.5,
'orderby': 'time',
'limit': 20
})
for eq in resp.json()['features']:
p = eq['properties']
coords = eq['geometry']['coordinates']
print(f"M{p['mag']} at {p['place']} — depth {coords[2]}km")
https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&minmagnitude=4.5&limit=5
Frequently Asked Questions
- How quickly are earthquakes reported?
- USGS typically reports significant earthquakes within 2-5 minutes of detection. Smaller events may take 10-30 minutes for automated processing.
- What magnitude scales are used?
- The API reports multiple magnitude types:
mag(preferred),magType(ml=Richter, mw=Moment, mb=Body wave, ms=Surface wave), and others. - Can I get historical data?
- Yes, use
starttimeandendtimeparameters. The API covers seismic events from 1900 to present. - What does the GeoJSON format include?
- Each feature includes
geometry(longitude, latitude, depth),properties(mag, place, time, url, detail, felt, cdi, mmi, alert, tsunami, sig), andid. - How do I get detailed event info?
- Use the
detailURL from each feature's properties for full event data including phase data, magnitude calculations, and felt reports.
What You Can Build
- Live earthquake map with magnitude-based markers
- Seismic alert system for at-risk regions
- Historical earthquake trend analyzer
- Tsunami risk assessment tool
- Earthquake education dashboard for schools