WeatherAPI · Schema

ForecastWeatherResponse

ForecastWeatherResponse schema from WeatherAPI.com

WeatherForecastHistoryMarineAstronomyGeolocationSportsAlertsPublic APIs

Properties

Name Type Description
location object Location metadata returned with every weather response.
current object
forecast object
alerts object
View JSON Schema on GitHub

JSON Schema

weatherapi-forecast-weather-response-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/weatherapi/refs/heads/main/json-schema/weatherapi-forecast-weather-response-schema.json",
  "title": "ForecastWeatherResponse",
  "description": "ForecastWeatherResponse schema from WeatherAPI.com",
  "type": "object",
  "properties": {
    "location": {
      "type": "object",
      "description": "Location metadata returned with every weather response.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Location name",
          "example": "London"
        },
        "region": {
          "type": "string",
          "description": "Region or state",
          "example": "City of London, Greater London"
        },
        "country": {
          "type": "string",
          "description": "Country name",
          "example": "United Kingdom"
        },
        "lat": {
          "type": "number",
          "format": "float",
          "description": "Latitude",
          "example": 51.5074
        },
        "lon": {
          "type": "number",
          "format": "float",
          "description": "Longitude",
          "example": -0.1278
        },
        "tz_id": {
          "type": "string",
          "description": "IANA timezone ID, e.g. Europe/London",
          "example": "Europe/London"
        },
        "localtime_epoch": {
          "type": "integer",
          "description": "Local time as Unix epoch",
          "example": 1748441400
        },
        "localtime": {
          "type": "string",
          "description": "Local date and time string",
          "example": "2026-05-28 15:30"
        }
      }
    },
    "current": {
      "type": "object",
      "properties": {
        "last_updated_epoch": {
          "type": "integer",
          "example": 1748441400
        },
        "last_updated": {
          "type": "string",
          "example": "2026-05-28 15:30"
        },
        "temp_c": {
          "type": "number",
          "description": "Temperature °C",
          "example": 18.5
        },
        "temp_f": {
          "type": "number",
          "description": "Temperature °F",
          "example": 65.3
        },
        "is_day": {
          "type": "integer",
          "description": "1=day, 0=night",
          "example": 1
        },
        "condition": {
          "type": "object",
          "properties": {
            "text": {
              "type": "string",
              "description": "Weather condition description",
              "example": "Partly Cloudy"
            },
            "icon": {
              "type": "string",
              "description": "URL to condition icon",
              "example": "//cdn.weatherapi.com/weather/64x64/day/116.png"
            },
            "code": {
              "type": "integer",
              "description": "Condition code (see conditions.json)",
              "example": 1003
            }
          }
        },
        "wind_mph": {
          "type": "number",
          "example": 12.4
        },
        "wind_kph": {
          "type": "number",
          "example": 12.4
        },
        "wind_degree": {
          "type": "integer",
          "example": 1
        },
        "wind_dir": {
          "type": "string",
          "description": "16-point compass direction",
          "example": "WSW"
        },
        "pressure_mb": {
          "type": "number",
          "example": 1013.0
        },
        "pressure_in": {
          "type": "number",
          "example": 1013.0
        },
        "precip_mm": {
          "type": "number",
          "example": 0.5
        },
        "precip_in": {
          "type": "number",
          "example": 0.5
        },
        "humidity": {
          "type": "integer",
          "description": "Humidity %",
          "example": 65
        },
        "cloud": {
          "type": "integer",
          "description": "Cloud cover %",
          "example": 40
        },
        "feelslike_c": {
          "type": "number",
          "example": 17.8
        },
        "feelslike_f": {
          "type": "number",
          "example": 17.8
        },
        "windchill_c": {
          "type": "number",
          "example": 12.4
        },
        "windchill_f": {
          "type": "number",
          "example": 12.4
        },
        "heatindex_c": {
          "type": "number",
          "example": 1.0
        },
        "heatindex_f": {
          "type": "number",
          "example": 1.0
        },
        "dewpoint_c": {
          "type": "number",
          "example": 1.0
        },
        "dewpoint_f": {
          "type": "number",
          "example": 1.0
        },
        "vis_km": {
          "type": "number",
          "example": 10.0
        },
        "vis_miles": {
          "type": "number",
          "example": 10.0
        },
        "uv": {
          "type": "number",
          "description": "UV Index",
          "example": 4.0
        },
        "gust_mph": {
          "type": "number",
          "example": 22.1
        },
        "gust_kph": {
          "type": "number",
          "example": 22.1
        },
        "short_rad": {
          "type": "number",
          "description": "GHI W/m² (paid plans)",
          "example": 1.0
        },
        "diff_rad": {
          "type": "number",
          "description": "DHI W/m² (paid plans)",
          "example": 1.0
        },
        "air_quality": {
          "type": "object",
          "description": "Air quality data. Returned when aqi=yes.",
          "properties": {
            "co": {
              "type": "number",
              "description": "Carbon monoxide µg/m³",
              "example": 1.0
            },
            "o3": {
              "type": "number",
              "description": "Ozone µg/m³",
              "example": 1.0
            },
            "no2": {
              "type": "number",
              "description": "Nitrogen dioxide µg/m³",
              "example": 1.0
            },
            "so2": {
              "type": "number",
              "description": "Sulphur dioxide µg/m³",
              "example": 1.0
            },
            "pm2_5": {
              "type": "number",
              "description": "PM2.5 µg/m³",
              "example": 1.0
            },
            "pm10": {
              "type": "number",
              "description": "PM10 µg/m³",
              "example": 1.0
            },
            "us-epa-index": {
              "type": "integer",
              "description": "US EPA index 1–6 (1=Good, 6=Hazardous)",
              "example": 1
            },
            "gb-defra-index": {
              "type": "integer",
              "description": "UK DEFRA index 1–10",
              "example": 1
            }
          }
        },
        "pollen": {
          "type": "object",
          "description": "Pollen data in grains/m³. Returned when pollen=yes (Pro+ and above).",
          "properties": {
            "Hazel": {
              "type": "number",
              "example": 1.0
            },
            "Alder": {
              "type": "number",
              "example": 1.0
            },
            "Birch": {
              "type": "number",
              "example": 1.0
            },
            "Oak": {
              "type": "number",
              "example": 1.0
            },
            "Grass": {
              "type": "number",
              "example": 1.0
            },
            "Mugwort": {
              "type": "number",
              "example": 1.0
            },
            "Ragweed": {
              "type": "number",
              "example": 1.0
            }
          }
        }
      }
    },
    "forecast": {
      "type": "object",
      "properties": {
        "forecastday": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date",
                "example": "2026-05-28"
              },
              "date_epoch": {
                "type": "integer",
                "example": 1748441400
              },
              "day": {
                "type": "object",
                "properties": {
                  "maxtemp_c": {
                    "type": "number",
                    "example": 18.5
                  },
                  "maxtemp_f": {
                    "type": "number",
                    "example": 65.3
                  },
                  "mintemp_c": {
                    "type": "number",
                    "example": 18.5
                  },
                  "mintemp_f": {
                    "type": "number",
                    "example": 65.3
                  },
                  "avgtemp_c": {
                    "type": "number",
                    "example": 18.5
                  },
                  "avgtemp_f": {
                    "type": "number",
                    "example": 65.3
                  },
                  "maxwind_mph": {
                    "type": "number",
                    "example": 12.4
                  },
                  "maxwind_kph": {
                    "type": "number",
                    "example": 12.4
                  },
                  "totalprecip_mm": {
                    "type": "number",
                    "example": 0.5
                  },
                  "totalprecip_in": {
                    "type": "number",
                    "example": 0.5
                  },
                  "totalsnow_cm": {
                    "type": "number",
                    "example": 1.0
                  },
                  "avgvis_km": {
                    "type": "number",
                    "example": 10.0
                  },
                  "avgvis_miles": {
                    "type": "number",
                    "example": 10.0
                  },
                  "avghumidity": {
                    "type": "integer",
                    "example": 65
                  },
                  "daily_will_it_rain": {
                    "type": "integer",
                    "example": 1
                  },
                  "daily_chance_of_rain": {
                    "type": "integer",
                    "example": 1
                  },
                  "daily_will_it_snow": {
                    "type": "integer",
                    "example": 1
                  },
                  "daily_chance_of_snow": {
                    "type": "integer",
                    "example": 1
                  },
                  "condition": {
                    "$ref": "#/components/schemas/Condition"
                  },
                  "uv": {
                    "type": "number",
                    "example": 4.0
                  },
                  "air_quality": {
                    "$ref": "#/components/schemas/AirQuality"
                  }
                }
              },
              "astro": {
                "type": "object",
                "properties": {
                  "sunrise": {
                    "type": "string",
                    "example": "05:30 AM"
                  },
                  "sunset": {
                    "type": "string",
                    "example": "08:45 PM"
                  },
                  "moonrise": {
                    "type": "string",
                    "example": "10:15 PM"
                  },
                  "moonset": {
                    "type": "string",
                    "example": "06:42 AM"
                  },
                  "moon_phase": {
                    "type": "string",
                    "example": "Waxing Crescent"
                  },
                  "moon_illumination": {
                    "type": "number",
                    "example": 35.0
                  },
                  "is_moon_up": {
                    "type": "integer",
                    "example": 1
                  },
                  "is_sun_up": {
                    "type": "integer",
                    "example": 1
                  }
                }
              },
              "hour": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/HourForecast"
                }
              }
            }
          }
        }
      }
    },
    "alerts": {
      "type": "object",
      "properties": {
        "alert": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "headline": {
                "type": "string",
                "example": "sample value"
              },
              "msgtype": {
                "type": "string",
                "example": "sample value"
              },
              "severity": {
                "type": "string",
                "example": "sample value"
              },
              "urgency": {
                "type": "string",
                "example": "sample value"
              },
              "areas": {
                "type": "string",
                "example": "sample value"
              },
              "category": {
                "type": "string",
                "example": "sample value"
              },
              "certainty": {
                "type": "string",
                "example": "sample value"
              },
              "event": {
                "type": "string",
                "example": "Severe Thunderstorm Warning"
              },
              "note": {
                "type": "string",
                "example": "sample value"
              },
              "effective": {
                "type": "string",
                "example": "2026-05-28T13:00:00Z"
              },
              "expires": {
                "type": "string",
                "example": "2026-05-28T13:00:00Z"
              },
              "desc": {
                "type": "string",
                "example": "Severe thunderstorms with damaging winds expected in the warning area."
              },
              "instruction": {
                "type": "string",
                "example": "sample value"
              }
            }
          }
        }
      }
    }
  }
}