Weather API Examples

Sample WeatherAPI.com requests and responses to copy and adapt, from current weather to forecasts, in JSON and XML.

WeatherAPI.com API is so easy to implement. Look at following examples on how you can form a request to get data either through a web browser or in your application.


  1. So to get current weather for London: JSON: http://api.weatherapi.com/v1/current.json?key=<YOUR_API_KEY>&q=London

  2. XML: http://api.weatherapi.com/v1/current.xml?key=<YOUR_API_KEY>&q=London
  3. To get 7 day weather for US Zipcode 07112: JSON: http://api.weatherapi.com/v1/forecast.json?key=<YOUR_API_KEY>&q=07112&days=7

  4. XML: http://api.weatherapi.com/v1/forecast.xml?key=<YOUR_API_KEY>&q=07112&days=7
  5. Search for cities starting with Lond: JSON: http://api.weatherapi.com/v1/search.json?key=<YOUR_API_KEY>&q=lond
    XML: http://api.weatherapi.com/v1/search.xml?key=<YOUR_API_KEY>&q=lond

Quick and Easy Signup for Weather API

WeatherAPI.com makes it super easy to integrate our realtime, daily, hourly and 15 min interval weather forecast data, historical weather, marine weather, bulk request, air quality data, pollen, evapotranspiration, autocomplete, time zone, astronomy and sports data into your new or existing project.