/api/hazard/earthquake/1 creditEarthquake 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/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.
| Parameter | Type | Example | What it does | |
|---|---|---|---|---|
| alertlevel | string | green | Limit to events with a specific PAGER alert levelone of: green, orange, red, yellow | |
| catalog | string | — | Limit to events from a specific catalog | |
| contributor | string | — | Limit to events contributed by a specific contributor | |
| endtime | string | 2024-12-31 | End of time window (ISO8601). Default: present time ISO date, or a date-time. Inclusive. | |
| eventid | string | — | Select 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. | |
| eventtype | string | — | Limit to events of a specific type (e.g. 'earthquake' filters non-earthquake events) | |
| includeallmagnitudes | boolean | — | Include all magnitudes for each event (default: false) | |
| includeallorigins | boolean | — | Include all origins for each event (default: false) | |
| includearrivals | boolean | — | Include phase arrivals (default: false, NOT CURRENTLY IMPLEMENTED) | |
| includedeleted | string | — | Include 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 | |
| includesuperseded | boolean | — | Include superseded products (default: false). Only works with eventid | |
| latitude | number | 26.9124 | Center latitude for circle search [-90, 90]. Requires longitude and maxradius/maxradiuskm Centre of a circular search, used with longitude and maxradiuskm. | |
| limit | integer | 20 | Max number of events to return [1, 20000] How many records to return per page. | |
| longitude | number | 75.7873 | Center longitude for circle search [-180, 180] | |
| maxalertlevel | string | green | Limit to events with PAGER alert level ≤ this valueone of: green, orange, red, yellow | |
| maxcdi | number | — | Maximum Community Determined Intensity (DYFI) [0, 12] | |
| maxdepth | number | — | Max depth in km [-100, 1000] | |
| maxgap | number | — | Max azimuthal gap in degrees [0, 360] | |
| maxlatitude | number | — | Bounding box northern boundary [-90, 90] | |
| maxlongitude | number | — | Bounding box eastern boundary [-360, 360] | |
| maxmagnitude | number | 9 | Max magnitude | |
| maxmmi | number | — | Maximum Modified Mercalli Intensity (ShakeMap) [0, 12] | |
| maxradius | number | — | Max radius in degrees from center point [0, 180]. Mutually exclusive with maxradiuskm | |
| maxradiuskm | number | 500 | Max radius in km from center point [0, 20001.6]. Mutually exclusive with maxradius Search radius in kilometres around latitude/longitude. | |
| maxsig | integer | — | Max significance | |
| minalertlevel | string | green | Limit to events with PAGER alert level ≥ this valueone of: green, orange, red, yellow | |
| mincdi | number | — | Minimum Community Determined Intensity (DYFI) | |
| mindepth | number | — | Min depth in km [-100, 1000] | |
| minfelt | integer | — | Minimum number of DYFI responses [1, ∞] | |
| mingap | number | — | Min azimuthal gap in degrees [0, 360] | |
| minlatitude | number | — | Bounding box southern boundary [-90, 90] | |
| minlongitude | number | — | Bounding box western boundary [-360, 360]. Rectangles may cross the date line by using minlongitude < -180 or maxlongitude > 180 | |
| minmagnitude | number | 6 | Min magnitude Richter magnitude floor. 6 and above is a major earthquake. | |
| minsig | integer | — | Min significance | |
| nodata | integer | 204 | HTTP status code returned when no data is found (204 or 404)one of: 204, 404 | |
| offset | integer | 0 | Return results starting at this count (1-based) How many records to skip, for paging. | |
| orderby | string | magnitude | Order results by fieldone of: magnitude, magnitude-asc, time, time-asc | |
| productcode | string | — | Return the event associated with this product code FREE-FORM USGS product code. Proxied verbatim. | |
| producttype | string | — | Limit to events with this product type (e.g. moment-tensor, focal-mechanism, shakemap, losspager, dyfi) | |
| reviewstatus | string | automatic | Limit to events with a specific review statusone of: automatic, reviewed | |
| starttime | string | 2024-01-01 | Start 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. | |
| updatedafter | string | — | Limit 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.