Python API client for quakefyi.com -- the comprehensive earthquake and seismology database covering earthquakes, tectonic plates, fault lines, historical events, and yearly summaries. Access seismic data, magnitude records, and geological case studies through a free REST API, CLI, or MCP server for AI assistants.
QuakeFYI catalogs earthquake events with magnitude, depth, location data, tectonic plate boundaries, and fault classifications -- built for developers, geoscientists, and educators who need structured seismological data.
Explore earthquakes at quakefyi.com -- browse seismic events, tectonic plates, and fault lines.
- Install
- Quick Start
- What You Can Do
- Command-Line Interface
- MCP Server (Claude, Cursor, Windsurf)
- REST API Client
- API Reference
- Learn More About Earthquakes
- Geo FYI Family
- FYIPedia Developer Tools
- License
pip install quakefyi # Core (zero deps)
pip install "quakefyi[cli]" # + Command-line interface
pip install "quakefyi[mcp]" # + MCP server for AI assistants
pip install "quakefyi[api]" # + HTTP client for quakefyi.com API
pip install "quakefyi[all]" # Everythingfrom quakefyi.api import QuakeFYI
with QuakeFYI() as api:
# List earthquakes in the database
earthquakes = api.list_earthquakes()
# Get detailed info for a specific earthquake event
event = api.get_earthquake("2011-tohoku")
# Browse tectonic plates
plates = api.list_plates()
pacific = api.get_plate("pacific-plate")
# Search across all seismological content
results = api.search("San Andreas")Earthquake magnitude quantifies the energy released at the source. The moment magnitude scale (Mw) has replaced the older Richter scale (ML) for most scientific and engineering purposes because it does not saturate at high magnitudes. A magnitude increase of 1.0 represents roughly 31.6 times more energy released.
| Magnitude (Mw) | Classification | Effects | Approximate Annual Frequency |
|---|---|---|---|
| < 2.0 | Micro | Not felt, recorded by instruments | ~1,300,000 |
| 2.0 -- 3.9 | Minor | Often felt, rarely causes damage | ~130,000 |
| 4.0 -- 4.9 | Light | Noticeable shaking, minor damage | ~13,000 |
| 5.0 -- 5.9 | Moderate | Can cause damage to weak structures | ~1,300 |
| 6.0 -- 6.9 | Strong | Destructive in populated areas | ~130 |
| 7.0 -- 7.9 | Major | Serious damage over large areas | ~15 |
| 8.0+ | Great | Devastating, can trigger tsunamis | ~1 |
from quakefyi.api import QuakeFYI
# Retrieve earthquake data with magnitude, depth, and location
with QuakeFYI() as api:
quake = api.get_earthquake("2011-tohoku")
print(quake["name"]) # 2011 Tohoku earthquake
print(quake) # Full event data including magnitude and coordinates
# Browse yearly summaries of seismic activity
summaries = api.list_yearly_summaries()Learn more: Browse Earthquakes · Glossary · Guides
Earth's lithosphere is divided into major and minor tectonic plates that float on the semi-fluid asthenosphere. Plate boundaries are where most earthquakes occur. There are three boundary types: divergent (plates move apart), convergent (plates collide), and transform (plates slide past each other).
| Plate | Type | Area (million km2) | Notable Boundary |
|---|---|---|---|
| Pacific | Oceanic | 103.3 | Ring of Fire (subduction zones) |
| North American | Continental + Oceanic | 75.9 | San Andreas Fault (transform) |
| Eurasian | Continental + Oceanic | 67.8 | Himalayas (convergent) |
| African | Continental + Oceanic | 61.3 | East African Rift (divergent) |
| Antarctic | Continental + Oceanic | 60.9 | Mid-ocean ridges |
| Indo-Australian | Continental + Oceanic | 58.9 | Sunda megathrust |
| South American | Continental + Oceanic | 43.6 | Andes subduction zone |
from quakefyi.api import QuakeFYI
# Explore tectonic plates and their boundaries
with QuakeFYI() as api:
plates = api.list_plates()
pacific = api.get_plate("pacific-plate")
# Browse by country to see regional seismic risk
countries = api.list_countries()
japan = api.get_country("japan")Learn more: Tectonic Plates · Countries · API Docs
A fault is a fracture in the Earth's crust along which blocks of rock have moved relative to each other. Faults are classified by the direction of movement: normal faults (extensional), reverse/thrust faults (compressional), and strike-slip faults (lateral).
| Fault Type | Movement | Tectonic Setting | Example |
|---|---|---|---|
| Normal | Hanging wall drops | Divergent boundary, rifting | Basin and Range, USA |
| Reverse (Thrust) | Hanging wall rises | Convergent boundary, compression | Himalayan frontal thrust |
| Strike-slip | Lateral sliding | Transform boundary | San Andreas Fault |
| Oblique-slip | Combined vertical + lateral | Complex tectonic zones | Alpine Fault, New Zealand |
from quakefyi.api import QuakeFYI
# Explore fault lines and their classifications
with QuakeFYI() as api:
faults = api.list_faults()
san_andreas = api.get_fault("san-andreas-fault")
# Access seismology glossary terms
glossary = api.list_glossary()
term = api.get_term("epicenter")Learn more: Fault Lines · Glossary · FAQs
Historical earthquakes provide critical data for understanding seismic hazard and improving building codes. The deadliest recorded earthquake was the 1556 Shaanxi earthquake in China, which killed an estimated 830,000 people. The strongest instrumentally recorded earthquake was the 1960 Valdivia earthquake in Chile at Mw 9.5.
from quakefyi.api import QuakeFYI
# Explore historical earthquakes and case studies
with QuakeFYI() as api:
historical = api.list_historical()
case_studies = api.list_case_studies()
study = api.get_case_study("1906-san-francisco")
# Read expert guides on seismology topics
guides = api.list_guides()Learn more: Historical Earthquakes · Case Studies · Guides
pip install "quakefyi[cli]"
# Search for earthquakes
quakefyi search "Tohoku 2011"
# Output is JSON for easy piping
quakefyi search "magnitude 9" | jq '.results[0]'Add earthquake data tools to any AI assistant that supports Model Context Protocol.
pip install "quakefyi[mcp]"Add to your claude_desktop_config.json:
{
"mcpServers": {
"quakefyi": {
"command": "python",
"args": ["-m", "quakefyi.mcp_server"]
}
}
}Available tools: search_quakefyi
from quakefyi.api import QuakeFYI
with QuakeFYI() as api:
# List endpoints
earthquakes = api.list_earthquakes()
plates = api.list_plates()
faults = api.list_faults()
historical = api.list_historical()
glossary = api.list_glossary()
guides = api.list_guides()
# Detail endpoints
quake = api.get_earthquake("2011-tohoku")
plate = api.get_plate("pacific-plate")
# Search
results = api.search("tsunami")| Method | Description |
|---|---|
list_earthquakes(**params) |
List all earthquakes |
get_earthquake(slug) |
Get earthquake detail |
list_plates(**params) |
List all tectonic plates |
get_plate(slug) |
Get plate detail |
list_faults(**params) |
List all fault lines |
get_fault(slug) |
Get fault detail |
list_historical(**params) |
List historical earthquakes |
get_historical(slug) |
Get historical earthquake detail |
list_case_studies(**params) |
List all case studies |
get_case_study(slug) |
Get case study detail |
list_yearly_summaries(**params) |
List yearly summaries |
get_yearly_summary(slug) |
Get yearly summary detail |
list_countries(**params) |
List all countries |
get_country(slug) |
Get country detail |
list_glossary(**params) |
List glossary terms |
get_term(slug) |
Get glossary term detail |
list_guides(**params) |
List all guides |
get_guide(slug) |
Get guide detail |
list_faqs(**params) |
List all FAQs |
get_faq(slug) |
Get FAQ detail |
search(query) |
Search across all content |
Full API documentation at quakefyi.com/developers/.
- Browse: Earthquakes · Tectonic Plates · Faults
- Guides: Glossary · Guides
- API: REST API Docs · OpenAPI Spec
Part of the FYIPedia open-source developer tools ecosystem -- geography, distance, elevation, and natural events.
| Package | PyPI | Description |
|---|---|---|
| distancefyi | PyPI | Haversine distance & travel times -- distancefyi.com |
| mountainfyi | PyPI | Mountains, peaks, elevation, climbing routes -- mountainfyi.com |
| quakefyi | PyPI | Earthquakes, seismic data, tectonic plates -- quakefyi.com |
| zipfyi | PyPI | ZIP/postal codes, geocoding, area lookup -- zipfyi.com |
| Package | PyPI | npm | Description |
|---|---|---|---|
| colorfyi | PyPI | npm | Color conversion, WCAG contrast, harmonies -- colorfyi.com |
| emojifyi | PyPI | npm | Emoji encoding & metadata -- emojifyi.com |
| symbolfyi | PyPI | npm | Symbol encoding in 11 formats -- symbolfyi.com |
| unicodefyi | PyPI | npm | Unicode lookup with 17 encodings -- unicodefyi.com |
| fontfyi | PyPI | npm | Google Fonts metadata & CSS -- fontfyi.com |
| distancefyi | PyPI | npm | Haversine distance & travel times -- distancefyi.com |
| timefyi | PyPI | npm | Timezone ops & business hours -- timefyi.com |
| namefyi | PyPI | npm | Korean romanization & Five Elements -- namefyi.com |
| unitfyi | PyPI | npm | Unit conversion, 220 units -- unitfyi.com |
| holidayfyi | PyPI | npm | Holiday dates & Easter calculation -- holidayfyi.com |
| quakefyi | PyPI | -- | Earthquakes, seismic data, tectonic plates -- quakefyi.com |
| cocktailfyi | PyPI | -- | Cocktail ABV, calories, flavor -- cocktailfyi.com |
| fyipedia | PyPI | -- | Unified CLI for all FYI tools -- fyipedia.com |
MIT
