# USGS Earthquake Scraper - Magnitude & Location Data (`thirdwatch/usgs-earthquake-scraper`) Actor

Export official USGS earthquake events with magnitude, coordinates, depth, alert level, tsunami flag, significance, and source links.

- **URL**: https://apify.com/thirdwatch/usgs-earthquake-scraper.md
- **Developed by:** [Thirdwatch](https://apify.com/thirdwatch) (community)
- **Categories:** Education, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 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?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## USGS Earthquake Scraper

> Export official earthquake events with magnitude, location, depth, alerts, tsunami flags, and source links.

### What you get

Query the USGS Earthquake Catalog and save structured GeoJSON events as ordinary Apify dataset rows. Control the time range, magnitude and depth bounds, alert level, sort order, and result limit. The default run returns significant recent activity from the last seven days, while date inputs make historical and scheduled monitoring workflows repeatable.

### Output fields

| Field | Description |
|---|---|
| `id`, `title`, `place` | USGS event identity and description |
| `magnitude`, `magnitude_type`, `significance` | Magnitude measurements and significance score |
| `time`, `updated`, `status` | Event and revision timestamps |
| `latitude`, `longitude`, `depth_km` | Hypocenter coordinates |
| `alert`, `tsunami`, `felt_reports` | Impact indicators |
| `cdi`, `mmi`, `station_count`, `rms`, `azimuthal_gap` | Scientific quality and intensity fields |
| `source_url`, `detail_url`, `source` | Official USGS resources |

### Example output

```json
{"id":"us7000abcd","magnitude":5.1,"place":"120 km from Example","depth_km":10,"tsunami":false,"significance":400}
```

### Input parameters

| Parameter | Required | Description |
|---|---|---|
| `startTime` | No | ISO start date or timestamp; empty means seven days ago |
| `endTime` | No | ISO end date or timestamp; empty means now |
| `minMagnitude` | No | Minimum magnitude; defaults to 4.5 |
| `maxMagnitude` | No | Optional maximum magnitude |
| `minDepth` | No | Optional minimum depth in kilometers |
| `maxDepth` | No | Optional maximum depth in kilometers |
| `alertLevel` | No | Any, green, yellow, orange, or red |
| `orderBy` | No | Sort by newest, oldest, largest, or smallest |
| `maxResults` | No | Maximum events; defaults to 10 |

### Use cases

- Risk teams can monitor significant events near operations.
- Researchers can create bounded historical earthquake datasets.
- Newsrooms can feed event alerts into editorial dashboards.
- Developers can automate geospatial enrichment without parsing GeoJSON.

### Limitations

USGS event parameters can change as seismologists review data. The catalog is not an emergency-warning service, and an event's presence, magnitude, location, alert, or tsunami flag must not replace official safety instructions. Large historical queries may hit the upstream 20,000-event limit; narrow dates or raise the minimum magnitude when needed.

### Compared to alternatives

This Actor exposes the official FDSN Event API through an Apify-native input, dataset view, PPE model, saved Tasks, and scheduling. It normalizes coordinates and millisecond timestamps, which reduces work compared with maintaining raw GeoJSON ingestion code.

### FAQ

#### Does an empty time range search all history?

No. For a safe first run, it defaults to the last seven days.

#### Can I use it for tsunami warnings?

No. The flag is catalog metadata. Use official warning authorities for safety decisions.

Explore [USGS Earthquake Scraper on thirdwatch.dev](https://thirdwatch.dev/scrapers/usgs-earthquake-scraper). Related Actors: [Google News Scraper](https://apify.com/thirdwatch/google-news-scraper), [FEMA Disaster Scraper](https://apify.com/thirdwatch/fema-disaster-scraper), and [GDELT News Scraper](https://apify.com/thirdwatch/gdelt-news-scraper).

Last verified: 2026-07

# Actor input Schema

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

ISO date or timestamp. Empty defaults to seven days ago.

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

ISO date or timestamp. Empty defaults to now.

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

Smallest earthquake magnitude to return.

## `maxMagnitude` (type: `number`):

Optional largest earthquake magnitude.

## `minDepth` (type: `number`):

Optional minimum event depth in kilometers.

## `maxDepth` (type: `number`):

Optional maximum event depth in kilometers.

## `alertLevel` (type: `string`):

Optional PAGER alert level.

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

Order events by time or magnitude.

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

Maximum earthquake events to save.

## Actor input object example

```json
{
  "startTime": "",
  "endTime": "",
  "minMagnitude": 4.5,
  "alertLevel": "",
  "orderBy": "time",
  "maxResults": 10
}
```

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

// Run the Actor and wait for it to finish
const run = await client.actor("thirdwatch/usgs-earthquake-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 = {
    "minMagnitude": 4.5,
    "maxResults": 10,
}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,thirdwatch/usgs-earthquake-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/xSQQUB6nQ9Ei9xT2l/builds/Qyj1ri1UWEYRBpYto/openapi.json
