Check the Setup
- Python 3.10 or newer
- A notebook environment such as Jupyter or Google Colab
- An internet connection
Continuously updated earthquake locations, magnitudes, depths, timestamps, and review status for monitoring seismic activity and spatial patterns.
Report a ProblemFrom Source to Product Signal
The USGS Event Web Service provides current and historical earthquake records through bounded queries. Start with a recent seven-day window that is small enough to inspect in one notebook. Conclusions from that short, changing sample should not be treated as long-term seismic trends.
Install the packages, then run the notebook cell.
python -m pip install pandas requests
from datetime import date, timedelta
import pandas as pd
import requests
end = date.today()
start = end - timedelta(days=7)
response = requests.get(
"https://earthquake.usgs.gov/fdsnws/event/1/query",
params={"format": "geojson", "starttime": start, "endtime": end},
timeout=30,
)
response.raise_for_status()
earthquakes = pd.json_normalize(response.json()["features"])
print(earthquakes[["properties.mag", "properties.place", "properties.time"]].head())Test a Useful Signal
Describe where earthquakes were recorded during the last seven days and how their reported magnitudes were distributed.
U.S. Geological Survey is a government source. Last verified 2026-08-18. Temporal coverage: 1900-present.