← Back to marketplace

Weather API

Current weather conditions and multi-day forecasts for any city worldwide. Returns temperature, conditions, wind, humidity, and pressure.

data
by APIHub2 endpoints100% uptime44ms avg

Includes 100 free calls per month

After the free quota, standard per-request pricing applies via x402 (USDC on Base).

Endpoints

GET/current
$0.0010/req

Get current weather conditions for a city. Query param: city (required).

GET/forecast
$0.0020/req

Get multi-day weather forecast for a city. Query params: city (required), days (1-7, default 3).

Quick start

Easiest way: the APIHub CLI. Credits cover x402, no wallet needed.

# install and set up once
npx @apihubio/cli register
npx @apihubio/cli topup 10

# call this service
npx @apihubio/cli call -X GET "https://proxy.apihub.io/weather/current?city=NYC"

Or call the proxy directly (curl / any HTTP client):

curl https://proxy.apihub.io/weather/current?city=NYC \
  -H "Authorization: Bearer ahk_your_key"

# If credits available: charged automatically, returns 200
# Otherwise: returns 402 (pay via @x402/fetch or top up credits)

Pricing calculator

Estimate your monthly cost for Weather API.

GET /current$0.0010/req
-
GET /forecast$0.0020/req
-