Indicator API

Getting a specific indicator filtering values by a date range grouped by hour using avg aggregation

Parameters

Name Description
locale Get translations for sources (es, en). Default language: es
datetime A certain date to filter values by (iso8601 format)
start_date Beginning of the date range to filter indicator values (iso8601 format)
end_date End of the date range to filter indicator values (iso8601 format)
time_agg How to aggregate indicator values when grouping them by time. Accepted values: `sum`, `average`. Default value: `sum`.
time_trunc Tells the API how to trunc data time series. Accepted values: `five_minutes`, `ten_minutes`, `fifteen_minutes`, `hour`, `day`, `month`, `year`.
geo_agg How to aggregate indicator values when grouping them by geo_id. Accepted values: `sum`, `average`. Default value: `sum`.
geo_ids Tells the API the geo ids to filter the dataear && ./bin/rspec by.
geo_trunc Tells the API how to group data at geolocalization level when the geo_agg is informed. Accepted values: 'country', 'electric_system', 'autonomous_community', 'province', 'electric_subsystem', 'town' and 'drainage_basin'

Request

Headers

Accept: application/json; application/vnd.esios-api-v1+json
Content-Type: application/json
x-api-key: "babc793329379da853dede6368ac10bd03b188a1eb2631269c76ddbe6e22f92a"

Route

GET /indicators/59500?start_date=2015-08-16T00%3A00%3A00Z&end_date=2015-09-15T07%3A34%3A17Z&time_agg=avg&time_trunc=hour

Query Parameters

start_date=2015-08-16T00:00:00Z
                end_date=2015-09-15T07:34:17Z
                time_agg=avg
                time_trunc=hour

cURL

curl "https://api.esios.ree.es/indicators/59500?start_date=2015-08-16T00%3A00%3A00Z&end_date=2015-09-15T07%3A34%3A17Z&time_agg=avg&time_trunc=hour" -X GET \
	-H "Accept: application/json; application/vnd.esios-api-v1+json" \
	-H "Content-Type: application/json" \
	-H "x-api-key:\"babc793329379da853dede6368ac10bd03b188a1eb2631269c76ddbe6e22f92a\"" \

Response

Headers

Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
x-amzn-RequestId: f6a28abc-ce94-4093-978f-b063deed7f00
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type,X-Amz-Date,Authorization,x-api-key
x-amz-apigw-id: eq_3DHNVDoEF89g=
Access-Control-Allow-Methods: GET,POST,PUT,DELETE,HEAD
X-Amzn-Trace-Id: Root=1-63c11360-73cdfa571c316f1a381cd368;Sampled=0
Content-Encoding: br
Vary: Accept-Encoding
X-Cache: Miss from cloudfront
Via: 1.1 d7ce10131df3183f928b50a7e6c2d1c0.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: MAD53-P1
X-Amz-Cf-Id: 9mgkaMY5sQ_iJ7A5YEnTBV2E-gmn0R84tq3ArNs0N0iFznzWuRIWzw==

Status

200

Body