# USGS Earthquake Hazards Program Feeds Scraper (`plainkitbin/usgs-earthquake-hazards-feeds`) Actor

Fetch USGS earthquake hazards program feed records as clean structured JSON. Not affiliated with USGS Earthquake Hazards Program Feeds.

- **URL**: https://apify.com/plainkitbin/usgs-earthquake-hazards-feeds.md
- **Developed by:** [PlainKit bin](https://apify.com/plainkitbin) (community)
- **Categories:** Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.09 / 1,000 usgs earthquake records

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 Hazards Program Feeds Scraper

### Introduction

The USGS Earthquake Hazards Program Feeds Scraper extracts seismic feed records from earthquake.usgs.gov into clean structured JSON dataset rows. Seismologists, hazard response teams, geospatial analysts, and risk modeling systems need timely seismic data delivered as predictable flat records rather than deeply nested GeoJSON trees. This Actor bridges that gap.

One run asks the service for the magnitude threshold and time window you choose (from the past hour up to the past 30 days). It returns one row per earthquake event with event identifiers, magnitudes, coordinates, depth, review status, tsunami flags, and source links. Every field is copied directly from the feed response, so you can check each row against the authoritative source.

Use it to build daily seismic activity logs, track tremors around active faults, or feed dashboards and automated emergency alerting systems.

This Actor is an independent tool and is not affiliated with USGS Earthquake Hazards Program Real-time Feeds. It reads only from earthquake.usgs.gov.

### Input and output examples

Each delivered dataset row contains the following structure:

```json
{
  "alert": null,
  "cdi": null,
  "code": "41363287",
  "depth": 27.73,
  "detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/ci41363287.geojson",
  "dmin": 0.2617,
  "felt": null,
  "gap": 140,
  "id": "ci41363287",
  "ids": ",ci41363287,",
  "latitude": 33.64583,
  "longitude": -118.10783,
  "mag": 1.96,
  "magType": "ml",
  "mmi": null,
  "net": "ci",
  "nst": 27,
  "place": "11 km S of Seal Beach, CA",
  "rms": 0.37,
  "sig": 59,
  "sources": ",ci,",
  "status": "automatic",
  "time": 1795010349570,
  "title": "M 2.0 - 11 km S of Seal Beach, CA",
  "tsunami": 0,
  "type": "earthquake",
  "types": ",nearby-cities,origin,phase-data,scitech-link,",
  "tz": null,
  "updated": 1795010556509,
  "url": "https://earthquake.usgs.gov/earthquakes/eventpage/ci41363287"
}
```

If the service refuses the request (HTTP 401, 403, or 429), the run ends with one reason row, `{"reason_code": "USGS_API_REFUSED", "http_status": "429"}`, and that row is not charged.

### Tutorial

1. Open the Actor in Apify Console and select your desired `feed_magnitude` threshold (e.g. `all` or `2.5`).
2. Select your desired `feed_period` (e.g. `hour`, `day`, `week`, or `month`).
3. Set `max_items` to the number of rows you want, up to 1000.
4. Start the run and download the dataset as JSON, CSV, or Excel.

A run that is restarted by the platform does not deliver or charge a row twice. The Actor recognises rows already in the dataset by unique event ID.

### Pricing

- Pricing model: Apify Pay-Per-Event
- Event name: `earthquake-record`, charged once per pushed earthquake record
- Tier prices:
  - FREE tier: $0.003 per row
  - BRONZE: $0.0027 per row
  - SILVER: $0.0024 per row
  - GOLD: $0.00209 per row
  - PLATINUM: $0.00209 per row
  - DIAMOND: $0.002 per row

Each row is pushed first and charged right after the push. A refused charge stops the run and that row stays delivered but uncharged. A refused USGS request charges nothing.

### Actor recommendations

If you need hydrological data or gauge streamflow values from USGS, use the USGS NWIS Instantaneous Values Scraper. If you need atmospheric or space weather measurements, explore the NOAA Space Weather Data Scraper.

### FAQ and support

**Does the Actor alter or smooth magnitude readings?** No. Each measurement is copied exactly as the service returned it.

**Why are some optional fields null?** Fields like `felt`, `cdi`, `mmi`, or `alert` are only populated after community reports or ShakeMap calculations are generated.

**How do I report a problem?** Write to support@example.com with the run ID and input details.

### Configuration

| Field | Type | Description | Default |
| --- | --- | --- | --- |
| `feed_magnitude` | String | Magnitude filter: `all`, `1.0`, `2.5`, `4.5`, or `significant`. | `all` |
| `feed_period` | String | Time duration: `hour`, `day`, `week`, or `month`. | `hour` |
| `max_items` | Integer (1-1000) | Maximum total earthquake records to output in one run. | `10` |

#### Example input

```json
{
  "feed_magnitude": "all",
  "feed_period": "hour",
  "max_items": 5
}
```

# Actor input Schema

## `feed_magnitude` (type: `string`):

Earthquake magnitude threshold: all, 1.0, 2.5, 4.5, or significant.

## `feed_period` (type: `string`):

Feed time window: hour (past hour), day (past 24h), week (past 7 days), or month (past 30 days).

## `max_items` (type: `integer`):

Maximum total earthquake records to output (1 to 1000).

## Actor input object example

```json
{
  "feed_magnitude": "all",
  "feed_period": "hour",
  "max_items": 10
}
```

# Actor output Schema

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

Dataset items 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 = {
    "feed_magnitude": "all",
    "feed_period": "hour",
    "max_items": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("plainkitbin/usgs-earthquake-hazards-feeds").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_magnitude": "all",
    "feed_period": "hour",
    "max_items": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("plainkitbin/usgs-earthquake-hazards-feeds").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_magnitude": "all",
  "feed_period": "hour",
  "max_items": 10
}' |
apify call plainkitbin/usgs-earthquake-hazards-feeds --silent --output-dataset

```

## MCP server setup

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

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/JI4g3RYhzLLXsRWQf/builds/5YYvze4deYuYeuKd7/openapi.json
