Authentication
The API provides different methods of authorization. Each request made against the API must be supplied with authentication credentials. Consider that without an API key, most requests will return default sample data.
Authorization parameters can be provided in the URL query.
curl -i "https://api.tradingeconomics.com/country/mexico/?client=your_api_key"
You can also use request Headers
curl -i "https://api.tradingeconomics.com/country/mexico/" -H "Authorization: Client your_api_key"
If you don’t have an API key and just want to try a demo of our API:
```curl -i "https://api.tradingeconomics.com/country/mexico/?client=guest:guest"
Install the tradingeconomics package using pip, a package management system used to install and manage software packages written in Python. In Windows Command Prompt or Linux bash type:
pip install tradingeconomics
To start using the Trading Economics Python package, open the python command line, and type:
import tradingeconomics as te
te.login('your_api_key')
If you don’t have an API key and just want to try a demo of our API:
te.login()
You can get Node.js from our NodeJs repository.
Then you need to install the tradingeconomics package.
In Windows Command Prompt or Linux bash type:
npm install tradingeconomics
To start using the Trading Economics Node package:
const te = require('tradingeconomics');
te.login('your_api_key');
If you don’t have an API key and just want to try a demo of our API:
te.login()
For server based language authentication, use your API key with the endpoint.
WebRequest request = WebRequest.Create("https://api.tradingeconomics.com/indicators?c=your_api_key");
If you don’t have an API key and just want to try a demo of our API, use guest:guest in the endpoints:
WebRequest request = WebRequest.Create("https://api.tradingeconomics.com/indicators?c=guest:guest");