Skip to content
Docs
Get API key
Get started

Trading Economics | Packages Installation

Details of API Installation

The Trading Economics Application Programming Interface (API) is available in different programming languages. Providing several request methods to query our databases, with samples available in different programming languages, it is the best way to access data in JSON or CSV formats. In addition, you can also use the Trading Economics packages listed below to have easy access to the API.

Install the tradingeconomics package using pip, a package management system used to install and manage software packages written in Python.

Python
pip install tradingeconomics

Using package

Python
import tradingeconomics as te                #1
te.login('your_api_key')                     #2
data = te.getIndicatorData(country='mexico') #3
  • #1 Imports Trading Economics Python package

  • #2 Calls the authentication method

  • #3 Makes a call to the API. You can change the parameters to what you like

By default, the response will be a list of dictionaries.

You can also change the output type to Pandas dataframe:

Python
data = te.getIndicatorData(country='mexico', output_type='df')