Heat index and wind chill calculator
GET /api/heat-index-calcHeat index, wind chill, humidex, dew point and wet-bulb temperature from the temperature, humidity and wind you supply. Send GET /api/heat-index-calc with the required fields temperature and humidity 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 temperature, humidity, windSpeed, unit, windUnit and 8 more.
Heat index and wind chill follow the US National Weather Service formulas, with the heat index chart's published band; humidex follows Environment Canada; wet bulb is the Stull approximation. Each value says when its formula does not apply. Celsius or Fahrenheit.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
temperature | number | yes | Air temperature, in units |
humidity | number | yes | Relative humidity, 1-100 percent |
windSpeed | number | no | Wind speed for wind chill: km/h, or mph with units=fahrenheit (optional) |
units | string | no | celsius (default; wind in km/h) or fahrenheit (wind in mph) |
Example request
curl -i "https://agent402.tools/api/heat-index-calc?temperature=35&humidity=60&windSpeed=10"
Without payment this returns HTTP 402 Payment Required with the exact price for heat-index-calc; any x402 v2 or MPP client pays it and retries.
Example response
{
"temperature": 35,
"humidity": 60,
"windSpeed": 10,
"unit": "°C",
"windUnit": "km/h",
"heatIndex": 45.1,
"heatIndexBand": "Danger",
"humidex": 48.5,
"dewPoint": 26.1,
"wetBulb": 28.5,
"windChill": null,
"windChillNote": "Wind chill is defined for 10 °C (50 °F) or colder with wind above 4.8 km/h (3 mph).",
"methods": {
"heatIndex": "US National Weather Service (Rothfusz regression with adjustments)",
"windChill": "US National Weather Service (2001)",
"humidex": "Environment Canada",
"dewPoint": "Magnus formula",
"wetBulb": "Stull (2011)"
}
}| Field | Type | Always present | In the example |
|---|---|---|---|
temperature | number | yes | 35 |
humidity | number | yes | 60 |
windSpeed | number | yes | 10 |
unit | string | yes | °C |
windUnit | string | yes | km/h |
heatIndex | number | yes | 45.1 |
heatIndexBand | string | yes | Danger |
humidex | number | yes | 48.5 |
dewPoint | number | yes | 26.1 |
wetBulb | number | yes | 28.5 |
windChill | null | no | null |
windChillNote | string | yes | Wind chill is defined for 10 °C (50 °F) or colder with wind above 4.8 km/h (3... |
methods | object | yes | 5 fields: heatIndex, windChill, humidex, dewPoint, wetBulb |
From an MCP client
catalog.call {
"slug": "heat-index-calc",
"params": {
"temperature": 35,
"humidity": 60,
"windSpeed": 10
}
}On the hosted connector at https://agent402.tools/mcp, catalog.call runs heat-index-calc free (rate-limited, no wallet). Local install: npx -y agent402-mcp@0.13.32.
Errors and behavior
temperatureandhumidityare required. An input the tool rejects returns an HTTP 4xx whose body carrieserror,tool,expected,requiredandexample, so the caller can correct it.- A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement runs after the tool and only on a successful response. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Free tier: no outbound network call leaves the server for this tool, so proof-of-work (16 leading zero bits of sha256) pays for it.
- A
POSTwith a JSON body to /api/heat-index-calc is served as this GET, with the body as the input. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB is not replayed).
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/heat-index-calc?temperature=35&humidity=60&windSpeed=10");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=heat-index-calc")).json();
let n = 0;
while (lz(createHash("sha256").update(c.challenge + ":" + n).digest()) < c.difficulty) n++;
await fetch("https://agent402.tools/api/heat-index-calc?temperature=35&humidity=60&windSpeed=10", { method: "GET", headers: { "X-Pow-Solution": c.token + ":" + n } });Related tools
AQI calculator (US EPA)
US EPA Air Quality Index from the pollutant concentrations you supply: PM2.5 and PM10 (µg/m³, 24-hour), ozone (ppb.
Degree days calculator
Heating, cooling and growing degree days from a daily temperature series you supply: daily means, or min/max pairs (the.
Air quality (global)
Air quality index and current pollutant concentrations for any location: US AQI, PM2.5, PM10, ozone, NO2, SO2, CO.
US weather alerts
Active National Weather Service alerts for a US state as clean JSON: event, severity, headline, affected areas.
Current weather (global)
Current weather conditions for any location on Earth: temperature, feels-like, humidity, wind speed/direction/gusts.
Daily forecast (global)
7-day daily weather forecast for any location: high/low temp, precipitation sum and probability, max wind, UV index.