Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

ipma-api · Java

Unofficial Java client for the IPMA open-data weather API (Portugal) — forecasts, warnings, UV index, fire risk and seismic data.

The Java module of the multi-language ipma-api project. See also typescript/ and dotnet/.

Java CI License: MIT Java 17+

Important

Unofficial — not affiliated with IPMA. Data is free with attribution ("source: IPMA").

Install

<dependency>
  <groupId>io.github.marcelogdomingues</groupId>
  <artifactId>ipma-api</artifactId>
  <version>0.1.0</version>
</dependency>

Usage

import io.github.marcelogdomingues.ipma.*;
import io.github.marcelogdomingues.ipma.model.*;

IpmaClient ipma = IpmaClient.builder().build();

Envelope<DailyForecast> forecast = ipma.cityForecast(1110600); // Lisboa
System.out.println(forecast.data.get(0).tMin + " / " + forecast.data.get(0).tMax);

List<Warning> warnings = ipma.warnings();
FireRiskResponse risk = ipma.fireRisk(0);
Envelope<WeatherType> types = ipma.weatherTypes();
  • One dependency — Jackson; HTTP via the built-in java.net.http.HttpClient. Java 17+.
  • Auto-retries on 5xx with exponential backoff.
  • Errors throw IpmaException (getStatus()).

License

MIT © Marcelo Domingues · Data © IPMA (attribution required)