Skip to content

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

Get your free weather API key in a minute

100,000 calls a month, free for commercial use. No credit card.