# GET /earthquakes: $0.002 per call

Recent earthquakes near any point on Earth from the US Geological Survey: magnitude, place, time, depth, felt reports, tsunami flag and a link, newest first. Pass ?lat=35.68&lon=139.69&radius_km=300&min_magnitude=3&limit=10. Covers the last 30 days worldwide.

- **Price:** $0.002 in USDC, the same on Base, Solana, Polygon, Arbitrum. Failed calls are never charged.
- **Free trial:** yes, 20 free calls a day from Claude, Cursor or any MCP client ([set-up](/mcp/setup)).
- **Answers cached for:** 5 min
- **Data sources:** USGS Earthquake Hazards Program (free)
- **Lane:** Time, holidays & weather ([OpenAPI](/openapi/world.json))
- **Live health:** [status page](/status)

## Free sample

See an answer for the demo input first, free (no payment, 10 a minute): [https://aayatai.com/sample/earthquakes](/sample/earthquakes). It is a stored real answer when we have one, otherwise an example marked `"kind": "illustrative"`.

```bash
curl "https://aayatai.com/sample/earthquakes"
```

## 1. See the price (free)

Call it without paying: you get `402 Payment Required` and a `PAYMENT-REQUIRED` header with the exact price and where to pay.

```bash
curl -i "https://aayatai.com/earthquakes?lat=35.68&lon=139.69&radius_km=300&min_magnitude=3&limit=5"
```

## 2. Pay and call (TypeScript)

```bash
npm install @x402/fetch @x402/evm viem
```

```ts
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";

// A wallet used only by your agent, holding a little USDC on Base.
const account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as `0x${string}`);
const pay = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(account) }],
});

const res = await pay("https://aayatai.com/earthquakes?lat=35.68&lon=139.69&radius_km=300&min_magnitude=3&limit=5");
console.log(await res.json());
```

## 3. Or as an MCP tool

```ts
// MCP server: https://aayatai.com/mcp (Streamable HTTP). With the x402 MCP client (see /start):
const result = await client.callTool("earthquakes", {"lat":35.68,"lon":139.69,"radius_km":300,"min_magnitude":3,"limit":5});
```

## Inputs

- `lat` **(required)** (number): Latitude in decimal degrees.
- `lon` **(required)** (number): Longitude in decimal degrees.
- `radius_km` (integer; default `300`): Search radius in km (up to 20,000).
- `min_magnitude` (number; default `2.5`): Smallest magnitude to include.
- `limit` (integer; default `10`): How many earthquakes, newest first.

Bad inputs are rejected with HTTP 400 before any payment is asked for.

## Example answer

Example only: the shape of an answer, with placeholder addresses and made-up figures. It is not data about any real token or wallet; call the service (or its free sample) for real results.

```json
{
  "earthquakes": [
    {
      "magnitude": 4.9,
      "place": "2 km SW of Sakai, Japan",
      "timeMs": 1790624707515,
      "depthKm": 70.972,
      "longitude": 139.7782,
      "latitude": 36.0809,
      "feltReports": 66,
      "alert": null,
      "tsunami": 0,
      "url": "https://earthquake.usgs.gov/earthquakes/eventpage/us6000ty7u"
    },
    {
      "magnitude": 4.3,
      "place": "1 km SSW of Kōzaki, Japan",
      "timeMs": 1790469922364,
      "depthKm": 76.46,
      "longitude": 140.3909,
      "latitude": 35.8881,
      "feltReports": null,
      "alert": null,
      "tsunami": 0,
      "url": "https://earthquake.usgs.gov/earthquakes/eventpage/us6000txvq"
    },
    {
      "magnitude": 4.1,
      "place": "8 km ENE of Kariwa, Japan",
      "timeMs": 1790320702822,
      "depthKm": 165.7,
      "longitude": 138.7057,
      "latitude": 37.4587,
      "feltReports": null,
      "alert": null,
      "tsunami": 0,
      "url": "https://earthquake.usgs.gov/earthquakes/eventpage/us6000txjc"
    },
    {
      "magnitude": 4.5,
      "place": "91 km E of Namie, Japan",
      "timeMs": 1790029799302,
      "depthKm": 35,
      "longitude": 142.0357,
      "latitude": 37.5254,
      "feltReports": null,
      "alert": null,
      "tsunami": 0,
      "url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000tj1b"
    },
    {
      "magnitude": 4.7,
      "place": "58 km SE of Shima, Japan",
      "timeMs": 1789912496985,
      "depthKm": 357.877,
      "longitude": 137.3197,
      "latitude": 33.9889,
      "feltReports": null,
      "alert": null,
      "tsunami": 0,
      "url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000tirt"
    }
  ],
  "source": "USGS Earthquake Hazards Program (public domain)"
}
```

## Related

- [GET /time/convert](/services/time-convert) ($0.001): Convert a date and time between time zones, daylight saving handled.
- [GET /holidays](/services/holidays) ($0.002): Public holidays for 38 countries (most of Europe, UK by nation, US federal, Brazil, Mexico, South Africa) with regional holidays (e.g.
- [GET /weather](/services/weather) ($0.002): Weather now and forecast for any latitude/longitude on Earth: temperature, feels-like, wind, humidity, cloud, pressure, rain next hour, the next 12 hours, and d
- [GET /postcode/lookup](/services/postcode-lookup) ($0.001): Postal code to place name, region and latitude/longitude in about 60 countries (US ZIP codes, UK postcodes, Canada, Germany, France, India, Japan, Australia...)
- [GET /airport/status](/services/airport-status) ($0.002): Live US airport delays from the FAA: ground delay programs (average and maximum delay), ground stops, arrival and departure delays with trend, and closures, wit
- [GET /business-hours](/services/business-hours) ($0.001): Is a business open now (or at a given time), and when does it next open or close?

New here? [Getting started in 60 seconds](/start). All services: [Aayat AI](/).