Skip to content
GET/api/hazard/earthquake/1 credit

Earthquake events

A pass-through proxy for the United States Geological Survey FDSN earthquake event service. This is a historical and near-real-time seismology dataset, not an astrological calculation; it is here so that mundane and event-correlation work can pull the events and the chart data through one API. Every query parameter is forwarded to USGS unchanged, so the full FDSN vocabulary applies: `starttime` and `endtime` in ISO 8601 (defaulting to the last thirty days), a bounding box via `minlatitude`/`maxlatitude`/`minlongitude`/`maxlongitude` or a circle via `latitude`/`longitude` with `maxradius` or `maxradiuskm`, `minmagnitude`/`maxmagnitude`, `mindepth`/`maxdepth`, `minsig`/`maxsig`, PAGER `alertlevel`, `eventtype`, `reviewstatus`, `limit` up to 20000, `offset` and `orderby`. The response is the USGS GeoJSON FeatureCollection as returned: a `metadata` object with the result `count`, and a `features` list in which each entry has a `geometry` giving [longitude, latitude, depth in km] and a `properties` object with magnitude, place description, epoch-millisecond `time`, felt reports, Mercalli and Community intensity, significance, a tsunami flag and the USGS event page URL. The `format` parameter is ignored and always forced to geojson. If USGS cannot be reached the endpoint returns 503.

https://yogataraapi.prahlad.app/api/hazard/earthquake/
Test Request

Authentication

Send your key in the X-API-Key header. Keys are server-side credentials — never put one in browser JavaScript or a mobile app.

X-API-Key: yt_live_a1b2c3d4_…

Query parameters (42)

Passed in the URL. All optional unless marked, and they combine — filter, then page, then sort.

ParameterTypeExampleWhat it does
alertlevelstringgreenLimit to events with a specific PAGER alert levelone of: green, orange, red, yellow
catalogstringLimit to events from a specific catalog
contributorstringLimit to events contributed by a specific contributor
endtimestring2024-12-31End of time window (ISO8601). Default: present time

ISO date, or a date-time. Inclusive.

eventidstringSelect a specific event by ID (implies includeallorigins and includeallmagnitudes)

