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
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| q | string | Required | Location — city, lat/lon, postcode, or IP address | New York |
| days | integer | Required | Number of forecast days (1–14) | 7 |
| units | string | Optional | metric | imperial | both (default: both) | metric |
| include | string | Optional | day | hour | all (default: all) | day |
| exclude | string | Optional | Comma-separated fields to omit | humidity,uv |
| alerts | string | Optional | Include weather alerts: yes | no | yes |
| aqi | string | Optional | Include air quality data: yes | no | no |
| lang | string | Optional | Language code for condition text | en |
Authenticate every request with the X-API-Key header.
Code Example
Request
curl "https://api.weatherai.io/v1/forecast?q=New+York&days=3&units=metric&include=day" \
-H "X-API-Key: your-api-key"Response
{
"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
| Field | Type | Description |
|---|---|---|
| location | object | Location details (name, country, coords, timezone) |
| current | object | Current conditions at time of request |
| forecast[] | array | Array of daily forecast objects |
| forecast[].date | string | Date in YYYY-MM-DD |
| forecast[].temperature.max/min/avg | object | Temperature range |
| forecast[].precipitation | object | Amount, chanceOfRain, chanceOfSnow |
| forecast[].hourly[] | array | Hourly breakdown (omitted if include=day) |
| forecast[].sunrise / sunset | string | Astronomical times |
| alerts[] | array | Active government weather alerts (if alerts=yes) |
Related APIs
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