TL;DR
What it does: Get real-time earthquake data from USGS - magnitude, location, depth, and time for recent earthquakes worldwide. No API key needed.
Quick start: https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson
No API key needed - just call the URL
Overview
Free USGS Earthquake API providing real-time earthquake data worldwide. GeoJSON format with magnitude, location, depth, and time. No API key needed.
Live Example
Here's the exact URL to call and the real response you'll get:
The URL to call (M2.5+ earthquakes, past day):
https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson
Try This URL Now →
The actual response you get:
{
"type": "FeatureCollection",
"metadata": {
"generated": 1781506981000,
"url": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson",
"title": "USGS Magnitude 2.5+ Earthquakes, Past Day",
"status": 200,
"api": "2.4.0",
"count": 43
},
"features": [
{
"type": "Feature",
"properties": {
"mag": 2.9,
"place": "1 km SSE of Abeytas, New Mexico",
"time": 1781503356794,
"updated": 1781506315497,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000st0b",
"felt": 2,
"cdi": 2,
"status": "reviewed",
"tsunami": 0,
"sig": 130,
"type": "earthquake",
"title": "M 2.9 - 1 km SSE of Abeytas, New Mexico"
},
"geometry": {
"type": "Point",
"coordinates": [-106.8076, 34.4554, 10.529]
},
"id": "us7000st0b"
}
]
}
What does this data mean?
This earthquake was a magnitude 2.9 near Abeytas, New Mexico - 10.5 km deep, felt by 2 people, no tsunami risk.
- metadata.count
- Number of earthquakes in this feed (43 in this response)
- metadata.generated
- Unix timestamp (milliseconds) when the feed was generated
- features[].properties.mag
- Earthquake magnitude on the Richter scale (2.9 = minor)
- features[].properties.place
- Human-readable location description
- features[].properties.time
- Unix timestamp (milliseconds) of when the earthquake occurred
- features[].properties.felt
- Number of people who reported feeling the earthquake
- features[].properties.tsunami
- Tsunami flag: 0 = no tsunami, 1 = tsunami warning issued
- features[].properties.sig
- Significance level - higher numbers mean a more significant event
- features[].properties.title
- Formatted title with magnitude and location
- features[].properties.status
- Review status: reviewed or automatic
- features[].geometry.coordinates
- Array of [longitude, latitude, depth(km)] - [ -106.8, 34.5, 10.5 ] means 10.5 km deep
- features[].id
- Unique USGS identifier for this earthquake event
How to use this API
JavaScript Example
// Fetch latest M2.5+ earthquakes from the past day
const url = 'https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson';
fetch(url)
.then(res => res.json())
.then(data => {
const quake = data.features[0].properties;
const coords = data.features[0].geometry.coordinates;
const time = new Date(quake.time).toLocaleString();
console.log(`${quake.title}`);
console.log(`Location: ${quake.place}`);
console.log(`Depth: ${coords[2]} km`);
console.log(`Time: ${time}`);
console.log(`Tsunami: ${quake.tsunami ? 'YES' : 'No'}`);
console.log(`Felt reports: ${quake.felt}`);
});
Python Example
import requests
from datetime import datetime
url = "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson"
response = requests.get(url)
data = response.json()
for quake in data['features'][:5]: # Show first 5
props = quake['properties']
coords = quake['geometry']['coordinates']
time = datetime.fromtimestamp(props['time'] / 1000)
print(f"{props['title']}")
print(f" Location: {props['place']}")
print(f" Depth: {coords[2]} km")
print(f" Time: {time}")
print(f" Tsunami: {'YES' if props['tsunami'] else 'No'}")
print(f" ID: {quake['id']}")
print()
Frequently Asked Questions
- Do I need an API key?
- No! USGS earthquake data is public domain and completely free. No API key or registration required.
- What earthquake feeds are available?
- USGS provides many feed options:
2.5_day(M2.5+, past day),4.5_day,4.5_week,significant_week,all_day,all_week, and more. Just replace the filename in the URL. - What formats are available?
- Each feed is available in GeoJSON (
.geojson), CSV (.csv), and KML (.kml). Just change the file extension. - How do I get historical earthquake data?
- Use the FDSN Event API at https://earthquake.usgs.gov/fdsnws/event/1/ with
starttimeandendtimeparameters. Example:https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&starttime=2024-01-01&endtime=2024-01-31&minmagnitude=5 - Is there a rate limit?
- None documented. USGS data is public domain and the API is designed for public use. Please be respectful with automated queries.
- Can I use this commercially?
- Yes! USGS data is in the public domain and free for any use, including commercial applications.
- How do I check if an earthquake triggered a tsunami?
- Check the
tsunamifield in the properties. A value of1means a tsunami was triggered,0means no tsunami.
API Details
- Base URL
https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/- Documentation
- https://earthquake.usgs.gov/fdsnws/event/1/
- Category
- Weather
- Authentication
- None required - public domain data
- Rate Limit
- None documented
- Geographic Coverage
- Global - USGS monitors earthquakes worldwide