Skip to content

Latest commit

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

ipma-api — unofficial client SDKs for the IPMA weather API

Unofficial, multi-language client SDKs for the IPMA open-data weather API (Portugal).
Forecasts, warnings, UV index, fire risk and seismic data — free API, no key required.

TypeScript CIJava CI.NET CILicense: MITLanguages

📖 Documentation site

Important

This is an unofficial community project. It is not affiliated with, endorsed by, or supported by IPMA. Data is free to use with attribution ("source: IPMA") — please read IPMA's conditions of use.


Contents


Why this exists

The IPMA open-data API is a great free weather source, but its shapes are inconsistent: most endpoints wrap results as { owner, country, data: [...] }, but warnings and UV are bare arrays, fire-risk uses local[], numbers often arrive as strings, and -99 means "missing". These SDKs give you typed models across all those shapes, join keys documented, and the same clean API in three languages.

- const r = await fetch("https://api.ipma.pt/open-data/forecast/.../1110600.json"); // parse odd shapes…+ const f = await ipma.cityForecast(1110600); // f.data[0].tMax

Languages

LanguageFolderInstallRuntimeDocs
🟦 TypeScript / Nodetypescript/npm install ipma-apiNode ≥ 18, zero depsREADME
Javajava/io.github.marcelogdomingues:ipma-apiJava 17+README
🟣 .NET / C#dotnet/dotnet add package Ipma.Apinet8.0README

All three expose the same API surface.


Quick start

TypeScriptJavaC#
import{IpmaClient}from"ipma-api";constipma=newIpmaClient();constlisboa=1110600;constf=awaitipma.cityForecast(lisboa);console.log(f.data[0]?.tMin,f.data[0]?.tMax);
IpmaClientipma =
IpmaClient.builder().build();
varf = ipma.cityForecast(1110600);
System.out.println(f.data.get(0).tMax);
varipma=newIpmaClient();varf=awaitipma.CityForecastAsync(1110600);Console.WriteLine(f.Data[0].TMax);

Find a location's globalIdLocal via locations().


What it covers

Wraps the IPMA open-data API (https://api.ipma.pt/open-data):

AreaMethodsEndpoint
Locationslocations()distrits-islands.json
ForecastscityForecast(id), dailyForecast(idDay)forecast/meteorology/cities/daily/…
Warningswarnings()forecast/warnings/warnings_www.json
UV indexuvIndex()forecast/meteorology/uv/uv.json
Fire riskfireRisk(idDay)forecast/meteorology/rcm/rcm-d{idDay}.json
Seismicseismic(idArea)observation/seismic/{idArea}.json
Reference tablesweatherTypes(), windSpeedClasses(), precipitationClasses()classification tables

All clients retry automatically on 5xx with exponential backoff.


Data model notes

  • Envelopes vary: most are { owner, country, data[] }; warnings and UV are bare arrays; fire-risk uses local[].
  • Numbers are often strings (tMin, latitude, iUv). The SDKs keep them faithful; .NET also accepts numeric tMin/tMax transparently.
  • Sentinels:-99 / -99.0 / null mean "missing".
  • Join keys:globalIdLocal (locations ↔ forecast ↔ UV), idAreaAviso (locations ↔ warnings), dico (fire-risk municipality), idWeatherType / classWindSpeed / classPrecInt (→ reference tables).

FAQ

Do I need an API key?

No — the IPMA open-data API is free and keyless. Please attribute "source: IPMA" and read the conditions of use.

How do I turn a weather-type id into text?

Fetch weatherTypes() once and map idWeatherTypedescWeatherTypePT/EN. Same pattern for wind-speed and precipitation classes.

Is this affiliated with IPMA?

No — it's an independent community client.


Roadmap

  • TypeScript, Java and .NET clients with parity
  • Forecasts · warnings · UV · fire risk · seismic · reference tables
  • Auto-retry on 5xx
  • Publish to npm / Maven Central / NuGet
  • Station observations & sea-state forecast helpers
  • Weather-type description resolver helper

License

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

About

Unofficial multi-language client SDKs (TypeScript, Java, .NET) for the IPMA open-data weather API (Portugal) — forecasts, warnings, UV index, fire risk, seismic. Free, no API key.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages