This REST API replaces the functionality of the previous SOAP service "DgieWS" located at: http://www.banxico.org.mx/DgieWSWeb/DgieWS?WSDL Time series
1.5.1-rc1 (20250217.2055)
The API of the Economic Information System (SIE) allows to consult the time series of all indicators available in this archive. This tool aims at developers and analysts who seek to make automatic the retrieval of the economic information published by Banco de México.
Obtain query token |
API disclaimer |
All queries made through API require sending a query token. Therefore, the first step is to obtain the token to identify the submitted requests.
The generated token is a 64-character-string. It should be sent every time a query is made through API, either through an HTTP header or a parameter:
Bmx-Token: e3980208bf01ec653aba9aee3c2d6f70f6ae8b066d2545e379b9e0ef92e9de25
token=e3980208bf01ec653aba9aee3c2d6f70f6ae8b066d2545e379b9e0ef92e9de25
Using this identifier, time series can be queried now. Then, the series to be consulted must be identified. To this end, the Series catalogue should be consulted. There is an option to navigate information structures until the wanted series is found. The Series catalogue displays the catalogue of the sectors in its main view. If a certain sector is selected, it is possible to access some of the information structures that are grouped into time series. For example, if information on 28-day TIIE is required, one should proceed in the following manner:
Select the sector "Securities prices and interest rates".
After that, in the list of this sector's structures, the structure "Interest Rates of Banking Instruments and Average Costs of Bank Term Deposits > Daily information > Money Market Representative Interest Rates" is found.
In the information structure it is possible to identify the time series and to choose it to obtain its identifier and some of its metadata.
Using the series identifier, it is possible to consult its data, as follows:
For example, to obtain the most recent datum of the 28-day TIIE, the following query must be made:
GET /SieAPIRest/service/v1/series/SF43783/datos/oportuno HTTP/1.1
Accept: application/json
Bmx-Token: e3980208bf01ec653aba9aee3c2d6f70f6ae8b066d2545e379b9e0ef92e9de25
Accept-Encoding: gzip
The goal of this query is to get the timely data of the time series with the identifier SF43783 (28-day TIIE). Data are requested in the JSON format (it is also possible to obtain data in JSONP and XML). The token is also sent in the header Bmx-Token. Finally, it is specified that a compressed response are required to optimize data transfer time.
Based on this request, the following response is obtained:
HTTP/1.1 200 OK
Content-Encoding: gzip
Content-Type: application/json;charset=UTF-8
{
"bmx": {
"series": [
{
"idSerie": "SF43783",
"titulo": "TIIE a 28 días Tasa de interés en por ciento anual",
"datos": [
{
"fecha": "31/01/2023",
"dato": "10.8162"
}
]
}
]
}
}
When querying the API, it is important to consider that there are limits to the number of requests. For more details, see here.