# BGS UK Earthquakes Scraper (`parseforge/bgs-uk-earthquakes-scraper`) Actor

Collects UK earthquake events from the British Geological Survey public XML feed. Returns each earthquake as a flat row with magnitude, depth, location coordinates and origin time.

- **URL**: https://apify.com/parseforge/bgs-uk-earthquakes-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.90 / 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/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

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)](https://apify.com/parseforge?fpr=vmoqkp)

### BGS UK Earthquakes Scraper

**Scrape BGS UK earthquake data from the official British Geological Survey XML feed, up to a million events per run.** Each earthquake comes with its magnitude, depth, location coordinates, and origin time. No API key required. Export to CSV, JSON, Excel, or XML.

The British Geological Survey publishes near-real-time UK earthquake data, but manually checking their feed or copying records is slow. This Actor reads the official BGS XML feed directly, filters events by minimum magnitude, and returns each earthquake in one fixed schema. You get a clean dataset ready for analysis, without writing a single line of code.

| Who uses it | What they scrape BGS UK Earthquakes for |
|---|---|
| Seismology researchers | Building a local earthquake catalogue for the British Isles over a custom time window. |
| Insurance analysts | Assessing recent seismic activity near insured properties in the UK. |
| Data journalists | Pulling the latest UK earthquake data for a news story or interactive map. |
| Geology students | Collecting real-world BGS data for a dissertation or coursework project. |

### What it does

This Actor collects UK earthquake events from the BGS public XML feed and returns each one as a flat row with magnitude, depth, location, and time.

- 📏 **Magnitude filter:** set a minimum magnitude and the Actor discards smaller events before they reach your dataset.
- 🔗 **Configurable feed URL:** point the Actor at any BGS XML feed endpoint, including historical or regional subsets.
- 📊 **Fixed flat schema:** every earthquake arrives as one row with the same columns, ready for spreadsheets or databases.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with BGS UK Earthquakes data

**📈 Build a UK earthquake catalogue.**

A seismology researcher runs the Actor weekly against the BGS feed to maintain a growing dataset of British earthquakes for statistical analysis.

**🗺️ Populate a live hazard map.**

A developer schedules daily runs, filters to magnitude 2.0 and above, and pushes the results to a public-facing UK earthquake map.

**📰 Feed a news alert bot.**

A data journalist configures the Actor to pull the latest events and trigger a tweet or Slack message whenever a felt earthquake appears.

**📋 Supply an insurance risk model.**

An analyst extracts all BGS events above magnitude 1.5 for the past five years to correlate with claim locations.

### Why choose this scraper

|  | What you get |
|---|---|
| **Official BGS source** | Data comes straight from the British Geological Survey's public seismology feed, the authoritative source for UK earthquakes. |
| **No API key** | The feed is public. You do not need to register an application or manage tokens. |
| **Magnitude filtering** | Cut out microseisms and only keep events above your chosen threshold, saving storage and compute. |
| **Scalable collection** | Paid users can pull up to a million earthquake records in a single run for long-term studies. |

### How it compares

No other Store actor targets BGS UK Earthquakes the same way, so the honest comparison is with the alternatives teams actually weigh.

| | BGS UK Earthquakes Scraper | Build it in-house | By hand |
|---|---|---|---|
| Setup | Run it now, zero config | Days of engineering | None, but hours per pull |
| When BGS UK Earthquakes changes | Maintained for you | You fix it | You re-learn the page |
| Proxies, retries, anti-bot | Built in | Your problem | Browser only |
| Output | Fixed JSON schema, CSV/Excel export | Whatever you build | Copy-paste |
| Cost | Pay per result | Engineering time | Analyst hours |

### Configure the run

Drive the Actor from the official BGS XML feed URL and filter by minimum magnitude so only relevant earthquakes reach your dataset. The Input tab lists every parameter.

A first run with the defaults:

```json
{
  "maxItems": 10,
  "feedUrl": "http://quakes.bgs.ac.uk/feeds/MhSeismology.xml",
  "minMagnitude": 0
}
```

A larger pull:

```json
{
  "maxItems": 200,
  "feedUrl": "http://quakes.bgs.ac.uk/feeds/MhSeismology.xml",
  "minMagnitude": 0
}
```

### Pricing

Pay-per-result: **$0.001 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $0.10 |
| 1,000 results | $1.00 |
| 10,000 results | $10.00 |

New Apify accounts start with $5 in free credit.

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [BGS UK Earthquakes Scraper](https://apify.com/parseforge/bgs-uk-earthquakes-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to BGS UK Earthquakes through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/bgs-uk-earthquakes-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**Why am I getting no results?**

Check your minMagnitude filter. If it is set higher than any recent UK earthquake, the Actor will return an empty dataset. Try lowering it to 0 to see all events.

**The Actor fails with an error about the feed URL.**

Ensure the feedUrl field points to a valid BGS XML endpoint. The default is http://quakes.bgs.ac.uk/feeds/MhSeismology.xml. Test the URL in a browser first.

**I only got 10 results but I am a paid user.**

The maxItems input field defaults to 10. Increase it to the number you need, up to 1,000,000.

**The dataset has duplicate earthquakes.**

The BGS feed may include the same event in consecutive runs if it has not aged off the feed. Deduplicate on origin time and coordinates in your downstream processing.

**Some fields are empty in the output.**

The BGS feed sometimes omits optional fields like location description for automatic detections. Empty cells reflect missing data at the source, not a scraping error.

### FAQ

| Question | Answer |
|---|---|
| What data source does this Actor use? | It reads the public XML feed published by the British Geological Survey at quakes.bgs.ac.uk. This is the same feed that powers the BGS website. |
| Do I need an API key or login? | No. The BGS feed is openly accessible. You do not need to register, authenticate, or manage any credentials. |
| Can I filter by earthquake magnitude? | Yes. Set the minMagnitude input field and the Actor will only return events at or above that value. |
| How many earthquakes can I scrape in one run? | Free Apify users are limited to 10 events as a preview. Paid users can set maxItems up to 1,000,000 per run. |
| What format does the output come in? | You can export your dataset to CSV, JSON, Excel, or XML from the Apify platform. |
| Does this cover the whole United Kingdom? | Yes. The BGS feed includes earthquakes detected across the entire UK landmass and its surrounding waters. |
| Can I use a different BGS feed URL? | Yes. The feedUrl input field accepts any valid BGS XML endpoint, so you can target specific date ranges or regional feeds if BGS provides them. |
| How often is the BGS feed updated? | The British Geological Survey updates its feed in near real time as earthquakes are detected and reviewed. You can schedule the Actor to run as frequently as you need. |
| What fields does each earthquake record contain? | Each row includes the event's origin time, latitude, longitude, depth, magnitude, and location description, matching the BGS feed schema. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by British Geological Survey. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

## `maxItems` (type: `integer`):

Free users: limited to 10 earthquakes (preview). Paid users: optional, up to 1,000,000.

## `feedUrl` (type: `string`):

BGS XML feed URL.

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

Filter to magnitudes at or above this value.

## Actor input object example

```json
{
  "maxItems": 10,
  "feedUrl": "http://quakes.bgs.ac.uk/feeds/MhSeismology.xml"
}
```

# 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 = {
    "maxItems": 10,
    "feedUrl": "http://quakes.bgs.ac.uk/feeds/MhSeismology.xml",
    "minMagnitude": 0
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/bgs-uk-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 = {
    "maxItems": 10,
    "feedUrl": "http://quakes.bgs.ac.uk/feeds/MhSeismology.xml",
    "minMagnitude": 0,
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/bgs-uk-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 '{
  "maxItems": 10,
  "feedUrl": "http://quakes.bgs.ac.uk/feeds/MhSeismology.xml",
  "minMagnitude": 0
}' |
apify call parseforge/bgs-uk-earthquakes-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/bgs-uk-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/Ka1bZK6Ve6gRBfkaZ/builds/3el7TJmckqvaFDMWq/openapi.json
