/api/registrar endpoint accepts a JSON body containing a manually entered climate observation and persists it to the local data/registros_climaticos.json file. This allows users to log their own measurements independently of the live AEMET feed. If the municipio field is omitted or sent as "null", ClimApp automatically resolves the municipality name from the internal station lookup table using the provided estacion_id. Every record saved through this endpoint is tagged with "fuente": "manual" so it can be distinguished from AEMET-sourced data when filtering.
Endpoint
Request body
string
required
AEMET station identifier for the measurement location (e.g.
"3195" for Madrid-Retiro).string
Municipality name associated with the station. If omitted or set to
"null", ClimApp resolves the name automatically from the station lookup table using estacion_id.string
required
Date of the observation in
DD/MM/YYYY format (e.g. "29/04/2026"). See the date format warning below.number
required
Air temperature in degrees Celsius (°C). Accepted range:
-50 to 60.number
required
Relative humidity as a percentage (%). Accepted range:
0 to 100.number
required
Wind speed in kilometres per hour (km/h). Must be
≥ 0.number
required
Accumulated rainfall in millimetres (mm). Must be
≥ 0.Example request
Success response
On success the endpoint returns HTTP201 with the saved record echoed back in the data field.
Error responses
Stored record fields
Each record written todata/registros_climaticos.json contains the following fields:
string
AEMET station identifier provided in the request.
string
Observation date in
DD/MM/YYYY format, exactly as supplied in the request.number
Temperature in °C, cast to
float.number
Relative humidity %, cast to
float.number
Wind speed in km/h, cast to
float.number
Rainfall in mm, cast to
float.string
Municipality name, either provided in the request or resolved automatically from the station lookup table.
string
Always
"manual" for records saved through this endpoint. Used by the filter and comparison features to distinguish manual entries from AEMET data.