# Earthquake API
> Real-time and historical earthquake data sourced from the USGS Earthquake Hazards Program. Pull ready-made summary feeds by magnitude band and period (significant, M4.5+, M2.5+, M1.0+ or all, over the past hour, day, week or month), run a full FDSN search by time window, magnitude range and geographic radius, count matching events, fetch the latest quakes worldwide, or look up a single event by its USGS id. Every event comes as a clean record with magnitude and type, place, ISO timestamps, depth and coordinates, felt reports, shaking intensity (CDI/MMI), PAGER alert level, tsunami flag and significance. Authoritative public data delivered through a fast, reliable API — ideal for insurance and risk, IoT and sensor alerting, newsrooms, research and disaster-response apps.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/earthquake-api/..."
```

## Pricing
- **Free** (Free) — 1,000 calls/Mo, 1 req/s
- **Basic** ($12/Mo) — 25,000 calls/Mo, 5 req/s
- **Pro** ($39/Mo) — 200,000 calls/Mo, 15 req/s
- **Mega** ($99/Mo) — 1,500,000 calls/Mo, 40 req/s

## Endpoints

### Earthquakes

#### `GET /v1/count` — Count matching events

**Parameters:**
- `start` (query, optional, string) — Start time (ISO 8601)
- `end` (query, optional, string) — End time (ISO 8601)
- `min_magnitude` (query, optional, string) — Minimum magnitude Example: `4.5`
- `latitude` (query, optional, string) — Center latitude
- `longitude` (query, optional, string) — Center longitude
- `radius_km` (query, optional, string) — Radius in km

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/earthquake-api/v1/count?min_magnitude=4.5"
```

**Response:**
```json
{
    "data": {
        "count": 414,
        "max_allowed": 20000
    },
    "meta": {
        "timestamp": "2026-05-30T18:17:15.847Z",
        "request_id": "0b18c86b-a2a0-4324-9512-e8335ec9155d"
    },
    "status": "ok",
    "message": "Count retrieved",
    "success": true
}
```

#### `GET /v1/earthquake` — Single earthquake by USGS id

**Parameters:**
- `id` (query, required, string) — USGS event id (e.g. us7000abcd)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/earthquake-api/v1/earthquake"
```

#### `GET /v1/feed` — USGS summary feed

**Parameters:**
- `magnitude` (query, optional, string) — significant | 4.5 | 2.5 | 1.0 | all Example: `4.5`
- `period` (query, optional, string) — hour | day | week | month Example: `week`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/earthquake-api/v1/feed?magnitude=4.5&period=week"
```

**Response:**
```json
{
    "data": {
        "count": 90,
        "title": "USGS Magnitude 4.5+ Earthquakes, Past Week",
        "period": "week",
        "generated": "2026-05-30T18:16:19.000Z",
        "magnitude": "4.5",
        "earthquakes": [
            {
                "id": "us7000spjc",
                "cdi": null,
                "mmi": null,
                "url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000spjc",
                "felt": null,
                "time": "2026-05-30T14:34:14.372Z",
                "type": "earthquake",
                "alert": null,
                "place": "26 km SE of Ashoro, Japan",
                "title": "M 4.5 - 26 km SE of Ashoro, Japan",
                "status": "reviewed",
                "tsunami": 0,
                "updated": "2026-05-30T16:28:04.040Z",
                "magnitude": 4.5,
                "coordinates": {
                    "depth_km": 116.722,
                    "latitude": 43.0767,
                    "longitude": 143.7857
                },
                "significance": 312,
                "magnitude_type": "mb",
                "timezone_offset_min": null
            },
            {
                "id": "us7000spj5",
                "cdi": null,
                "mmi": null,
                "url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000spj5",
                "felt": null,
                "time": "2026-05-30T14:21:09.256Z",
                "type": "earthquake",
                "alert": n
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/recent` — Latest earthquakes worldwide (past day)

**Parameters:**
- `limit` (query, optional, string) — 1-100 (default 20) Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/earthquake-api/v1/recent?limit=10"
```

**Response:**
```json
{
    "data": {
        "count": 10,
        "limit": 10,
        "title": "USGS All Earthquakes, Past Day",
        "generated": "2026-05-30T18:17:01.000Z",
        "earthquakes": [
            {
                "id": "aka2026kqppsg",
                "cdi": null,
                "mmi": null,
                "url": "https://earthquake.usgs.gov/earthquakes/eventpage/aka2026kqppsg",
                "felt": null,
                "time": "2026-05-30T18:09:54.738Z",
                "type": "earthquake",
                "alert": null,
                "place": "63 km E of Port Alsworth, Alaska",
                "title": "M 1.8 - 63 km E of Port Alsworth, Alaska",
                "status": "automatic",
                "tsunami": 0,
                "updated": "2026-05-30T18:11:38.106Z",
                "magnitude": 1.8,
                "coordinates": {
                    "depth_km": 141.2,
                    "latitude": 60.166,
                    "longitude": -153.171
                },
                "significance": 50,
                "magnitude_type": "ml",
                "timezone_offset_min": null
            },
            {
                "id": "pr71518248",
                "cdi": null,
                "mmi": null,
                "url": "https://earthquake.usgs.gov/earthquakes/eventpage/pr71518248",
                "felt": null,
                "time": "2026-05-30T17:42:15.330Z",
                "type": "earthquake",
                "alert": null,
                "place"
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/search` — FDSN event search

**Parameters:**
- `start` (query, optional, string) — Start time (ISO 8601)
- `end` (query, optional, string) — End time (ISO 8601)
- `min_magnitude` (query, optional, string) — Minimum magnitude Example: `4.5`
- `max_magnitude` (query, optional, string) — Maximum magnitude
- `latitude` (query, optional, string) — Center latitude for radius search
- `longitude` (query, optional, string) — Center longitude for radius search
- `radius_km` (query, optional, string) — Radius in km (needs lat+lon)
- `limit` (query, optional, string) — 1-1000 (default 20) Example: `20`
- `order` (query, optional, string) — time | time-asc | magnitude | magnitude-asc Example: `time`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/earthquake-api/v1/search?min_magnitude=4.5&limit=20&order=time"
```

**Response:**
```json
{
    "data": {
        "count": 20,
        "title": "USGS Earthquakes",
        "generated": "2026-05-30T18:17:17.000Z",
        "earthquakes": [
            {
                "id": "us7000spjc",
                "cdi": null,
                "mmi": null,
                "url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000spjc",
                "felt": null,
                "time": "2026-05-30T14:34:14.372Z",
                "type": "earthquake",
                "alert": null,
                "place": "26 km SE of Ashoro, Japan",
                "title": "M 4.5 - 26 km SE of Ashoro, Japan",
                "status": "reviewed",
                "tsunami": 0,
                "updated": "2026-05-30T16:28:04.040Z",
                "magnitude": 4.5,
                "coordinates": {
                    "depth_km": 116.722,
                    "latitude": 43.0767,
                    "longitude": 143.7857
                },
                "significance": 312,
                "magnitude_type": "mb",
                "timezone_offset_min": null
            },
            {
                "id": "us7000spj5",
                "cdi": null,
                "mmi": null,
                "url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000spj5",
                "felt": null,
                "time": "2026-05-30T14:21:09.256Z",
                "type": "earthquake",
                "alert": null,
                "place": "63 km W of Catuday, Philippines",
               
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/earthquake-api
OpenAPI spec: https://www.oanor.com/api/earthquake-api/openapi.json
