Usage:
Use https://weather-proxy.freecodecamp.rocks/
to get weather
information for a location in JSON format. This server only accepts
GET
requests, and only serves the routes
/api/city/:city
and
/api/current?lon=:longitude&lat=:latitude
.
Example Requests:
https://weather-proxy.freecodecamp.rocks/api/city/new york
This endpoint does not return the current weather and the only available
cities for this endpoint are New York
, Chicago
,
Los Angeles
, Tokyo
, and
London
.
To get the current weather for any location use:
https://weather-proxy.freecodecamp.rocks/api/current?lat=35&lon=139
Example Response:
{ "coord": { "lon": 139, "lat": 35 }, "weather": [ { "id": 801, "main":
"Clouds", "description": "few clouds", "icon":
"https://cdn.freecodecamp.org/weather-icons/02n.png" } ], "base":
"stations", "main": { "temp": 25, "feels_like": 28.82, "temp_min": 25,
"temp_max": 25, "pressure": 1010, "humidity": 84 }, "visibility": 10000,
"wind": { "speed": 1.34, "deg": 177, "gust": 2.68 }, "clouds": { "all":
16 }, "dt": 1597922946, "sys": { "type": 3, "id": 2019346, "country":
"JP", "sunrise": 1597867673, "sunset": 1597915636 }, "timezone": 32400,
"id": 1851632, "name": "Shuzenji", "cod": 200 }
Images links are included in the JSON under weather[0].icon
.
This is enough to complete the challenge.