# GET /weather: $0.002 per call

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 daily min/max, rain and summary for up to 9 days. Pass ?lat=51.51&lon=-0.13&days=3. From MET Norway (the Norwegian national weather service), all times UTC.

- **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:** 30 min
- **Data sources:** MET Norway Locationforecast (free, CC BY 4.0)
- **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/weather](/sample/weather). It is a stored real answer when we have one, otherwise an example marked `"kind": "illustrative"`.

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

## 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/weather?lat=51.51&lon=-0.13&days=2"
```

## 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/weather?lat=51.51&lon=-0.13&days=2");
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("weather", {"lat":51.51,"lon":-0.13,"days":2});
```

## Inputs

- `lat` **(required)** (number): Latitude in decimal degrees, e.g. 51.51.
- `lon` **(required)** (number): Longitude in decimal degrees, e.g. -0.13.
- `days` (integer; default `3`): Days of daily summary (UTC days, 1–9).
- `altitude` (integer): Optional ground height in metres, for a better temperature in hills.

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
{
  "location": {
    "lat": 51.51,
    "lon": -0.13,
    "altitudeM": 8
  },
  "updatedAt": "2026-09-29T05:20:02Z",
  "now": {
    "time": "2026-09-29T06:00:00Z",
    "temperatureC": 16.5,
    "feelsLikeC": 16.5,
    "humidityPct": 94.9,
    "cloudPct": 92.2,
    "pressureHpa": 1016.3,
    "windSpeedMs": 2.9,
    "windFromDeg": 88.6,
    "windFrom": "E",
    "precipitationNextHourMm": 0,
    "summary": "cloudy"
  },
  "next12Hours": [
    {
      "time": "2026-09-29T06:00:00Z",
      "temperatureC": 16.5,
      "precipitationMm": 0,
      "windSpeedMs": 2.9,
      "summary": "cloudy"
    }
  ],
  "days": [
    {
      "date": "2026-09-29",
      "minC": 14.2,
      "maxC": 19.8,
      "precipitationMm": 0.4,
      "maxWindMs": 4.1,
      "summary": "partly cloudy",
      "hoursCovered": 18
    }
  ],
  "units": {
    "temperature": "°C",
    "precipitation": "mm",
    "wind": "m/s",
    "pressure": "hPa",
    "times": "UTC (ISO 8601)"
  },
  "note": "A model forecast, not an observation. Days are UTC calendar days; the first and last may be partial (see hoursCovered).",
  "source": "Weather data from MET Norway (api.met.no), licensed CC BY 4.0"
}
```

## 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 100+ countries and years, with regional holidays (e.g.
- [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...)

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