WeatherAPI.com

App · Weather & Space · 4 actions

Look up weather from WeatherAPI.com: current conditions, a daily or hourly forecast up to 14 days out, government weather alerts, air quality, and sun and moon times. Connects with a free API key.

Actions

ActionWhat it does
Get current weatherGet the current conditions for a location: temperature, what it feels like, wind, humidity, visibility, UV, and optionally air quality.
Get sun and moon timesGet sunrise, sunset, moonrise, moonset, and the moon phase for a location on a given date.
Get weather forecastGet a daily weather forecast for a location, with highs and lows, chance of rain, sunrise and sunset, and optionally an hour-by-hour breakdown and any active weather alerts.
Search weather locationsFind locations matching a partial name.

Get current weather

Get the current conditions for a location: temperature, what it feels like, wind, humidity, visibility, UV, and optionally air quality.

Inputs

LocationlocationtextRequired
Where to look up. Accepts a city name ('London'), 'city,country' ('Paris,FR'), a postcode ('10001' or 'SW1'), latitude and longitude ('48.86,2.35'), an airport IATA code ('iata:DXB'), or 'auto:ip' for the caller's location.
Include air qualityinclude_air_qualitytrue/false
Include air quality readings and the US EPA and UK DEFRA indexes. Off by default.
Langlangtext
Language for the condition text, e.g. fr, es, de, ja. Leave blank for English. Only the condition wording changes; field names do not.

Outputs

currentobject
locationobject
Example output
{
  "current": {
    "air_quality": {
      "co": 230.3,
      "gb_defra_index": 2,
      "no2": 14.8,
      "o3": 58.6,
      "pm10": 8.4,
      "pm2_5": 6.1,
      "so2": 5.2,
      "us_epa_index": 1
    },
    "cloud": 50,
    "condition": {
      "code": 1003,
      "icon_url": "https://cdn.weatherapi.com/weather/64x64/day/116.png",
      "text": "Partly cloudy"
    },
    "feelslike_c": 5.6,
    "feelslike_f": 42.1,
    "gust_kph": 28.0,
    "gust_mph": 17.4,
    "humidity": 71,
    "is_day": true,
    "last_updated": "2026-01-28 14:15",
    "last_updated_epoch": 1769609700,
    "precip_in": 0.0,
    "precip_mm": 0.0,
    "pressure_in": 29.88,
    "pressure_mb": 1012.0,
    "temp_c": 8.0,
    "temp_f": 46.4,
    "uv": 1.0,
    "vis_km": 10.0,
    "vis_miles": 6.0,
    "wind_degree": 250,
    "wind_dir": "WSW",
    "wind_kph": 19.1,
    "wind_mph": 11.9
  },
  "location": {
    "country": "United Kingdom",
    "lat": 51.52,
    "localtime": "2026-01-28 14:30",
    "localtime_epoch": 1769610600,
    "lon": -0.11,
    "name": "London",
    "region": "City of London, Greater London",
    "tz_id": "Europe/London"
  }
}

Get sun and moon times

Get sunrise, sunset, moonrise, moonset, and the moon phase for a location on a given date.

Inputs

LocationlocationtextRequired
Where to look up. Accepts a city name ('London'), 'city,country' ('Paris,FR'), a postcode ('10001' or 'SW1'), latitude and longitude ('48.86,2.35'), an airport IATA code ('iata:DXB'), or 'auto:ip' for the caller's location.
Datedatedate
Date to look up, YYYY-MM-DD. Defaults to today at the location.

Outputs

astronomyobject
locationobject
Example output
{
  "astronomy": {
    "is_moon_up": true,
    "is_sun_up": true,
    "moon_illumination": 78,
    "moon_phase": "Waxing Gibbous",
    "moonrise": "11:02 AM",
    "moonset": "01:24 AM",
    "sunrise": "07:39 AM",
    "sunset": "04:47 PM"
  },
  "location": {
    "country": "United Kingdom",
    "lat": 51.52,
    "localtime": "2026-01-28 14:30",
    "localtime_epoch": 1769610600,
    "lon": -0.11,
    "name": "London",
    "region": "City of London, Greater London",
    "tz_id": "Europe/London"
  }
}

Get weather forecast

Get a daily weather forecast for a location, with highs and lows, chance of rain, sunrise and sunset, and optionally an hour-by-hour breakdown and any active weather alerts. Also returns the current conditions so a single step can cover both.

Inputs

LocationlocationtextRequired
Where to look up. Accepts a city name ('London'), 'city,country' ('Paris,FR'), a postcode ('10001' or 'SW1'), latitude and longitude ('48.86,2.35'), an airport IATA code ('iata:DXB'), or 'auto:ip' for the caller's location.
Daysdaysnumber
How many days to forecast, 1 to 14, counting today. Defaults to 3. How many your key actually serves depends on your WeatherAPI plan.
Include hourlyinclude_hourlytrue/false
Include the 24 hourly entries for each day. Off by default, since it makes the response much larger.
Include alertsinclude_alertstrue/false
Include any government weather alerts in effect for the location. Off by default.
Include air qualityinclude_air_qualitytrue/false
Include air quality readings. Off by default.
Langlangtext
Language for the condition text, e.g. fr, es, de, ja. Leave blank for English. Only the condition wording changes; field names do not.

