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 CI Java CI .NET CI License: MIT Languages

📖 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

Language Folder Install Runtime Docs
🟦 TypeScript / Node typescript/ npm install ipma-api Node ≥ 18, zero deps README
Java java/ io.github.marcelogdomingues:ipma-api Java 17+ README
🟣 .NET / C# dotnet/ dotnet add package Ipma.Api net8.0 README

All three expose the same API surface.


Quick start

TypeScriptJavaC#
import { IpmaClient } from "ipma-api";

const ipma = new IpmaClient();
const lisboa = 1110600;
const f = await ipma.cityForecast(lisboa);
console.log(f.data[0]?.tMin, f.data[0]?.tMax);
IpmaClient ipma =
  IpmaClient.builder().build();
var f = ipma.cityForecast(1110600);
System.out.println(f.data.get(0).tMax);
var ipma = new IpmaClient();
var f = await ipma
  .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):

Area Methods Endpoint
Locations locations() distrits-islands.json
Forecasts cityForecast(id), dailyForecast(idDay) forecast/meteorology/cities/daily/…
Warnings warnings() forecast/warnings/warnings_www.json
UV index uvIndex() forecast/meteorology/uv/uv.json
Fire risk fireRisk(idDay) forecast/meteorology/rcm/rcm-d{idDay}.json
Seismic seismic(idArea) observation/seismic/{idArea}.json
Reference tables weatherTypes(), 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