Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/elenacarino-max/mas-climapp/llms.txt

Use this file to discover all available pages before exploring further.

The /consulta route displays the full archive of climate records that ClimApp has collected — both records entered manually via /api/registrar and readings fetched automatically from AEMET via /api/clima. A GET request returns every stored record. A POST request applies optional filters for municipality and date before rendering the same page with the narrowed result set. Submitting the form with both fields blank is equivalent to a plain GET and returns all records.

Request

GET — all records

GET /consulta
Returns all stored records without filtering.

POST — filtered records

POST /consulta
Content-Type: application/x-www-form-urlencoded
municipio
string
Filter by municipality name. The match is case-insensitive and supports partial strings — entering mad matches Madrid. Leave blank to skip this filter.
fecha
string
Filter by observation date. Submit the value in YYYY-MM-DD format (as produced by an HTML <input type="date">); the controller converts it internally to DD/MM/YYYY before querying the store. Leave blank to skip this filter.
Submitting the form with both municipio and fecha blank returns the complete record set, identical to a GET request.

Example — filtered request

curl -X POST "http://localhost:5000/consulta" \
  -d "municipio=Madrid&fecha=2026-05-07"

Response

The endpoint renders the consulta.html template and is not a JSON API. The registros variable passed to the template is a list of record objects. Each record has the following structure:
{
  "estacion_id": "EST-001",
  "fecha": "07/05/2026",
  "temperatura": 28.5,
  "humedad": 62.0,
  "viento": 15.0,
  "lluvia": 0.0,
  "municipio": "Madrid",
  "fuente": "manual"
}
Records originating from AEMET (fetched via /api/clima) carry "fuente": "aemet" and include additional fields such as ciudad, estacion, presion, and alertas.
Use the fuente field to distinguish manually entered observations ("manual") from AEMET live readings ("aemet") when processing the results programmatically.

Build docs developers (and LLMs) love