Data API
PolenMadrid provides a REST API to query pollen levels, historical data, stations and pollen types in JSON format.
Authentication
All requests require an access token. Send the token in the Authorization: Bearer <token> header or as a ?token=<token> query parameter.
To request API access, contact [email protected].
Available endpoints
| Endpoint | Parameters | Description |
|---|---|---|
GET /api/niveles | fecha, estacion, tipo | Current pollen levels by station and type. |
GET /api/historico | estacion, tipo, desde, hasta, page, per_page | Historical data with pagination. |
GET /api/estaciones | — | List of stations with current level. |
GET /api/estaciones/{code} | — | Station detail. |
GET /api/tipos | — | List of pollen types with current level. |
GET /api/tipos/{code} | — | Pollen type detail. |
GET /api/estadisticas | estacion, tipo, agrupacion, desde, hasta | Aggregated statistics (daily, weekly, monthly, yearly). |
Usage example
curl -H "Authorization: Bearer YOUR_TOKEN" https://polenmadrid.com/api/niveles curl "https://polenmadrid.com/api/niveles?token=YOUR_TOKEN" Rate limit
Maximum 60 requests per minute per IP. The X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers indicate the limit status.
Response format
{
"ok": true,
"data": [...],
"meta": {
"total": 150,
"last_updated": "2026-02-18"
}
}