# Turkey Earthquake Scraper (`dodoflix/earthquake-scraper`) Actor

Scrape recent and historical earthquakes in Turkey from AFAD and Kandilli Observatory. Filter by date, magnitude, depth, province or radius. Fast HTTP scraper, no browser.

- **URL**: https://apify.com/dodoflix/earthquake-scraper.md
- **Developed by:** [Doğukan Metan](https://apify.com/dodoflix) (community)
- **Categories:** Other
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

## Turkey Earthquake Scraper

Get earthquakes in and around Turkey from the two official catalogs, [AFAD](https://deprem.afad.gov.tr) (Disaster and Emergency Management Authority) and [Kandilli Observatory](http://www.koeri.boun.edu.tr) (KOERI), as clean JSON, CSV or Excel. Filter by time window, magnitude, depth, province or distance from a point. Runs on plain HTTP, so it is fast and cheap, and the price already includes platform usage.

### What you can do with it

- **Monitor recent activity.** Schedule a run every hour and pull the latest earthquakes above a magnitude, then send them to Slack, a sheet or a webhook.
- **Check a province or district.** Keep only events whose location contains `Malatya`, `Kozan` or `Ege Denizi`. Turkish accents and capitals do not matter.
- **Search around a point.** Give a latitude, longitude and radius to see everything within, say, 100 km of Istanbul or a power plant.
- **Research and risk analysis.** Pull Kandilli's reviewed archive for a date range, for example the 2023 Kahramanmaraş sequence, with magnitude and depth filters.
- **Compare two sources.** Run both catalogs side by side. They report the same earthquakes with slightly different magnitudes and locations.

### Quick start

Open the Input tab and press Start: the prefilled input returns the last 24 hours from both sources. Or pick one of these:

**Latest earthquakes of magnitude 4 and above**

```json
{
    "lastHours": 168,
    "minMagnitude": 4
}
```

**Everything in Malatya since a date, from AFAD only**

```json
{
    "sources": ["afad"],
    "dateFrom": "2026-11-05",
    "locations": ["Malatya"]
}
```

**Within 120 km of Kahramanmaraş**

```json
{
    "nearLatitude": 37.5,
    "nearLongitude": 36.9,
    "radiusKm": 120,
    "minMagnitude": 1.5
}
```

**Kandilli archive: the February 2023 earthquakes of magnitude 5.5 and above**

```json
{
    "sources": ["kandilli"],
    "dateFrom": "2023-02-06",
    "dateTo": "2023-02-07",
    "minMagnitude": 5.5
}
```

### Input

| Field | What it does |
|---|---|
| `sources` | `afad`, `kandilli` or both (default both) |
| `lastHours` | Latest events: hours back from now (default 24). Ignored when `dateFrom` is set |
| `dateFrom`, `dateTo` | Time window in UTC: `YYYY-MM-DD` or a full timestamp. A plain `dateTo` includes that whole day |
| `minMagnitude`, `maxMagnitude` | Magnitude range |
| `minDepthKm`, `maxDepthKm` | Depth range in kilometres |
| `locations` | Names to match in the location text, province or district. Any match keeps the event |
| `nearLatitude`, `nearLongitude`, `radiusKm` | Radius search. Set all three |
| `maxItems` | Stop the whole run after this many earthquakes |
| `maxItemsPerSource` | Stop reading a source after this many |
| `maxConcurrency`, `maxRequestsPerMinute` | Request speed. The defaults (2 and 30) are enough: a run needs a handful of requests |
| `proxyConfiguration` | No proxy by default. Switch on a Turkish proxy only if your runs time out |

### Output

One item per earthquake. Download the dataset as JSON, CSV, Excel, XML or HTML, or read it through the API.

```json
{
    "source": "afad",
    "eventId": "734271",
    "time": "2026-11-15T20:04:10.000Z",
    "latitude": 37.56067,
    "longitude": 35.6355,
    "depthKm": 12.65,
    "magnitude": 2.5,
    "magnitudeType": "ML",
    "magnitudes": null,
    "location": "Kozan (Adana)",
    "country": "Türkiye",
    "province": "Adana",
    "district": "Kozan",
    "neighborhood": "Akdam",
    "status": null,
    "url": "https://deprem.afad.gov.tr/event-detail/734271"
}
```

```json
{
    "source": "kandilli",
    "eventId": "20261115204930",
    "time": "2026-11-15T20:49:30.000Z",
    "latitude": 37.8098,
    "longitude": 36.5875,
    "depthKm": 5.3,
    "magnitude": 1.7,
    "magnitudeType": "ML",
    "magnitudes": { "md": null, "ml": 1.7, "mw": null },
    "location": "CUKURHISAR-(KAHRAMANMARAS)",
    "country": null,
    "province": "Kahramanmaraş",
    "district": null,
    "neighborhood": "Cukurhisar",
    "status": "preliminary",
    "url": "http://www.koeri.boun.edu.tr/scripts/lst0.asp"
}
```

- `time` is ISO 8601 in UTC. Both sites' own clocks differ (AFAD UTC, Kandilli's live list Istanbul time); the Actor converts them, so every item is UTC.
- Numbers are numbers. Missing values are `null`, never a placeholder.
- AFAD gives its own `magnitude` and `magnitudeType` (ML, Mw, Mb and others). For Kandilli, `magnitude` is the largest of Mw, ML and MD, with that type named in `magnitudeType`, and `magnitudes` lists all three.
- Kandilli `eventId` is the UTC time to the second (the code Kandilli's archive uses). Kandilli has no page per event, so `url` points to its list.
- Kandilli `status` is `preliminary` (automatic solution) or `revised` (checked by an analyst). Kandilli's lists are plain ASCII, so its place names have no Turkish letters, but `province` is spelled properly.
- `province`, `district` and `neighborhood` are `null` for offshore and foreign events.
- Each source is deduplicated by `eventId`. The two sources are not merged: one earthquake appears once per source.

### What each source covers

| Source | Reach | Notes |
|---|---|---|
| AFAD | The most recent events. At the time of writing its public service returns roughly the last two weeks and nothing older | Updates within minutes. Most precise province, district and neighborhood |
| Kandilli live list | The last 500 events, about one week | Preliminary solutions, updates within minutes |
| Kandilli archive | Reviewed catalog, checked back to 1999 | Published with a delay of several weeks. A date range that reaches back past the live list automatically uses the archive; searches are slow (up to a minute per month) |

Events that are older than the live lists and newer than the end of the Kandilli archive are not available from either source. The log says when a part of the range returned nothing.

### Pricing

You pay per result: **$0.80 per 1,000 earthquakes**, and less on higher Apify plans (down to $0.70). Platform usage is included, so there are no extra charges. A run that finds nothing costs almost nothing. For example, a week of AFAD events of magnitude 2 and above is around 500 results, about $0.40.

You can cap spending on every run in the run options. The Actor stops cleanly when the cap is reached.

### FAQ

**Do I need a proxy?** No. Both sites answer plain requests.

**Why do the sources disagree on magnitude?** They run independent solutions from different station networks. A difference of 0.1 to 0.3 is normal.

**Why does a long date range return little from AFAD?** AFAD's public service only keeps recent events. Use Kandilli for older dates.

**Can I get an alert for big earthquakes?** Schedule the Actor every few minutes with `lastHours: 1` and a `minMagnitude`, and connect a webhook, Slack or email from the Integrations tab. Items you have already seen carry the same `eventId`.

**Can I use it from code?**

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('dodoflix/earthquake-scraper').call({
    lastHours: 24,
    minMagnitude: 3,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

**Something broke or a field is missing.** Open an issue on the Issues tab with the input you used.

### Legal

This Actor collects public earthquake catalogs. You are responsible for how you use the data, including the sites' terms and robots.txt.

### Türkçe özet

AFAD ve Kandilli Rasathanesi'nin deprem kayıtlarını tarih, büyüklük, derinlik, il veya yarıçap filtresiyle JSON, CSV ya da Excel olarak indirin. Proxy ayarı gerekmez, fiyata platform kullanımı dahildir.

# Actor input Schema

## `sources` (type: `array`):

AFAD (Disaster and Emergency Management Authority) event service and Kandilli Observatory lists. Both report the same earthquakes with slightly different magnitudes, so pick one source if you want each earthquake once.

## `lastHours` (type: `integer`):

Latest events: how many hours back to look from now. Ignored when 'Date from' is set.

## `dateFrom` (type: `string`):

Start of the time window, UTC. Use YYYY-MM-DD or a full timestamp such as 2023-02-06T00:00:00Z. Overrides 'Last hours'.

## `dateTo` (type: `string`):

End of the time window, UTC. A plain date includes that whole day. Leave empty for now.

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

Skip earthquakes weaker than this.

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

Skip earthquakes stronger than this.

## `minDepthKm` (type: `number`):

Skip earthquakes shallower than this.

## `maxDepthKm` (type: `number`):

Skip earthquakes deeper than this.

## `locations` (type: `array`):

Keep earthquakes whose location text contains any of these names. Ignores case and Turkish accents, so 'Izmir', 'İzmir' and 'IZMIR' all match. Examples: Malatya, Kozan, Ege Denizi.

## `nearLatitude` (type: `number`):

Radius search: latitude of the center point in decimal degrees (for example 41.0082 for Istanbul). Set together with center longitude and radius.

## `nearLongitude` (type: `number`):

Radius search: longitude of the center point in decimal degrees (for example 28.9784 for Istanbul).

## `radiusKm` (type: `number`):

Radius search: keep earthquakes within this distance of the center point.

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

Stop the whole run after this many earthquakes. Leave empty for no limit.

## `maxItemsPerSource` (type: `integer`):

Stop reading a source after this many earthquakes. Leave empty for no limit.

## `maxConcurrency` (type: `integer`):

Parallel requests. Kandilli's archive search is slow and drops connections under load, so keep this low.

## `maxRequestsPerMinute` (type: `integer`):

Request speed. A typical run needs only a few requests, so the default is far below what the sites tolerate.

## `proxyConfiguration` (type: `object`):

Both sites answer plain requests, so no proxy is used by default. If runs fail with timeouts or HTTP 403 from your Apify account, switch to a proxy with country TR.

## Actor input object example

```json
{
  "sources": [
    "afad",
    "kandilli"
  ],
  "lastHours": 24,
  "minMagnitude": 2.5,
  "maxItems": 100,
  "maxConcurrency": 2,
  "maxRequestsPerMinute": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "sources": [
        "afad",
        "kandilli"
    ],
    "lastHours": 24,
    "minMagnitude": 2.5,
    "maxItems": 100,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("dodoflix/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 = {
    "sources": [
        "afad",
        "kandilli",
    ],
    "lastHours": 24,
    "minMagnitude": 2.5,
    "maxItems": 100,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("dodoflix/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 '{
  "sources": [
    "afad",
    "kandilli"
  ],
  "lastHours": 24,
  "minMagnitude": 2.5,
  "maxItems": 100,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call dodoflix/earthquake-scraper --silent --output-dataset

```

## MCP server setup

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