# EMSC API

> Returns earthquakes from the Euro-Mediterranean Seismological Centre: latest, searched by window, nearby, counts and single events.

Category: Government & Open Data. Region: global. 6 endpoints at `https://api.hoshime.com/v1/emsc/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/emsc
## GET /v1/emsc/latest

The most recent earthquakes in the Euro-Mediterranean region, newest first.

Scope: `social:read` · Units: 1 · Cached: 1 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `minMagnitude` | string | no | Smallest magnitude, such as 3. |
| `limit` | integer | no | Items per page, 1 to 200. (default 20) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `authority` (string), `depthKm` (number (double)), `id` (string), `latitude` (number (double)), `longitude` (number (double)), `magnitude` (number (double)), `magnitudeType` (string), `originAt` (string), `region` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/emsc/latest" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/emsc/search

Earthquakes in a time window and above a magnitude, newest first.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `minMagnitude` | string | no | Smallest magnitude, such as 4.5. (e.g. 7) |
| `start` | string | no | Start date, YYYY-MM-DD (UTC). (e.g. 2023-02-01) |
| `end` | string | no | End date, YYYY-MM-DD (UTC). Defaults to now. (e.g. 2023-02-28) |
| `limit` | integer | no | Items per page, 1 to 200. (default 20) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `authority` (string), `depthKm` (number (double)), `id` (string), `latitude` (number (double)), `longitude` (number (double)), `magnitude` (number (double)), `magnitudeType` (string), `originAt` (string), `region` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/emsc/search?minMagnitude=7&start=2023-02-01&end=2023-02-28" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/emsc/strongest

The strongest earthquakes of the Euro-Mediterranean region in a time window, largest magnitude first: the big events of a year, or of all time.

Scope: `social:read` · Units: 1 · Cached: 30 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `minMagnitude` | string | no | Smallest magnitude, such as 5. |
| `start` | string | no | Start date, YYYY-MM-DD (UTC). Leave it out for the whole catalogue. (e.g. 2023-02-01) |
| `end` | string | no | End date, YYYY-MM-DD (UTC). Defaults to now. (e.g. 2023-02-28) |
| `limit` | integer | no | Items per page, 1 to 200. (default 20; e.g. 3) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `authority` (string), `depthKm` (number (double)), `id` (string), `latitude` (number (double)), `longitude` (number (double)), `magnitude` (number (double)), `magnitudeType` (string), `originAt` (string), `region` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/emsc/strongest?start=2023-02-01&end=2023-02-28&limit=3" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/emsc/nearby

Earthquakes within a radius of a point, newest first.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `lat` | string | yes | Latitude of the centre, -90 to 90. (e.g. 38.11) |
| `lon` | string | yes | Longitude of the centre, -180 to 180. (e.g. 37.24) |
| `radiusKm` | string | no | Radius in kilometres, from 1 to 1000. (default 100; e.g. 50) |
| `minMagnitude` | string | no | Smallest magnitude, such as 3. (e.g. 7) |
| `start` | string | no | Start date, YYYY-MM-DD (UTC). (e.g. 2023-02-01) |
| `end` | string | no | End date, YYYY-MM-DD (UTC). Defaults to now. (e.g. 2023-02-28) |
| `limit` | integer | no | Items per page, 1 to 200. (default 20) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `authority` (string), `depthKm` (number (double)), `id` (string), `latitude` (number (double)), `longitude` (number (double)), `magnitude` (number (double)), `magnitudeType` (string), `originAt` (string), `region` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/emsc/nearby?lat=38.11&lon=37.24&radiusKm=50&minMagnitude=7&start=2023-02-01&end=2023-02-28" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/emsc/count

How many earthquakes the Seismic Portal lists for a magnitude and date window (30 days by default).

Scope: `social:read` · Units: 1 · Cached: 30 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `minMagnitude` | string | no | Smallest magnitude, such as 5. (e.g. 5) |
| `start` | string | no | Start date, YYYY-MM-DD (UTC). Defaults to 30 days ago. (e.g. 2024-01-01) |
| `end` | string | no | End date, YYYY-MM-DD (UTC). Defaults to now. (e.g. 2024-01-08) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `count` (integer (int64)), `endDate` (string), `minMagnitude` (string), `startDate` (string)

```bash
curl "https://api.hoshime.com/v1/emsc/count?minMagnitude=5&start=2024-01-01&end=2024-01-08" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/emsc/quake

One earthquake by its EMSC event id, such as 20240101_0000001.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | EMSC event id, such as 20240101_0000001. (e.g. 20240101_0000001) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `authority` (string), `depthKm` (number (double)), `id` (string), `latitude` (number (double)), `longitude` (number (double)), `magnitude` (number (double)), `magnitudeType` (string), `originAt` (string), `region` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/emsc/quake?id=20240101_0000001" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
