# USGS Earthquake Scraper: Global Seismic Events (`arman-bd/usgs-earthquakes-scraper`) Actor

Scrape USGS earthquake data: magnitude, depth, coordinates, place, tsunami flag, felt reports and alert level. Filter by magnitude, region and time window.

- **URL**: https://apify.com/arman-bd/usgs-earthquakes-scraper.md
- **Developed by:** [Arman Hossain](https://apify.com/arman-bd) (community)
- **Categories:** Business, Developer tools, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.37 / 1,000 earthquake scrapeds

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/platform/actors/running/actors-in-store#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

## USGS Earthquake Scraper: Global Seismic Events

![USGS Earthquake Scraper: Every earthquake worldwide as one row, magnitude, depth, epicentre, tsunami flag, felt reports and PAGER alert](https://api.apify.com/v2/key-value-stores/ZQOcNAOHrIgTacAmy/records/usgs-earthquakes-scraper.jpg)

**USGS Earthquake Scraper** exports global seismic events from the **United States Geological Survey**, magnitude, depth, epicentre, place name, tsunami flag, community felt reports, ShakeMap intensity and PAGER alert level.

It reads USGS's public GeoJSON directly: **no proxy setup, no browser, no credentials to manage.** The summary feeds are small, which makes this one of the cheapest things you can put on a five-minute schedule.

**Agent skill: [SKILL.md](https://api.apify.com/v2/key-value-stores/t7YoTxpZEJOWvw4Ug/records/usgs-earthquakes-scraper.md)**

```
https://api.apify.com/v2/key-value-stores/t7YoTxpZEJOWvw4Ug/records/usgs-earthquakes-scraper.md
```

### What you get

| Output field | Meaning |
|---|---|
| `eventId` | USGS event ID, e.g. `us6000ti8i`, stable, use it to de-duplicate |
| `magnitude`, `magType` | Magnitude and the scale it was measured on (`mww`, `ml`, `mb` …) |
| `place` | Human-readable location, e.g. `40 km SW of Sarangani, Philippines` |
| `time`, `updated` | Origin time and last revision, as ISO 8601 UTC |
| `longitude`, `latitude`, `depth` | Epicentre and hypocentre depth in km |
| `tsunami` | `true` when the event sits in a tsunami-notification region |
| `alert` | PAGER impact alert, `green`, `yellow`, `orange`, `red`, or `null` |
| `felt`, `cdi` | Number of "Did You Feel It?" reports and the resulting community intensity |
| `mmi` | Maximum estimated Modified Mercalli intensity from ShakeMap |
| `significance` | USGS significance score (0-1000) blending magnitude, felt reports and impact |
| `url` | USGS event page |
| `scrapedAt` | Run timestamp |

A `RUN_SUMMARY` record in the key-value store holds per-run counts, the filters used, and any request that failed.

### Two modes, chosen automatically

| You set | What runs | Reach |
|---|---|---|
| Nothing, or just `feed` | The pre-baked **summary feed**, one static GeoJSON file | Last hour → last month |
| `fromDate` and/or `toDate` | The full **USGS catalogue** (`fdsnws/event/1/query`), paged | Back to 1900 |

Summary feeds are static files with no query parameters, so `minMagnitude` and `boundingBox` are applied locally in feed mode and server-side in catalogue mode. Either way the output is identical.

### Common use cases

- **Disaster-response triggers.** Watch `significant_hour` on a schedule and fire a webhook when `alert` goes orange or red.
- **Insurance catastrophe modelling.** Pull decades of M5+ events inside a bounding box and score exposure.
- **Public safety dashboards.** A live map fed by `all_hour` with depth and magnitude.
- **Newsroom monitoring.** `felt` and `cdi` tell you which quakes people actually noticed, not just which were large.
- **Research and teaching.** Reproducible regional seismicity extracts with a stable schema.

### Quick start

Everything that happened in the last day:

```json
{
 "feed": "all_day"
}
```

Notable quakes of the past month:

```json
{
 "feed": "significant_month"
}
```

Every M5+ event around Japan in July 2026, from the full catalogue:

```json
{
 "fromDate": "2026-07-01",
 "toDate": "2026-08-01",
 "minMagnitude": "5",
 "boundingBox": {
 "minLatitude": 30,
 "maxLatitude": 45,
 "minLongitude": 125,
 "maxLongitude": 150
 }
}
```

Cheap five-minute watch loop:

```json
{
 "feed": "all_hour",
 "minMagnitude": "2.5",
 "maxResults": 200
}
```

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `feed` | string | `all_day` | One of the 20 USGS summary feeds, named `<magnitude>_<window>`. Ignored when a date window is set. |
| `minMagnitude` | string | - | Magnitude floor, e.g. `"4.5"`. A text field because Apify input schemas have no decimal type; it is parsed as a number. |
| `boundingBox` | object | - | `{ minLatitude, maxLatitude, minLongitude, maxLongitude }`. Any subset works, omitted edges are unbounded. |
| `fromDate` | string | - | `YYYY-MM-DD` or ISO 8601. **Switches the run to the full catalogue.** |
| `toDate` | string | - | `YYYY-MM-DD` or ISO 8601. Also switches to the catalogue. Defaults to now. |
| `maxResults` | integer | `0` | Cap on total events saved. `0` = no limit. Catalogue paging stops the moment it is reached. |

`feed` and the date window are mutually exclusive in effect: if you set a date, the feed is not read at all.

### Output example

```json
{
 "eventId": "us6000ti8i",
 "magnitude": 6.3,
 "magType": "mww",
 "place": "south of the Kermadec Islands",
 "time": "2026-08-05T11:43:27.317Z",
 "updated": "2026-08-06T11:51:38.507Z",
 "longitude": 179.4727,
 "latitude": -33.8063,
 "depth": 226.084,
 "tsunami": false,
 "alert": "green",
 "felt": 14,
 "cdi": 3.1,
 "mmi": 3.316,
 "significance": 615,
 "url": "https://earthquake.usgs.gov/earthquakes/eventpage/us6000ti8i",
 "scrapedAt": "2026-08-06T12:00:00.000Z"
}
```

### API example

```bash
curl -X POST "https://api.apify.com/v2/acts/arman-bd~usgs-earthquakes-scraper/run-sync-get-dataset-items?token=YOUR_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{
 "feed": "significant_month",
 "minMagnitude": "5"
 }'
```

### JavaScript example

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

const client = new ApifyClient({ token: 'YOUR_TOKEN' });
const run = await client.actor('arman-bd/usgs-earthquakes-scraper').call({
 fromDate: '2026-07-01',
 toDate: '2026-08-01',
 minMagnitude: '5',
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const q of items) console.log(`M${q.magnitude} ${q.place}, ${q.time}`);
```

### Notes

- **A misspelled feed is caught properly.** USGS serves unknown summary files as HTTP 200 with the plain-text body `404 File Not Found`, so the status code alone is not enough. This Actor validates the feed name up front and still parses defensively.
- **Timestamps are converted.** USGS reports `time` and `updated` as epoch milliseconds; both are emitted as ISO 8601 UTC strings so they sort and join correctly everywhere.
- **`tsunami` is a boolean.** The source uses `0`/`1`. Note it means "in a tsunami-notification zone", not "a tsunami occurred".
- **Catalogue paging is discovered, not declared.** `fdsnws` returns no total count, so pages of 20,000 are requested until a short page comes back. A page that fails is recorded in `RUN_SUMMARY.failures` and everything already collected is kept.
- **Transient errors are retried.** 429, 5xx and network errors get four attempts with exponential backoff (0.5 s → 1 s → 2 s). A malformed query fails immediately rather than burning retries.
- **Public data only.** No authentication, no personal data, no access-control bypass.

### FAQ

**Do I need a proxy?** No. Proxy configuration is not required to run this Actor.

**Do I need an account on the source?** No, and there is no credentials to manage.

**What happens if a request fails?** It is reported in `RUN_SUMMARY.failures` and the run continues with whatever it already has. The Actor only errors out if every request failed.

**Can I schedule it?** Yes, it is designed for scheduled runs, and `all_hour` at a five-minute cadence is a normal pattern.

**How do I get only new events?** De-duplicate on `eventId`. Note that `updated` changes as USGS revises a solution, so re-running will legitimately return revised copies of events you have already seen.

**How far back can I go?** The summary feeds cover the last month. Set `fromDate` to reach the full catalogue, which goes back to 1900.

**What is `significance`?** A USGS score from 0 to 1000 combining magnitude, felt reports and estimated impact. Events above 600 are what "significant" feeds select on.

**Why is `alert` sometimes null?** PAGER only runs on larger events. Small quakes have no alert level, and that is not an error.

**Can I integrate it with something else?** Yes, Apify API, client libraries, webhooks, scheduled runs, dataset exports (JSON/CSV/Excel) or MCP. Output is structured JSON.

# Actor input Schema

## `feed` (type: `string`):

Which pre-baked USGS summary feed to read. Named <magnitude>\_<window>: 'all', '1.0', '2.5', '4.5' or 'significant', combined with 'hour', 'day', 'week' or 'month'. Ignored when a date window is set. that switches the run to the full catalogue.

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

Keep only events at or above this magnitude, e.g. '4.5'. Applied by USGS when a date window is set, and locally otherwise. Leave empty for no magnitude floor. (Text field rather than a number because Apify input schemas have no decimal type.)

## `boundingBox` (type: `object`):

Geographic bounds as { minLatitude, maxLatitude, minLongitude, maxLongitude }. Any subset is allowed. omitted edges are unbounded. Leave empty for worldwide.

## `fromDate` (type: `string`):

Start of the time window as YYYY-MM-DD or an ISO 8601 timestamp. Setting this (or 'toDate') switches the run from the summary feeds to the full USGS catalogue, which reaches back to 1900.

## `toDate` (type: `string`):

End of the time window as YYYY-MM-DD or an ISO 8601 timestamp. Defaults to now when 'fromDate' is set.

## `maxResults` (type: `integer`):

Cap the total number of events saved. Set 0 for no limit. Catalogue paging stops as soon as the cap is reached.

## Actor input object example

```json
{
  "feed": "4.5_week",
  "minMagnitude": "4.5",
  "boundingBox": {
    "minLatitude": 30,
    "maxLatitude": 45,
    "minLongitude": 125,
    "maxLongitude": 150
  },
  "fromDate": "2026-07-01",
  "toDate": "2026-08-01",
  "maxResults": 0
}
```

# Actor output Schema

## `items` (type: `string`):

Every record the run produced.

## `runsummary` (type: `string`):

The RUN\_SUMMARY record from the run's key-value store.

# 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 = {
    "feed": "significant_month"
};

// Run the Actor and wait for it to finish
const run = await client.actor("arman-bd/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 = { "feed": "significant_month" }

# Run the Actor and wait for it to finish
run = client.actor("arman-bd/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 '{
  "feed": "significant_month"
}' |
apify call arman-bd/usgs-earthquakes-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,arman-bd/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/cXL1be3je8lZQ1JmN/builds/6L9Nm45Anraq0JPBe/openapi.json
