# Earthquake Data API - USGS Live Feed, Magnitude and Depth (`neverempty/earthquakes-usgs`) Actor

Worldwide earthquakes from the official USGS API: magnitude, depth, place, tsunami flag and felt reports. Timestamps converted to ISO instead of raw Unix milliseconds. No API key, no proxies, nothing that breaks when a site is redesigned.

- **URL**: https://apify.com/neverempty/earthquakes-usgs.md
- **Developed by:** [NeverEmpty](https://apify.com/neverempty) (community)
- **Categories:** News, Developer tools, MCP servers
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 earthquake returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Earthquake Data API - USGS Live Feed, Magnitude and Depth

Worldwide earthquake data straight from the **US Geological Survey's own API**. Magnitude, depth, location, tsunami flag, felt reports and alert level — as flat rows, ready to use.

USGS data is a work of the US government: **public domain, no API key, no proxies, no terms that forbid redistribution.** Nothing here parses HTML, so nothing here breaks when a website is redesigned.

### Three things this does that the raw feed does not

**1. Readable timestamps.** USGS returns `1787587104573` — Unix milliseconds. Every row here carries `2026-08-24T15:58:24.573Z` instead, so your spreadsheet, database and charts understand it without a conversion step.

**2. Latitude and longitude in the fields you expect.** GeoJSON stores coordinates as `[longitude, latitude, depth]` — longitude **first**. That order catches people out and puts earthquakes on the wrong side of the planet. Here they arrive as named `latitude`, `longitude` and `depthKm` fields.

**3. Real booleans.** The tsunami flag comes back as `0` / `1` from USGS. Here it is `true` / `false` — and stays `null` when USGS gave no value, rather than silently becoming `false`.

### What you get

| Field | Example |
|---|---|
| `id` | `us6000tn4t` |
| `time` / `updated` | `2026-08-24T15:58:24.573Z` |
| `magnitude` / `magnitudeType` | `2.6` / `mb_lg` |
| `place` | `11 km ENE of Pleasant Hill, Louisiana` |
| `latitude` / `longitude` / `depthKm` | `31.8417` / `-93.3902` / `7.364` |
| `tsunami` | `false` |
| `feltReports` | `2` — how many people reported feeling it |
| `alertLevel` | `green` / `yellow` / `orange` / `red`, or `null` |
| `significance` | `105` — USGS's own importance score |
| `status` | `reviewed` / `automatic` |
| `url` | The USGS event page |

#### One real row, exactly as written

```json
{
  "id": "us6000tn4t",
  "time": "2026-08-24T15:58:24.573Z",
  "updated": "2026-08-24T16:22:17.322Z",
  "magnitude": 2.6,
  "magnitudeType": "mb_lg",
  "place": "11 km ENE of Pleasant Hill, Louisiana",
  "latitude": 31.8417,
  "longitude": -93.3902,
  "depthKm": 7.364,
  "tsunami": false,
  "feltReports": 2,
  "alertLevel": null,
  "significance": 105,
  "status": "reviewed",
  "network": "us",
  "url": "https://earthquake.usgs.gov/earthquakes/eventpage/us6000tn4t",
  "source": "USGS earthquake.usgs.gov (official, public domain)"
}
```

### Input

Everything is optional. Run it with no input and you get the last 7 days at magnitude 2.5 and above — **451 earthquakes when measured on 2026-08-25**, because quakes that size happen worldwide every day. The default never returns an empty dataset.

```json
{
  "daysBack": 7,
  "minMagnitude": 4.5,
  "latitude": 35.6,
  "longitude": 139.7,
  "radiusKm": 500,
  "orderBy": "magnitude"
}
```

| Field | Default | Meaning |
|---|---|---|
| `daysBack` | `7` | How far back, when no explicit start date is given |
| `startTime` / `endTime` | empty | Explicit `YYYY-MM-DD` range. Overrides `daysBack` |
| `minMagnitude` | `2.5` | Only quakes at or above this magnitude |
| `latitude` / `longitude` / `radiusKm` | none | Area filter. **All three are required together** — the Actor tells you in the log if you set only some, instead of failing with an unexplained error |
| `limit` | `1000` | Up to 20,000 per run (the USGS ceiling) |
| `orderBy` | `time` | `time` = newest first, `magnitude` = strongest first |
| `maxRetries` | `3` | Retries if USGS returns an error or something that is not JSON |

### Typical uses

- Monitoring and alerting when a quake crosses a magnitude threshold near a location
- Maps, dashboards and news tickers
- Historical analysis and research
- Risk and insurance modelling
- Feeding an AI agent that needs authoritative seismic data

### FAQ

**Does it cover the whole world?**
Yes. USGS publishes global seismicity, not just the United States.

**How current is it?**
Fetched live on every run. USGS updates continuously; `status` tells you whether a record is `automatic` (machine-detected) or `reviewed` (checked by a seismologist).

**Do I need an API key?**
No. Neither for USGS nor for a proxy.

**What if no earthquakes match?**
You get zero rows and a clear log line saying the fetch succeeded but nothing matched — not an error, and not a silent blank.

**Can I search a specific city?**
Pass its `latitude`, `longitude` and a `radiusKm`. All three together.

### Other tools by NeverEmpty

Every NeverEmpty Actor follows the same rule: it never returns an empty result to mean two different things, and it only charges for rows that actually carry an answer.

- **[us-weather-forecast-api](https://apify.com/neverempty/us-weather-forecast-api)** - US forecasts from the official National Weather Service API
- **[sports-scores-api](https://apify.com/neverempty/sports-scores-api)** - scores for 8 leagues in one identical row shape

### Support

Wrong value or a filter that should work but does not? Open an issue on the **Issues** tab.

# Actor input Schema

## `daysBack` (type: `integer`):

How far back to look, when no explicit start date is given. Used together with the minimum magnitude.

## `startTime` (type: `string`):

Explicit start date. Overrides 'Days back'. Leave empty to use 'Days back'.

## `endTime` (type: `string`):

Explicit end date. Leave empty for 'up to now'.

## `minMagnitude` (type: `number`):

Only earthquakes at or above this magnitude. The default of 2.5 always returns results, because quakes of that size happen worldwide every day.

## `latitude` (type: `number`):

Optional. Only used together with Center longitude and Radius. All three must be set, or the area filter is ignored.

## `longitude` (type: `number`):

Optional. Only used together with Center latitude and Radius.

## `radiusKm` (type: `number`):

Optional. Only earthquakes within this many kilometres of the centre point. Requires latitude and longitude.

## `limit` (type: `integer`):

Upper bound on the number of earthquakes returned. USGS allows up to 20,000 per request.

## `orderBy` (type: `string`):

Sort newest first, or strongest first.

## `maxRetries` (type: `integer`):

How many times to retry if USGS returns an error or something that is not JSON.

## Actor input object example

```json
{
  "daysBack": 7,
  "startTime": "",
  "endTime": "",
  "minMagnitude": 2.5,
  "limit": 1000,
  "orderBy": "time",
  "maxRetries": 3
}
```

# Actor output Schema

## `results` (type: `string`):

All earthquakes produced by this run.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("neverempty/earthquakes-usgs").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("neverempty/earthquakes-usgs").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call neverempty/earthquakes-usgs --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,neverempty/earthquakes-usgs"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/98x8SQX4Q5pwT5A8h/builds/W2XgP9odba1bU5bib/openapi.json
