# Weather Alerts and Forecasts API
GET/v1/weatherdata/alerts/{alert_id}
One alert by id with description, instruction, areas, zone codes and polygon. The id `latest` is the most severe active alert right now (a stable id for probes and examples). Refreshes every 60 seconds.
Price
$0.002/ callEdge cache
30s
Uptime 24h
57.69%
p95
312ms
MCP tool
weatherdata_alerts-alert-id
This API provides active weather alerts, current observations, and hourly and daily forecasts for the United States and Australia. The data is normalized into one schema with a coverage field. The API offers a GET endpoint to retrieve one alert by id, including description, instruction, areas, zone codes, and polygon. The id latest returns the most severe active alert. The data refreshes every 60 seconds.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| alert_id* | path | string |
Code
# 1. No key, no payment: the gateway answers 402 with the price
curl -i "https://api.realtimeapi.ai/v1/weatherdata/alerts/latest"
# 2. Pay: retry with a signed x402 payment (any x402 client builds this header)
curl "https://api.realtimeapi.ai/v1/weatherdata/alerts/latest" -H "PAYMENT-SIGNATURE: $X402_PAYMENT"// npm i @x402/fetch @x402/core @x402/evm viem
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = x402Client.fromConfig({ schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(privateKeyToAccount(PRIVATE_KEY)) }] });
const pay = wrapFetchWithPayment(fetch, client);
const data = await (await pay("https://api.realtimeapi.ai/v1/weatherdata/alerts/latest")).json();
console.log(data);# pip install "x402[requests,evm]==2.27.0" eth-account
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact import register_exact_evm_client
client = x402ClientSync()
register_exact_evm_client(client, EthAccountSigner(Account.from_key(PRIVATE_KEY)))
session = x402_requests(client)
print(session.get("https://api.realtimeapi.ai/v1/weatherdata/alerts/latest").json())curl "https://api.realtimeapi.ai/v1/weatherdata/alerts/latest" -H "X-API-Key: $RTAPI_KEY"Frequently asked questions
What is the cost of this API?
The cost is $0.002 per request.
What is the refresh rate of the data?
The data refreshes every 60 seconds.
What is the `latest` id?
The `latest` id returns the most severe active alert right now.
What parameters are required for the GET endpoint?
The `alert_id` parameter is required.
What is the API method and path?
The API method is GET and the path is `/alerts/{alert_id}`.