Hourly forecasts and go/no-go verdicts for real plans. An agent sends a point and a time window, pays $0.002 in USDC, and gets back go, risky, or no-go — with the exact threshold breaches that produced it and alternative windows that would clear the same bar. Global, keyless, live.
git clone https://github.com/nirholas/x402-weather-guard
cd x402-weather-guard && npm install
npm run dev
| Route | Price | Returns |
|---|---|---|
GET /forecast | $0.001 | Hour-by-hour temperature, feels-like, precipitation probability and amount, wind, gusts, cloud, visibility, and plain-English conditions, with any active NWS alerts |
POST /decision | $0.002 | A verdict, the threshold breaches behind it, the worst hour, active alerts, and up to five non-overlapping alternative windows that would clear the same bar |
GET /, GET /health, GET /.well-known/x402 |
free | Service info, liveness, discovery manifest |
Every paid route returns the purchased artifact in the 200 response body.
The 402 challenge advertises both. Your client picks whichever it can sign.
base-sepolia · base on mainnetsolana · solana-devnet on devnetimport { wrapFetchWithPayment, createSigner } from "x402-fetch";
const signer = await createSigner("base-sepolia", process.env.PRIVATE_KEY!);
const payFetch = wrapFetchWithPayment(fetch, signer);
const res = await payFetch(
"http://localhost:4024/forecast?lat=47.6062&lon=-122.3321&hours=6"
);
const artifact = await res.json(); // purchased artifact, in-response