Skip to content

WMO weather code lookup

FREE with proof-of-workor $0.001 in USDCGET /api/wmo-weather-code

Turn a WMO weather interpretation code (the weatherCode field of a forecast, 0-99) into its text label and a category: clear, cloudy, fog, drizzle, rain, snow or thunderstorm, with flags for freezing and for precipitation. Send GET /api/wmo-weather-code with no required fields (1 optional) and pay $0.001 per call over x402 or MPP, or call it free by solving a proof-of-work challenge. It returns a JSON object with found, code, condition, category, freezing and 1 more.

With no code, returns the whole table.

Category: Live public dataTags: weather wmo weather-code lookup condition

Try in playground →

Parameters

NameTypeRequiredDescription
codenumbernoWMO weather code, 0-99; leave out for the whole table

Example request

curl -i "https://agent402.tools/api/wmo-weather-code?code=63"

Without payment this returns HTTP 402 Payment Required with the exact price for wmo-weather-code; any x402 v2 or MPP client pays it and retries.

Example response

{
  "found": true,
  "code": 63,
  "condition": "Moderate rain",
  "category": "rain",
  "freezing": false,
  "precipitation": true
}
FieldTypeAlways presentIn the example
foundbooleanyestrue
codenumberyes63
conditionstringyesModerate rain
categorystringyesrain
freezingbooleanyesfalse
precipitationbooleanyestrue

From an MCP client

catalog.call {
  "slug": "wmo-weather-code",
  "params": {
    "code": 63
  }
}

On the hosted connector at https://agent402.tools/mcp, catalog.call runs wmo-weather-code free (rate-limited, no wallet). Local install: npx -y agent402-mcp@0.13.32.

Errors and behavior

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.001" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/wmo-weather-code?code=63");

No wallet? Pay with compute

Fetch a challenge, solve the sha256 puzzle (16 leading zero bits, a fraction of a second of CPU), and resend with the X-Pow-Solution header:

import { createHash } from "node:crypto";
const lz = (b) => { let t = 0; for (const x of b) { if (!x) { t += 8; continue; } t += Math.clz32(x) - 24; break; } return t; };
const c = await (await fetch("https://agent402.tools/api/pow/challenge?slug=wmo-weather-code")).json();
let n = 0;
while (lz(createHash("sha256").update(c.challenge + ":" + n).digest()) < c.difficulty) n++;
await fetch("https://agent402.tools/api/wmo-weather-code?code=63", { method: "GET", headers: { "X-Pow-Solution": c.token + ":" + n } });

Related tools

Barcode product lookup

$0.005GET /api/barcode-lookup

Look up a product by its UPC/EAN barcode number via Open Food Facts (open data): name, brand, category, quantity.

EDGAR company lookup (ticker → CIK)

$0.001GET /api/edgar-company-lookup

Resolve a US stock ticker (e.g.

Heat index and wind chill calculator

FREE w/ computeor $0.001GET /api/heat-index-calc

Heat index, wind chill, humidex, dew point and wet-bulb temperature from the temperature, humidity and wind you supply.

Air quality (global)

$0.002GET /api/weather-air-quality

Air quality index and current pollutant concentrations for any location: US AQI, PM2.5, PM10, ozone, NO2, SO2, CO.

US weather alerts

$0.002GET /api/weather-alerts

Active National Weather Service alerts for a US state as clean JSON: event, severity, headline, affected areas.

Current weather (global)

$0.002GET /api/weather-current

Current weather conditions for any location on Earth: temperature, feels-like, humidity, wind speed/direction/gusts.