FREE-FORM USGS event ID (e.g. 'us7000abcd'. Selecting one implies includeallorigins and includeallmagnitudes. Proxied verbatim.

eventtypestringLimit to events of a specific type (e.g. 'earthquake' filters non-earthquake events)
includeallmagnitudesbooleanInclude all magnitudes for each event (default: false)
includealloriginsbooleanInclude all origins for each event (default: false)
includearrivalsbooleanInclude phase arrivals (default: false, NOT CURRENTLY IMPLEMENTED)
includedeletedstringInclude deleted events (default: false). Use 'only' to return only deleted events

The endpoint's own parameter description documents it as boolean-plus-'only' ("Include deleted events (default: false). Use 'only' to return only deleted events". There is no local check - the value is proxied to USGS, which owns the validation.

one of: true, false, only
includesupersededbooleanInclude superseded products (default: false). Only works with eventid
latitudenumber26.9124Center latitude for circle search [-90, 90]. Requires longitude and maxradius/maxradiuskm

Centre of a circular search, used with longitude and maxradiuskm.

limitinteger20Max number of events to return [1, 20000]

How many records to return per page.

longitudenumber75.7873Center longitude for circle search [-180, 180]
maxalertlevelstringgreenLimit to events with PAGER alert level ≤ this valueone of: green, orange, red, yellow
maxcdinumberMaximum Community Determined Intensity (DYFI) [0, 12]
maxdepthnumberMax depth in km [-100, 1000]
maxgapnumberMax azimuthal gap in degrees [0, 360]
maxlatitudenumberBounding box northern boundary [-90, 90]
maxlongitudenumberBounding box eastern boundary [-360, 360]
maxmagnitudenumber9Max magnitude
maxmminumberMaximum Modified Mercalli Intensity (ShakeMap) [0, 12]
maxradiusnumberMax radius in degrees from center point [0, 180]. Mutually exclusive with maxradiuskm
maxradiuskmnumber500Max radius in km from center point [0, 20001.6]. Mutually exclusive with maxradius

Search radius in kilometres around latitude/longitude.

maxsigintegerMax significance
minalertlevelstringgreenLimit to events with PAGER alert level ≥ this valueone of: green, orange, red, yellow
mincdinumberMinimum Community Determined Intensity (DYFI)
mindepthnumberMin depth in km [-100, 1000]
minfeltintegerMinimum number of DYFI responses [1, ∞]
mingapnumberMin azimuthal gap in degrees [0, 360]
minlatitudenumberBounding box southern boundary [-90, 90]
minlongitudenumberBounding box western boundary [-360, 360]. Rectangles may cross the date line by using minlongitude < -180 or maxlongitude > 180
minmagnitudenumber6Min magnitude

Richter magnitude floor. 6 and above is a major earthquake.

minsigintegerMin significance
nodatainteger204HTTP status code returned when no data is found (204 or 404)one of: 204, 404
offsetinteger0Return results starting at this count (1-based)

How many records to skip, for paging.

orderbystringmagnitudeOrder results by fieldone of: magnitude, magnitude-asc, time, time-asc
productcodestringReturn the event associated with this product code

FREE-FORM USGS product code. Proxied verbatim.

producttypestringLimit to events with this product type (e.g. moment-tensor, focal-mechanism, shakemap, losspager, dyfi)
reviewstatusstringautomaticLimit to events with a specific review statusone of: automatic, reviewed
starttimestring2024-01-01Start of time window (ISO8601, e.g. 2022-01-01 or 2022-01-01T00:00:00). Default: NOW - 30 days

ISO date, or a date-time. Inclusive.

updatedafterstringLimit to events updated after this time (ISO8601)

FORMAT constraint. ISO 8601. Forwarded verbatim to USGS.

Example request

curl "https://yogataraapi.prahlad.app/api/hazard/earthquake/" \
  -H "X-API-Key: $OCCULT_API_KEY"

Response

{
  "_truncated": true,
  "_note": "Response shortened for the catalogue.",
  "preview": "{\"type\": \"FeatureCollection\", \"metadata\": {\"generated\": 1788592654000, \"url\": \"https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson\", \"title\": \"USGS Earthquakes\", \"status\": 200, \"api\": \"2.7.0\", \"count\": 11377}, \"features\": [{\"type\": \"Feature\", \"properties\": {\"mag\": 1, \"place\": \"4 km W of Cobb, CA\", \"time\": 1788589498050, \"updated\": 1788589596729, \"tz\": null, \"url\": \"https://earthquake.usgs.gov/earthquakes/eventpage/nc75430052\", \"detail\": \"https://earthquake.usgs.gov/fdsnws/event/1/query?eventid=nc75430052&format=geojson\", \"felt\": null, \"cdi\": null, \"mmi\": null, \"alert\": null, \"status\": \"automatic\", \"tsunami\": 0, \"sig\": 15, \"net\": \"nc\", \"code\": \"75430052\", \"ids\": \",nc75430052,\", \"sources\": \",nc,\", \"types\": \",nearby-cities,origin,phase-data,\", \"nst\": 16, \"dmin\": 0.01049, \"rms\": 0.02, \"gap\": 120, \"magType\": \"md\", \"type\": \"earthquake\", \"title\": \"M 1.0 - 4 km W of Cobb, CA\"}, \"geometry\": {\"type\": \"Point\", \"coordinates\": [-122.763664245605, 38.8211669921875, 2.17000007629395]}, \"id\": \"nc75430052\"}, {\"type\": \"Feature\", \"properties\": {\"mag\": 1.04, \"place\": \"10 km NW of The Geysers, CA\", \"time\": 1788589488170, \"updated\": 1788591141882, \"tz\": null, \"url\": \"https://earthquake.usgs.gov/earthquakes/eventpage/nc75430047\", \"detail\": \"https://earthquake.usgs.gov/fdsnws/event/1/query?eventid=nc75430047&format=geojson\", \"felt\": null, \"cdi\": null, \"mmi\": null, \"alert\": null, \"status\": \"automatic\", \"tsunami\": 0, \"sig\": 17, \"net\": \"nc\", \"code\": \"75430047\", \"ids\": \",nc75430047,\", \"sources\": \",nc,\", \"types\": \",nearby-cities,origin,phase-data,scitech-link,\", \"nst\": 16, \"dmin\": 0.004639, \"rms\": 0.01, \"gap\": 92, \"magType\": \"md\", \"type\": \"earthquake\", \"title\": \"M 1.0 - 10 km NW of The Geysers, CA\"}, \"geometry\": {\"type\": \"Point\", \"coordinates\": [-122.836502075195, 38.8431663513184, 1.73000001907349]}, \"id\": \"nc75430047\"}, {\"type\": \"Feature\", \"properties\": {\"mag\": 1.55, \"place\": \"4 km W of Cobb, CA\", \"time\": 1788589189470, \"updated\": 1788592042969, \"tz\": null, \"url\": \"https://earthquake.usgs.gov/earthquakes/eventpage/nc75430042\", \"detail\": \"https://earthquake.usgs.gov/fdsnws/event/1/query?eventid=nc75430042&format=geojson\", \"felt\": null, \"cdi\": null, \"mmi\": null, \"alert\": null, \"status\": \"automatic\", \"tsunami\": 0, \"sig\": 37, \"net\": \"nc\", \"code\": \"75430042\", \"ids\": \",nc75430042,\", \"sources\": \",nc,\", \"types\": \",focal-mechanism,nearby-cities,origin,phase-data,scitech-link,\", \"nst\": 31, \"dmin\": 0.01041, \"rms\": 0.04, \"gap\": 52, \"magType\": \"md\", \"type\": \"earthquake\", \"title\": \"M 1.6 - 4 km W of Cobb, CA\"}, \"geometry\": {\"type\": \"Point\", \"coordinates\": [-122.764831542969, 38.8208351135254, 1.98000001907349]}, \"id\": \"nc75430042\"}, {\"type\": \"Feature\", \"properties\": {\"mag\": 1.73, \"place\": \"13 km NW of Ocotillo, CA\", \"time\": 1788589118840, \"updated\": 1788589331762, \"tz\": null, \"url\": \"https://earthquake.usgs.gov/earthquakes/eventpage/ci41541816\", \"detail\": \"https://earthquake.usgs.gov/fdsnws/event/1/query?eventid=ci41541816&format=geojson\", \"felt\": null, \"cdi\": null, \"mmi\": null, \"alert\": null, \"status\": \"automatic\", \"tsunami\": 0, \"sig\": 46, \"net\": \"ci\", \"code\": \"41541816\", \"ids\": \",ci41541816,\", \"sources\": \",ci,\", \"types\": \",nearby-cities,origin,phase-data,scitech-link,\", \"nst\": 62, \"dmin\": 0.01252, \"rms\": 0.25, \"gap\": 42, \"magType\": \"ml\", \"type\": \"earthquake\", \"title\": \"M 1.7 - 13 km NW of Ocotillo, CA\"}, \"geometry\": {\"type\": \"Point\", \"coordinates\": [-116.1, 32.8041666666667, 10.35]}, \"id\": \"ci41541816\"}, {\"type\": \"Feature\", \"properties\": {\"mag\": 0.72, \"place\": \"8 km W of Cobb, CA\", \"time\": 1788587690550, \"updated\": 1788589941747, \"tz\": null, \"url\": \"https://earthquake.usgs.gov/earthquakes/eventpage/nc75430037\", \"detail\": \"https://earthquake.usgs.gov/fdsnws/event/1/query?eventid=nc75430037&format=geojson\", \"felt\": null, \"cdi\": null, \"mmi\": null, \"alert\": null, \"status\": \"automatic\", \"tsunami\": 0, \"sig\": 8, \"net\": \"nc\", \"code\": \"75430037\", \"ids\": \",nc75430037,\", \"sources\": \",nc,\", \"types\": \",nearby-cities,origin,phase-data,scitech-link,\", \"nst\": 12, \"dmin"
}

Captured from a real call using the exact request above. Results sit under data.

Errors

Metering errors return { "error": "…", "message": "<code>", "is_error": true }. Show error to people and branch on message. See the error reference.