A simple Java console application that fetches real-time weather data using an external REST API.
- Fetches coordinates of a city using Geocoding API
- Retrieves current temperature and wind speed
- Handles HTTP status codes properly
- Uses custom exception handling
- Clean service-based architecture
- Java 17+
- java.net.http.HttpClient
- Gson (JSON parsing)
- REST APIs (Open-Meteo)
- User enters a city name
- Application fetches latitude and longitude
- Weather data is retrieved using coordinates
- Current temperature and wind speed are displayed
---- NOW ---- Temperature: 12.7 °C Wind speed: 22.5 km/h Time: 2026-01-27T12:45
WeatherApp→ Application entry pointGeoService→ City to coordinatesWeatherService→ Weather data fetching- Model classes → JSON mapping
ApiException→ Custom error handling
This project was built to practice:
- REST API consumption in Java
- JSON parsing with Gson
- Exception handling
- Clean code principles