Endpoint: /series
The /series
endpoint allows obtaining data and metadata of one or more series, filtering by the time index, changing temporal aggregation and changing units, between other operations.
Name | Required | Type | Default | Examples |
---|---|---|---|---|
ids | Yes | List of alphanumeric characters separated by commas. Contains series specification to query, together with operations and transformations. |
N/A | ids=2.4_DGI_1993_T_19,134.2_B_0_0_6 |
representation_mode</a> | No | One of: value, change, percent_change, percent_change_a_year_ago | value | representation_mode=percent_change |
collapse</a> | No | One of: day, week, month, quarter, year | The original frequency of the series | collapse=year collapse=quarter |
collapse_aggregation</a> | No | One of: avg, sum, end_of_period, min, max | avg | collapse_aggregation=sum |
limit</a> | No | Positive integer, less than 1000. | 100 | limit=50 |
start</a> | No | Positive integer or 0. | 0 | start=100 |
start_date</a> | No | Date and time in ISO 8601 format. If this parameter is not specified, data starts from the oldest value. |
N/A | start_date=2016-11-30 start_date=2016-11 start_date=2016 |
end_date | No | Date and time in ISO 8601 format. If this parameter is not specified, data will end at the most recent value. |
N/A | end_date=2016-11-30 end_date=2016-11 end_date=2016 |
format</a> | No | One of: json, csv | json | format=csv |
header | No | One of: titles, ids, descriptions | titles | header=ids |
sort | No | One of: asc, desc | asc | sort=desc |
metadata | No | One of: none, simple, full, only | simple | metadata=none |
decimal | No | Decimal character to be used. One of: "," o "." |
. | decimal=, |
sep | No | CSV values separator character. Any UTF-8 character</em> |
. | sep=| |
flatten | No | Makes the answer flat in a single object with just one hierarchy level (no nested objects). No value should be specified. | flatten |
ids
Comma separated list of series ids. Data results will have a column for each series id, in the same order.
This parameter is mandatory for making a call. In case is omitted, result will be an error.
Each identifier of a series can have a suffix for:
representation_mode
).collapse_aggregation
).When these attributes are used inside ids
parameter, they must be separated using “:” character. The order of the components does not affect the order of the operation.
Examples:
ids=2.4_DGI_1993_T_19,134.2_B_0_0_6:change
ids=2.4_DGI_1993_T_19,134.2_B_0_0_6:sum:change
ids=2.4_DGI_1993_T_19,134.2_B_0_0_6:change:sum
ids=2.4_DGI_1993_T_19:percent_change,134.2_B_0_0_6:sum:change
ids=2.4_DGI_1993_T_19:end_of_period:percent_change,134.2_B_0_0_6:sum:change
representation_mode
Indicates the representation mode of the series. It is applied to all in the ids
parameter not having a different representation mode applied.
Representation mode by default is the original value of the series (value).
Available representation modes are:
Available transformation functions in representation_mode
can also be specified for individual series using :percent_change
notation, together with series id:
!!! note “Construction Economic Activity. Percentage variation of monthly values, period to period.”
https://apis.datos.gob.ar/series/api/series/?limit=1000&ids=11.3_VMATC_2004_M_12:percent_change
!!! note “Construction Economic Activity (percentage variation period to period), Construction Economic Activity (percentage variation year to year). Monthly values.”
https://apis.datos.gob.ar/series/api/series/?limit=1000&ids=11.3_VMATC_2004_M_12:percent_change,11.3_VMATC_2004_M_12:percent_change_a_year_ago
representation_mode
parameter will continue to affect all series where no individual representation mode has been specified.
collapse
collapse
parameter modifies sample frequency of series of the query. It must be used in combination with collapse_aggregation
to specify a temporal aggregation function, when necessary.
Available options are:
If not specified, data of a single series query is return using original frequency of the serie.
If multiples series of different frequencies are being called at the same time, the lowest frequency of all of them will be used (ie.: if you ask for daily, monthly and quarterly series in the same call, they will all be converted to quarterly frequency).
If you ask for a higher frequency level in collapse
than the lowest one available between asked series, the query will return an error.
collapse
parameter affects globally to all series selected from the ids
parameter in the API call.
collapse_aggregation
collapse_aggregation
parameter indicates the temporal aggregation function that must be used to make all the series in the call have the same frequency (ie.: what operation should be used to convert a monthly series in a yearly series).
This aggregation function will act over data of:
collapse
parameter.collapse
parameter is not specified, series of higher aggregation level than the one of the series with the lowest temporal aggregation level of all.Available options are:
collapse_aggregation
parameter is specified.Temporal aggregation functions available in collapse_aggregation
parameter can also be specified for individual series using :sum
notation together with series id:
!!! note “Payment of tourism services and trips. Monthly values averaged and sum by year.”
[`https://apis.datos.gob.ar/series/api/series/?ids=185.1_COBRO_SERVJES_0_M_30:avg,185.1_COBRO_SERVJES_0_M_30:sum&collapse=year`](https://apis.datos.gob.ar/series/api/series/?ids=185.1_COBRO_SERVJES_0_M_30:avg,185.1_COBRO_SERVJES_0_M_30:sum&collapse=year)
collapse_aggregation
parameter will continue to affect all series that have no temporal aggregation function individually specified.
!!! note “Payment of tourism services and trips. Monthly values averaged and sum by year.”
[`https://apis.datos.gob.ar/series/api/series/?ids=185.1_COBRO_SERVJES_0_M_30:avg,185.1_COBRO_SERVJES_0_M_30&collapse=year&collapse_aggregation=sum`](https://apis.datos.gob.ar/series/api/series/?ids=185.1_COBRO_SERVJES_0_M_30:avg,185.1_COBRO_SERVJES_0_M_30&collapse=year&collapse_aggregation=sum)
limit
Parameter used together with start
to control pagination of API call results. Must be a positive integer not greater than 1000. Default value is 100.
start
Parameter used together with limit
to control pagination of API call results. Must be a positive integer or 0. Default value is 0.
start
parameter indicates the “number of periods after start_date
” (or the “number of periods before end_date
”, depending on asc or desc sorting criteria specified on sort
parameter) that should be skipped from beginning or end of the series before staring to return values.
start_date
start_date
parameter indicates the less recent date where API results should start, when data is available. Values where time index is equal to start_date
value will be included. It is a temporal filter over time index of all series in the API call.
end_date
end_date
parameter indicates the most recent date where API results should end, when data is available. Values where time index is equal to end_date
will be included. It is a temporal filter over time index of all series in the API call.
format
Specifies the format of the results. JSON is the default.
Available options are:
header
Specifies attributes of series to be used as headers of the CSV file columns. Uses titles as default, being the shortest human readable titles of the series.
Available options are:
ids
parameter.sort
Specifies the sorting direction in which values are returned. asc is the default value.
Available options are:
metadata
Specifies the level of metadata detail required by the user, being simple the default. Only applies when format=json
.
Available options are:
decimal
Specifies character used for decimal numbers. . is the default. Only applies when format=csv
.
Available options are:
sep
Specifies the character that separates values in a CSV file. , is the default. Only applies when format=csv
.
Any UTF-8 character can be used, but it is highly recommended to keep the default (comma) in most cases.
flatten
Specifies if the metadata results should be returned with a flat hierarchy.
When parameter is not included, API call result has a nested structure:
{
"catalog": [<catalog_meta>],
"dataset": [<dataset_meta>],
"distribution": [<distribution_meta>],
"field": [<field_meta>],
}
When flatten
is included, API call metadata result has a flat structure:
{
catalog_meta1: ...,
catalog_meta2: ...,
dataset_meta1: ...,
<level>_<meta_key>: <meta_value>
...
}