Java code for Weather REST API ExampleThis Java code snippet was generated automatically for the Weather REST API example.
<< Back to the Weather REST API example
How to request the Weather REST API service?To get weather data via the REST API service, you need to make an HTTP GET request to the weather REST API endpoint and provide your free weather REST API key and city name as URL parameters.
You can also get current weather data by geographic coordinates by postcode by specifying latitude and longitude or postal code in the URL. Check the example below.
Types of weather data that can be retrieved by the Weather REST APIThe Weather REST API service provides the following types of weather data:
- Current Weather Data - current weather data for over 200,000 cities in JSON, XML and HTML formats.
- Hourly Forecast 4 days - 4-day hourly weather forecast with higher geographical accuracy in JSON and XML formats.
- Daily Forecast for 16 days - weather forecast for 16 days for any place and city in JSON and XML formats.
- Climatic Forecast 30 days - weather forecast for 30 days in JSON format
- 5 Day / 3 Hour Forecast - 5-day weather forecast for any location or city in JSON and XML formats