The Weather API provides the latest weather, forecast, and historical weather data for any city or geographic location in the world.
https://api.api-ninjas.com/v1/weather
Get current weather, wind speed and direction, humidity, and temperature data by city, ZIP code, or geolocation coordinates (latitude/longitude).
lat requiredLatitude of desired location.
lon requiredLongitude of desired location.
zip required premium5 digit Zip code (United States only)
city required premiumCity name.
state optional premiumUS state (for United States cities only).
country optional premiumCountry name.
X-Api-Key requiredAPI Key associated with your account.
tempCurrent temperature in Celsius.
feels_likeWhat the temperature feels like in Celsius.
humidityCurrent humidity percentage.
min_tempMinimum temperature in Celsius.
max_tempMaximum temperature in Celsius.
wind_speedWind speed in meters per second.
wind_degreesWind direction in degrees.
sunriseSunrise time in Unix timestamp.
sunsetSunset time in Unix timestamp.
https://api.api-ninjas.com/v1/weather?city=London1
2
3
4
5
6
7
8
9
10
11
12
{
"wind_speed": 5.66,
"wind_degrees": 210,
"temp": 7,
"humidity": 87,
"sunset": 1615658463,
"min_temp": 7,
"cloud_pct": 75,
"feels_like": 2,
"sunrise": 1615616341,
"max_temp": 8
}1
2
curl -X GET "https://api.api-ninjas.com/v1/weather?city=london" \
-H "X-Api-Key: YOUR_API_KEY"If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.
https://api.api-ninjas.com/v1/weather
Returns a 5-day weather forecast in 3-hour intervals for a given city.
lat requiredLatitude of desired location.
lon requiredLongitude of desired location.
zip required premium5 digit Zip code (United States only)
city required premiumCity name.
state optional premiumUS state (for United States cities only).
country optional premiumCountry name.
X-Api-Key requiredAPI Key associated with your account.
Returns a list of weather forecasts with the same fields as Weather Response.
https://api.api-ninjas.com/v1/weatherforecast?city=London1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[
{
"timestamp": 1740247200,
"temp": 13,
"feels_like": 12,
"humidity": 70,
"min_temp": 10,
"max_temp": 13,
"weather": "Clouds",
"cloud_pct": 40,
"wind_speed": 2.36,
"wind_degrees": 231
},
{
"timestamp": 1740258000,
"temp": 11,
"feels_like": 11,
"humidity": 76,
"min_temp": 9,
"max_temp": 11,
"weather": "Clouds",
"cloud_pct": 27,
"wind_speed": 2.3,
"wind_degrees": 231
},
"..."
]