A Spring Boot project for Open Weather Map API to find weather of a location based on location name or pin code or geographic co-ordinates.
Made with ♥ in Java
- Execute the DemoApplication.java file
- An Tomcat server instance will be started at port: 8080.
- Access this server through your browser using localhost:8080.
- To use the API enter the following in the url:
- Location Name based(Plain String Output): http://localhost:8080/weather/name/{place}
Replace {place} with the location name you want the weather of - Location Name based(JSON Output): http://localhost:8080/weather/name/json/{place}
Replace {place} with the location name you want the weather of - Pin-code based(Plain String Output): http://localhost:8080/weather/pin/{pincode}
Replace {pincode} with the Pin-code you want the weather of(Only Indian Pin-codes) - Pin-code based(JSON Output): http://localhost:8080/weather/pin/json/{pincode}
Replace {pincode} with the Pin-code you want the weather of(Only Indian Pin-codes) - Geographic Co-ordinates based(Plain String Output): http://localhost:8080/weather/coord/lon={lon}&lat={lat}
Replace {lon} and {lat} with the respective longitude and latitude co-ordinates of the location you want to find the weather of - Geographic Co-ordinates based(JSON Output): http://localhost:8080/weather/coord/json/lon={lon}&lat={lat}
Replace {lon} and {lat} with the respective longitude and latitude co-ordinates of the location you want to find the weather of
- Location Name based(Plain String Output): http://localhost:8080/weather/name/{place}
- Get output.
- JSON String
Sample input: http://localhost:8080/weather/name/json/thane
{ "Status": "OK", "temp": 31.0, "temp_min": 31.0, "weather": "Haze", "humidity": 79.0, "location": "Thāne", "lon": 72.97, "pressure": 1005.0, "feels_like": 35.45, "temp_max": 31.0, "lat": 19.2 }
- Plain String
Sample input: http://localhost:8080/weather/name/thane
Weather at: Thāne Coordinates are Longitude: 72.97 Latitude: 19.2 Weather: Haze Temperature: 31.0 Feels like: 35.45 Maximum Temperature: 31.0 Minimum Temperature: 31.0 Pressure: 1005.0 Humidity: 79.0
A Spring Boot project for Google Distance Matrix API to find road distance between two points based on location name or pin code.
Made with ♥ in Java
- Execute the DemoApplication.java file
- An Tomcat server instance will be started at port: 8080.
- Access this server through your browser using localhost:8080.
- To use the API enter the following in the url:
- JSON String: http://localhost:8080/distance/json/{start}to{end}
Replace {start} and {end} with respective places/pin-codes. - Plain String: http://localhost:8080/distance/{start}to{end}
Replace {start} and {end} with respective places/pin-codes.
- JSON String: http://localhost:8080/distance/json/{start}to{end}
- Get output.
- JSON String
Sample input: http://localhost:8080/distance/json/MumbaitoThane
{ "Starting Location":"Mumbai, Maharashtra, India", "Duration":"32 mins", "Ending Location":"Thane, Maharashtra, India", "Distance":"22.7 km" }
- Plain String
Sample input: http://localhost:8080/distance/MumbaitoThane
Distance is: 22.7 km Duration is: 32 mins Starting Location: Mumbai, Maharashtra, India Ending Location: Thane, Maharashtra, India