# USGS Earthquakes API

> Returns USGS earthquake feeds, searches, nearby and single events, counts, and named places near a point.

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

Earthquakes of a USGS summary feed, newest first.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `feed` | string | no | Feed: <magnitude>_<period>, magnitude significant, 4.5, 2.5, 1.0 or all; period hour, day, week or month. (one of significant_hour, significant_day, significant_week, significant_month, 4.5_hour, 4.5_day, 4.5_week, 4.5_month, 2.5_hour, 2.5_day, 2.5_week, 2.5_month, 1.0_hour, 1.0_day, 1.0_week, 1.0_month, all_hour, all_day, all_week, all_month; default all_day) |
| `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: `alert` (string), `depthKm` (number (double)), `id` (string), `latitude` (number (double)), `longitude` (number (double)), `magnitude` (number (double)), `magnitudeType` (string), `originAt` (string), `place` (string), `significance` (integer (int64)), `tsunami` (boolean), `url` (string)

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

## GET /v1/usgs/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). Defaults to 30 days ago. (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 | Most quakes to return, from 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: `alert` (string), `depthKm` (number (double)), `id` (string), `latitude` (number (double)), `longitude` (number (double)), `magnitude` (number (double)), `magnitudeType` (string), `originAt` (string), `place` (string), `significance` (integer (int64)), `tsunami` (boolean), `url` (string)

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

## GET /v1/usgs/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. 37.2) |
| `lon` | string | yes | Longitude of the centre, -180 to 180. (e.g. 37.0) |
| `radiusKm` | string | no | Radius in kilometres, from 1 to 1000. (default 100; e.g. 100) |
| `minMagnitude` | string | no | Smallest magnitude, such as 2.5. (e.g. 7) |
| `start` | string | no | Start date, YYYY-MM-DD (UTC). Defaults to 30 days ago. (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 | Most quakes to return, from 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: `alert` (string), `depthKm` (number (double)), `id` (string), `latitude` (number (double)), `longitude` (number (double)), `magnitude` (number (double)), `magnitudeType` (string), `originAt` (string), `place` (string), `significance` (integer (int64)), `tsunami` (boolean), `url` (string)

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

## GET /v1/usgs/quake

One earthquake by its USGS event id, such as us6000jllz.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | USGS event id, such as us6000jllz. (e.g. us6000jllz) |
| `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: `alert` (string), `depthKm` (number (double)), `id` (string), `latitude` (number (double)), `longitude` (number (double)), `magnitude` (number (double)), `magnitudeType` (string), `originAt` (string), `place` (string), `significance` (integer (int64)), `tsunami` (boolean), `url` (string)

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

## GET /v1/usgs/impact

How strongly one earthquake was felt: felt reports, community and shaking intensity, PAGER alert and tsunami flag, by USGS event id.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | USGS event id, such as us6000jllz. (e.g. us6000jllz) |
| `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: `alert` (string), `communityIntensity` (number (double)), `depthKm` (number (double)), `felt` (integer (int64)), `id` (string), `latitude` (number (double)), `longitude` (number (double)), `magnitude` (number (double)), `magnitudeType` (string), `originAt` (string), `place` (string), `shakingIntensity` (number (double)), `significance` (integer (int64)), `status` (string), `tsunami` (boolean), `url` (string)

```bash
curl "https://api.hoshime.com/v1/usgs/impact?id=us6000jllz" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/usgs/count

How many earthquakes match 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 4.5. (e.g. 4.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/usgs/count?minMagnitude=4.5&start=2024-01-01&end=2024-01-08" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/usgs/places

Named places (GeoNames cities, towns and villages) near a point, nearest first.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `lat` | string | yes | Latitude, -90 to 90. (e.g. -6.2) |
| `lon` | string | yes | Longitude, -180 to 180. (e.g. 106.8) |
| `radiusKm` | string | no | Radius in kilometres, from 1 to 1000. (default 100) |
| `limit` | integer | no | Most places to return, from 1 to 50. (default 10) |
| `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: `admin1` (string), `country` (string), `distanceKm` (number (double)), `featureCode` (string), `id` (string), `latitude` (number (double)), `longitude` (number (double)), `name` (string), `population` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/usgs/places?lat=-6.2&lon=106.8" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
