# Earthquakes Scraper (`scrapers_lat/usgs-earthquakes-scraper`) Actor

Scrape recent earthquakes worldwide: magnitude, place, depth, coordinates, time, tsunami flag and event link. Filter by minimum magnitude. Export to JSON, CSV or Excel.

- **URL**: https://apify.com/scrapers\_lat/usgs-earthquakes-scraper.md
- **Developed by:** [Scrapers Lat](https://apify.com/scrapers_lat) (community)
- **Categories:** News, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.80 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

[![Earthquakes Scraper](https://scrapers.lat/banners/usgs-earthquakes-scraper.png)](https://console.apify.com/actors/9pytIVBGlbcpeuE64/input)

## Earthquakes Scraper

Here is one real result, with every field the actor returns:

```json
{
  "id": "us6000tjl2",
  "magnitude": 7.4,
  "place": "5 km S of San José del Palmar, Colombia",
  "time": "2026-08-10T12:34:28.125Z",
  "updated": "2026-08-10T14:18:13.244Z",
  "url": "https://earthquake.usgs.gov/earthquakes/eventpage/us6000tjl2",
  "felt": 616,
  "tsunami": 0,
  "longitude": -76.2422,
  "latitude": 4.8436,
  "depth": 110.285,
  "type": "earthquake",
  "title": "M 7.4 - 5 km S of San José del Palmar, Colombia",
  "magType": "mww",
  "alert": "orange",
  "cdi": 7.9,
  "mmi": 6.891,
  "significance": 1487,
  "status": "reviewed",
  "networkCode": "us",
  "code": "6000tjl2",
  "stationCount": 151,
  "azimuthalGap": 19,
  "rms": 0.86,
  "detailUrl": "https://earthquake.usgs.gov/fdsnws/event/1/query?eventid=us6000tjl2&format=geojson",
  "source": "USGS",
  "observedAt": "2026-08-10T14:19:05.653Z"
}
```

The most complete USGS earthquake scraper available. It returns every field the USGS earthquake feed exposes for each event, including magnitude and its type, place, precise coordinates and depth, tsunami flag, felt reports and shaking intensity (CDI / MMI / PAGER alert), significance, and the seismic-network detail (station count, azimuthal gap, RMS), and gives you filters for magnitude range and time window to target exactly the events you need.

**📥 [Input](https://apify.com/scrapers_lat/usgs-earthquakes-scraper/input-schema) · 📤 [Output](https://apify.com/scrapers_lat/usgs-earthquakes-scraper/output-schema) · 💰 [Pricing](https://apify.com/scrapers_lat/usgs-earthquakes-scraper/pricing) · ▶️ [Examples](https://apify.com/scrapers_lat/usgs-earthquakes-scraper/examples)**

![Apify](https://img.shields.io/badge/Platform-Apify-1CE1CE?logo=apify\&logoColor=white)
![Coverage](https://img.shields.io/badge/Coverage-Worldwide-blue)
![Output](https://img.shields.io/badge/Output-JSON%20%7C%20CSV%20%7C%20Excel-orange)
![Billing](https://img.shields.io/badge/Billing-Pay%20per%20result-brightgreen)

### Table of contents

- [What it does](#what-it-does)
- [Quickstart](#quickstart)
- [Input reference](#input-reference)
- [Output reference](#output-reference)
- [Example output record](#example-output-record)
- [Run via API and CLI](#run-via-api-and-cli)
- [Fetch results](#fetch-results)
- [Billing and limits](#billing-and-limits)
- [FAQ and troubleshooting](#faq-and-troubleshooting)

### What it does

The actor queries the USGS earthquake catalog (FDSN event service), applies the magnitude and time filters you pass as input, and writes one normalized record per event to the run's dataset, most recent first. Each record carries magnitude and magnitude type, place, event time and last-updated time (UTC), coordinates and depth, tsunami flag, felt reports, shaking intensity metrics (CDI, MMI, PAGER alert), significance, review status, and the underlying seismic-network detail. Times are ISO 8601 (UTC), and missing source values are returned as `null`.

Coverage is worldwide: the catalog spans events globally, and you can pull the most recent events or a historical window.

### Quickstart

Open the actor, paste this into the input, and press Run. It returns the 10 most recent earthquakes of magnitude 2.5 or higher.

```json
{
  "maxEarthquakes": 10,
  "minMagnitude": "2.5"
}
```

Every input field is optional. With an empty input the actor returns the most recent earthquakes at or above magnitude 2.5 (the default). Set `startTime` and `endTime` to query a historical window.

### Input reference

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `maxEarthquakes` | integer | no | `10` | Maximum number of earthquakes to collect, most recent first. Minimum 1, maximum 1000000. |
| `minMagnitude` | string | no | `2.5` | Only return earthquakes at or above this magnitude, for example `2.5`, `4.5`, `6`. |
| `maxMagnitude` | string | no | (none) | Only return earthquakes at or below this magnitude. |
| `startTime` | string | no | (none) | Earliest event time, for example `2026-01-01` or `2026-01-01T00:00:00`. Query a historical window. |
| `endTime` | string | no | (none) | Latest event time, for example `2026-02-01` or `2026-02-01T00:00:00`. |

### Output reference

One dataset item per earthquake event. Types: `string`, `number`, `integer`, or `null` when the source value is absent.

| Field | Type | Description |
|---|---|---|
| `id` | string | USGS event id. |
| `magnitude` | number | Magnitude. |
| `place` | string | Human-readable location description. |
| `time` | string | Event time (UTC, ISO 8601). |
| `updated` | string | Last update time (UTC, ISO 8601). |
| `url` | string | USGS event page link. |
| `felt` | integer | Number of felt reports, or `null`. |
| `tsunami` | integer | Tsunami flag (`1` if a tsunami event, else `0`). |
| `longitude` | number | Longitude. |
| `latitude` | number | Latitude. |
| `depth` | number | Depth (km). |
| `type` | string | Event type (for example `earthquake`). |
| `title` | string | Event title. |
| `magType` | string | Magnitude type (for example `mww`, `ml`). |
| `alert` | string | PAGER alert level (`green`, `yellow`, `orange`, `red`), or `null`. |
| `cdi` | number | Max reported intensity (CDI), or `null`. |
| `mmi` | number | Max estimated intensity (MMI), or `null`. |
| `significance` | integer | Significance score. |
| `status` | string | Review status (`reviewed` or `automatic`). |
| `networkCode` | string | Contributing network. |
| `code` | string | Event code. |
| `stationCount` | integer | Number of reporting stations, or `null`. |
| `azimuthalGap` | number | Largest azimuthal gap between stations (degrees), or `null`. |
| `rms` | number | Root-mean-square travel-time residual, or `null`. |
| `detailUrl` | string | Detail GeoJSON URL for the event. |
| `source` | string | Data source (`USGS`). |
| `observedAt` | string | ISO 8601 timestamp of when the record was collected. |

On a failed run, the actor writes a single item with a populated `error` field instead of event records, and does not charge for it.

### Example output record

Real record from a live run (input `{"maxEarthquakes": 10, "minMagnitude": "2.5"}`):

```json
{
  "id": "us6000tjl2",
  "magnitude": 7.4,
  "place": "5 km S of San José del Palmar, Colombia",
  "time": "2026-08-10T12:34:28.125Z",
  "updated": "2026-08-10T14:18:13.244Z",
  "url": "https://earthquake.usgs.gov/earthquakes/eventpage/us6000tjl2",
  "felt": 616,
  "tsunami": 0,
  "longitude": -76.2422,
  "latitude": 4.8436,
  "depth": 110.285,
  "type": "earthquake",
  "title": "M 7.4 - 5 km S of San José del Palmar, Colombia",
  "magType": "mww",
  "alert": "orange",
  "cdi": 7.9,
  "mmi": 6.891,
  "significance": 1487,
  "status": "reviewed",
  "networkCode": "us",
  "code": "6000tjl2",
  "stationCount": 151,
  "azimuthalGap": 19,
  "rms": 0.86,
  "detailUrl": "https://earthquake.usgs.gov/fdsnws/event/1/query?eventid=us6000tjl2&format=geojson",
  "source": "USGS",
  "observedAt": "2026-08-10T14:19:05.653Z"
}
```

### Run via API and CLI

Start a run and wait for it to finish, then read the dataset. Replace `<TOKEN>` with your Apify API token.

Run synchronously and get dataset items in one call:

```bash
curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~usgs-earthquakes-scraper/run-sync-get-dataset-items?token=%3CTOKEN%3E" \
  -H "Content-Type: application/json" \
  -d '{"maxEarthquakes":25,"minMagnitude":"4.5"}'
```

Start a run asynchronously:

```bash
curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~usgs-earthquakes-scraper/runs?token=%3CTOKEN%3E" \
  -H "Content-Type: application/json" \
  -d '{"minMagnitude":"6","startTime":"2026-01-01","endTime":"2026-02-01","maxEarthquakes":100}'
```

Apify CLI:

```bash
apify call scrapers_lat/usgs-earthquakes-scraper \
  --input '{"minMagnitude":"5","maxEarthquakes":50}'
```

### Fetch results

Every run writes to a dataset. Fetch items as JSON, CSV, or Excel by changing `format`:

```bash
## JSON
curl "https://api.apify.com/v2/datasets/%3CDATASET_ID%3E/items?token=%3CTOKEN%3E&clean=true&format=json"

## CSV
curl "https://api.apify.com/v2/datasets/%3CDATASET_ID%3E/items?token=%3CTOKEN%3E&clean=true&format=csv"

## Paginate large datasets
curl "https://api.apify.com/v2/datasets/%3CDATASET_ID%3E/items?token=%3CTOKEN%3E&offset=1000&limit=1000"
```

`<DATASET_ID>` is returned as `defaultDatasetId` in the run object. Use `offset` and `limit` to page through large result sets. `clean=true` drops empty and internal fields.

### Billing and limits

- **Pay per result.** You are charged per record returned (`result` event). See the [pricing tab](https://apify.com/scrapers_lat/usgs-earthquakes-scraper/pricing) for the current per-result price.
- **No charge on failure.** If a run errors, the actor writes a single item with a populated `error` field and does not charge for it. Empty runs cost nothing.
- **Spend cap respected.** Set `maxTotalChargeUsd` on the run; once reached, the actor stops emitting and charging further billable results.
- **Free Apify plans** are capped at 10 records per run. Upgrade for higher `maxEarthquakes`.

### FAQ and troubleshooting

**A run returned 0 records. Why?**
No events matched the filters in the requested window. Lower `minMagnitude` or widen the `startTime` / `endTime` range. Zero-result runs are not charged.

**What is the difference between `alert`, `cdi`, and `mmi`?**
`alert` is the USGS PAGER impact alert level (`green` to `red`); `cdi` is the maximum community-reported intensity (Did You Feel It?); `mmi` is the maximum instrumentally estimated intensity. Any of them can be `null` for smaller or newer events.

**Why is `status` sometimes `automatic`?**
New events are first published automatically and later reviewed by an analyst. `automatic` means the solution has not yet been human-reviewed; `reviewed` means it has.

**Can I pull historical earthquakes?**
Yes. Set `startTime` and `endTime` to a past window. Results are returned most recent first up to `maxEarthquakes`.

**Is this an official USGS tool?**
No. This actor is independent and has no affiliation with the USGS. It reads only data that is publicly available through the USGS earthquake feeds. Use it in accordance with the USGS terms of service.

### Related scrapers

- [NIH Research Grants & Funding Scraper](https://apify.com/scrapers_lat/usa-nih-reporter-scraper): NIH research grants and funding.
- [USAspending Federal Award Scraper](https://apify.com/scrapers_lat/usaspending-awards-scraper): US federal prime awards.
- [Federal Register Document Scraper](https://apify.com/scrapers_lat/federal-register-scraper): US Federal Register documents.
- [openFDA Food Recalls Scraper](https://apify.com/scrapers_lat/openfda-food-recalls-scraper): US food recall enforcement records.

### More scrapers at scrapers.lat

Built and maintained by [scrapers.lat](https://scrapers.lat), where we publish scrapers for US and Latin American public platforms: company registries, government data, finance, e-commerce and more. Browse the catalog or request a custom scraper at [scrapers.lat](https://scrapers.lat).

***

> Independent tool, not affiliated with the USGS. Accesses only publicly available USGS earthquake data. Use in accordance with the USGS terms of service.

# Actor input Schema

## `maxEarthquakes` (type: `integer`):

Maximum number of earthquakes to collect, most recent first.

## `minMagnitude` (type: `string`):

Only return earthquakes at or above this magnitude, for example 2.5, 4.5 or 6.

## `maxMagnitude` (type: `string`):

Optional. Only return earthquakes at or below this magnitude.

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

Optional. Earliest event time, for example 2026-01-01 or 2026-01-01T00:00:00. Query a historical window.

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

Optional. Latest event time, for example 2026-02-01 or 2026-02-01T00:00:00.

## Actor input object example

```json
{
  "maxEarthquakes": 10,
  "minMagnitude": "2.5"
}
```

# Actor output Schema

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

No description

# 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 = {
    "maxEarthquakes": 10,
    "minMagnitude": "2.5"
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapers_lat/usgs-earthquakes-scraper").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 = {
    "maxEarthquakes": 10,
    "minMagnitude": "2.5",
}

# Run the Actor and wait for it to finish
run = client.actor("scrapers_lat/usgs-earthquakes-scraper").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 '{
  "maxEarthquakes": 10,
  "minMagnitude": "2.5"
}' |
apify call scrapers_lat/usgs-earthquakes-scraper --silent --output-dataset

```

## MCP server setup

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

```

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/9pytIVBGlbcpeuE64/builds/Z9FxjlqQ77vgk6E2N/openapi.json