Outputs

alertslist
Weather alerts in effect. Empty unless include_alerts was turned on, and empty when none are active.
countnumber
Number of forecast days returned.
currentobject
forecast_dayslist
One entry per forecast day, earliest first.
locationobject
Example output
{
  "alerts": [],
  "count": 1,
  "current": {
    "air_quality": {
      "co": 230.3,
      "gb_defra_index": 2,
      "no2": 14.8,
      "o3": 58.6,
      "pm10": 8.4,
      "pm2_5": 6.1,
      "so2": 5.2,
      "us_epa_index": 1
    },
    "cloud": 50,
    "condition": {
      "code": 1003,
      "icon_url": "https://cdn.weatherapi.com/weather/64x64/day/116.png",
      "text": "Partly cloudy"
    },
    "feelslike_c": 5.6,
    "feelslike_f": 42.1,
    "gust_kph": 28.0,
    "gust_mph": 17.4,
    "humidity": 71,
    "is_day": true,
    "last_updated": "2026-01-28 14:15",
    "last_updated_epoch": 1769609700,
    "precip_in": 0.0,
    "precip_mm": 0.0,
    "pressure_in": 29.88,
    "pressure_mb": 1012.0,
    "temp_c": 8.0,
    "temp_f": 46.4,
    "uv": 1.0,
    "vis_km": 10.0,
    "vis_miles": 6.0,
    "wind_degree": 250,
    "wind_dir": "WSW",
    "wind_kph": 19.1,
    "wind_mph": 11.9
  },
  "forecast_days": [
    {
      "astro": {
        "is_moon_up": true,
        "is_sun_up": true,
        "moon_illumination": 78,
        "moon_phase": "Waxing Gibbous",
        "moonrise": "11:02 AM",
        "moonset": "01:24 AM",
        "sunrise": "07:39 AM",
        "sunset": "04:47 PM"
      },
      "date": "2026-01-28",
      "date_epoch": 1769558400,
      "day": {
        "air_quality": {
          "co": 230.3,
          "gb_defra_index": 2,
          "no2": 14.8,
          "o3": 58.6,
          "pm10": 8.4,
          "pm2_5": 6.1,
          "so2": 5.2,
          "us_epa_index": 1
        },
        "avghumidity": 74,
        "avgtemp_c": 6.2,
        "avgtemp_f": 43.2,
        "avgvis_km": 9.8,
        "avgvis_miles": 6.0,
        "chance_of_rain": 62,
        "chance_of_snow": 0,
        "condition": {
          "code": 1003,
          "icon_url": "https://cdn.weatherapi.com/weather/64x64/day/116.png",
          "text": "Partly cloudy"
        },
        "maxtemp_c": 9.4,
        "maxtemp_f": 48.9,
        "maxwind_kph": 24.8,
        "maxwind_mph": 15.4,
        "mintemp_c": 3.1,
        "mintemp_f": 37.6,
        "totalprecip_in": 0.05,
        "totalprecip_mm": 1.2,
        "uv": 1.0,
        "will_it_rain": true,
        "will_it_snow": false
      },
      "hours": [
        {
          "chance_of_rain": 0,
          "chance_of_snow": 0,
          "cloud": 48,
          "condition": {
            "code": 1003,
            "icon_url": "https://cdn.weatherapi.com/weather/64x64/day/116.png",
            "text": "Partly cloudy"
          },
          "dewpoint_c": 3.1,
          "dewpoint_f": 37.6,
          "feelslike_c": 5.9,
          "feelslike_f": 42.6,
          "gust_kph": 29.2,
          "gust_mph": 18.1,
          "humidity": 70,
          "is_day": true,
          "precip_in": 0.0,
          "precip_mm": 0.0,
          "temp_c": 8.2,
          "temp_f": 46.8,
          "time": "2026-01-28 15:00",
          "time_epoch": 1769612400,
          "uv": 1.0,
          "vis_km": 10.0,
          "will_it_rain": false,
          "will_it_snow": false,
          "wind_dir": "WSW",
          "wind_kph": 19.8,
          "wind_mph": 12.3
        }
      ]
    }
  ],
  "location": {
    "country": "United Kingdom",
    "lat": 51.52,
    "localtime": "2026-01-28 14:30",
    "localtime_epoch": 1769610600,
    "lon": -0.11,
    "name": "London",
    "region": "City of London, Greater London",
    "tz_id": "Europe/London"
  }
}

Search weather locations

Find locations matching a partial name. Use this to turn a vague place name into an exact one before asking for weather, or to disambiguate between places that share a name.

Inputs

QueryquerytextRequired
Partial place name, postcode, or 'latitude,longitude'.

Outputs

countnumber
Number of locations returned.
locationslist
Matching locations, best match first.
Example output
{
  "count": 1,
  "locations": [
    {
      "country": "United Kingdom",
      "id": 2801268,
      "lat": 51.52,
      "lon": -0.11,
      "name": "London",
      "region": "City of London, Greater London",
      "url": "london-city-of-london-greater-london-united-kingdom"
    }
  ]
}

On this page