Api made to consume data from HG Weather (https://hgbrasil.com/status/weather) api, format and convert them.
-
URL
/weather -
Method:
GET
-
URL Params
Required:
city={String}
Optional:
temperatureType={String}
celsius
|fahrenheit
|kelvin
-
Success Response:
- Code: 200
Content:
{ "temperatureType":"CELSIUS", "currentTemperature":15, "description":"Tempo nublado", "weatherForecast":[ { "date":"2020-06-14", "max":18, "min":15, "description":"Tempo nublado" }, { "date":"2020-06-15", "max":20, "min":14, "description":"Tempo nublado" }, { "date":"2020-06-16", "max":22, "min":14, "description":"Parcialmente nublado" }, { "date":"2020-06-17", "max":23, "min":15, "description":"Parcialmente nublado" }, { "date":"2020-06-18", "max":24, "min":13, "description":"Parcialmente nublado" }, { "date":"2020-06-19", "max":25, "min":14, "description":"Parcialmente nublado" }, { "date":"2020-06-20", "max":25, "min":14, "description":"Ensolarado" }, { "date":"2020-06-21", "max":25, "min":14, "description":"Ensolarado" }, { "date":"2020-06-22", "max":26, "min":14, "description":"Ensolarado" }, { "date":"2020-06-23", "max":25, "min":15, "description":"Ensolarado com muitas nuvens" } ] }
- Code: 200
-
Error Response:
- Code: 404
Content:
{ "timestamp":"2020-06-14T20:31:20.6932821", "status":404, "message":"City name not found" }
- Code: 400
Content:
{ "timestamp":"2020-06-14T20:34:00.3158145", "status":400, "message":"Invalid temperature type" }
- Code: 404
-
Sample Call:
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET "https://weather-api1107.herokuapp.com/weather?city=orlando&temperatureType=celsius"
-
Architecture:
-
Swagger Api Documentation: