Standard APIGET /v1/forecast

Weather Forecast API

AI-powered hourly and daily forecasts up to 14 days ahead, with measurably better accuracy.

Our machine-learning ensemble models are trained on years of meteorological station data to predict temperature, precipitation, wind, and humidity with up to 40% greater accuracy than traditional NWP models. Retrieve hourly breakdowns, daily summaries, moon phases, sunrise/sunset, and optional weather alerts — all in a single response.

What You Get with the Weather Forecast API

Up to 40% more accurate

Back-tested against 50,000 global locations, our ML models consistently outperform traditional numerical weather prediction.

Up to 14 days ahead

Daily summaries for long-range planning and hourly data for short-range scheduling in the same request.

Precipitation probability

Separate chance-of-rain and chance-of-snow percentages, so users see the right risk at a glance.

Weather alerts included

Set alerts=yes to bundle active government-issued warnings into the forecast response — no second API call needed.

Flexible field selection

Use the include and exclude parameters to return only the data your app needs, keeping response payloads lean.

Sunrise, sunset & moon phase

Astronomical data for every forecast day — useful for photography, events, outdoor sports, and farming apps.

Who Uses This API

From startups to enterprise teams, the Weather Forecast API powers a wide range of real-world applications.

Weather apps & widgets

Power a 7-day forecast card or hourly timeline in any web or mobile application with a single, well-structured API call.

Event planning & venues

Help organisers and attendees anticipate conditions days in advance, reducing weather-related cancellations and complaints.

Logistics & fleet management

Route vehicles and schedule deliveries around predicted rain, wind, and temperature extremes to cut costs and delays.

Agriculture & irrigation

Schedule watering, planting, and harvesting around accurate 14-day rain and temperature forecasts to maximise yield.

Request Parameters

ParameterTypeRequiredDescriptionExample
qstringRequiredLocation — city, lat/lon, postcode, or IP addressNew York
daysintegerRequiredNumber of forecast days (1–14)7
unitsstringOptionalmetric | imperial | both (default: both)metric
includestringOptionalday | hour | all (default: all)day
excludestringOptionalComma-separated fields to omithumidity,uv
alertsstringOptionalInclude weather alerts: yes | noyes
aqistringOptionalInclude air quality data: yes | nono
langstringOptionalLanguage code for condition texten

Authenticate every request with the X-API-Key header.

Code Example

Request

cURL
curl "https://api.weatherai.io/v1/forecast?q=New+York&days=3&units=metric&include=day" \
  -H "X-API-Key: your-api-key"

Response

200 OKapplication/json
{
  "location": { "name": "New York", "country": "USA" },
  "forecast": [
    {
      "date": "2024-04-25",
      "temperature": { "max": { "celsius": 18 }, "min": { "celsius": 10 }, "avg": { "celsius": 14 } },
      "condition": { "text": "Sunny", "code": 1000 },
      "precipitation": { "mm": 0, "chanceOfRain": 5, "chanceOfSnow": 0 },
      "sunrise": "06:02 AM", "sunset": "07:51 PM"
    }
  ]
}

Response Fields

FieldTypeDescription
locationobjectLocation details (name, country, coords, timezone)
currentobjectCurrent conditions at time of request
forecast[]arrayArray of daily forecast objects
forecast[].datestringDate in YYYY-MM-DD
forecast[].temperature.max/min/avgobjectTemperature range
forecast[].precipitationobjectAmount, chanceOfRain, chanceOfSnow
forecast[].hourly[]arrayHourly breakdown (omitted if include=day)
forecast[].sunrise / sunsetstringAstronomical times
alerts[]arrayActive government weather alerts (if alerts=yes)

Start Using the Weather Forecast API Today

Create a free account and get your API key in under a minute. 1,000 free calls per day. No credit card required.

Get Your Free API Key