You can easily integrate weather forecast into your personal and commercial website and application by using our free weather API.
Our weather API provides you with 5 day weather forecast. It is available in JSON format and easily accessible through a simple API request over a secure HTTPS connection.
The base URL for our weather API is
https://www.amdoren.com/api/weather.php
Request Parameters
All the API request parameters are required.
Parameter | Description |
---|---|
api_key | Your assigned API key. |
lat | Latitude of the location for which you would like to retrieve the weather forecast. |
lon | Longitude of the location for which you would like to retrieve the weather forecast. |
You can find the latitude and longitude of any location here.
Example:
To retrieve the weather forecast for New York:
https://www.amdoren.com/api/weather.php?api_key=IBZzdLmM2yCYaXjgTZ6x&lat=40.7127837&lon=-74.0059413
Element | Description |
---|---|
error | Error code. Value greater than zero indicates an error. See list below. |
error_message | Short decription of the error. See list below. |
forecast | Array of weather forecast data. |
- date | Date of forecast. |
- avg_c | Average temperature in Celsius. |
- min_c | Minimum temperature in Celsius. |
- max_c | Maximum temperature in Celsius. |
- avg_f | Average temperature in Fahrenheit. |
- min_f | Minimum temperature in Fahrenheit. |
- max_f | Maximum temperature in Fahrenheit. |
- summary | Brief summay of weather. |
- icon | Icon for weather. |
Example:
JSON data returned from our weather API request:
{ "error" : 0, "error_message" : "-", "forecast":[
{"date":"2016-11-04", "avg_c":17, "min_c":12, "max_c":22, "avg_f":63, "min_f":54, "max_f":72, "summary":"Light rain", "icon":"wi_color_drizzle.png"},
{"date":"2016-11-05", "avg_c":17, "min_c":15, "max_c":22, "avg_f":63, "min_f":59, "max_f":72, "summary":"Sunny", "icon":"wi_color_sunny.png"},
{"date":"2016-11-06", "avg_c":19, "min_c":13, "max_c":23, "avg_f":66, "min_f":55, "max_f":73, "summary":"Partly cloudy", "icon":"wi_color_partly_cloudy_day.png"},
{"date":"2016-11-07", "avg_c":19, "min_c":14, "max_c":21, "avg_f":66, "min_f":57, "max_f":70, "summary":"Moderate or heavy rain", "icon":"wi_color_rain.png"},
{"date":"2016-11-08", "avg_c":14, "min_c":8, "max_c":17, "avg_f":57, "min_f":46, "max_f":63, "summary":"Light rain", "icon":"wi_color_drizzle.png"} ]}
Error Code | Description |
---|---|
0 | No error. |
100 | API key not provided. |
110 | Invalid API key. |
200 | Latitude not provided. |
210 | Latitude must be numeric. |
220 | Invalid latitude. Latitude must be between -85 to 85. |
300 | Longitude not provided. |
310 | Longitude must be numeric. |
320 | Invalid longitude. Longitude must be between -180 to 180. |
400 | API limit reached for the month. |
500 | Location not found. |
600 | Weather not available. |
Our free weather API is highly stable & reliable. See our uptime