tradingeconomics
Trading Economics API
What it is and what it does
tradingeconomics is a Python client library for the Trading Economics API, a financial data service offering access to a large catalog of economic indicators, market data, and commodity prices. It wraps HTTP requests to Trading Economics' backend, handling authentication and response parsing so you can query indicators by country, fetch market data by symbol, retrieve calendar events, and pull financial statements—all with optional output formatting to pandas DataFrames, CSV, or JSON.
The package is designed for developers building financial dashboards, research tools, or data pipelines that need reliable access to macroeconomic and market data. It depends on pandas for data manipulation and websocket-client for underlying connectivity, and runs on modern Python versions from 3.8 onward. Authentication is required upfront via an API key, and the library provides convenience methods for common queries rather than a raw HTTP interface.
Use it for:
- Build a financial dashboard that displays live economic indicators and commodity prices for multiple countries.
- Backtest trading strategies using historical exchange rates and stock index data exported to pandas DataFrames.
- Feed economic calendar events into a custom alerting system to trigger notifications on key releases.
- Export bond yields and interest rates to CSV for econometric modeling or spreadsheet analysis.
- Populate a research database with historical commodity prices and market indexes for quantitative analysis.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Python access to over 300,000 economic indicators, exchange rates, stock indexes, bond yields, and commodity prices from Trading Economics' databases, with support for XML, CSV, and JSON export.
Yes. The package is actively maintained, has low install friction, carries no known vulnerabilities, and offers permissive MIT licensing. Install it if you need programmatic access to Trading Economics' economic and market data; the main prerequisite is obtaining an API key from Trading Economics.
Install
tradingeconomics on PyPI
pip
pip install tradingeconomicsuv
uv add tradingeconomicspoetry
poetry add tradingeconomicsInstalling tradingeconomics
Before you install
Low install friction with just two runtime dependencies (pandas and websocket-client). Package is actively maintained with a recent release 37 days ago and steady commit activity; supports Python 3.8 through 3.14.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions—you may use, modify, and distribute the package freely provided you include the license notice.
Quickstart
pip install tradingeconomics
import tradingeconomics as te
te.login('key:secret')
te.getIndicatorData(country=['mexico', 'sweden'], output_type='df')
You must obtain an API key and secret from Trading Economics to authenticate and access the data.
Verify before relying
- Whether the websocket-client dependency is used for real-time streaming or only as a fallback.
- Rate limits or throttling policies for API requests.
- Whether all 300,000+ indicators are accessible with a standard API key or require premium tier.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — pandas, websocket-client |
| Maintenance | actively maintained — 37 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 129,755/month — #11,659 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: tradingeconomics-4.5.11-py3-none-any.whl
Keywords: tradingeconomics, data
Tags
More Point-Of-Sale packages
Python library to send text, images, barcodes,…
permissive · top 15,000 on PyPI
pycdcSearches the web for gift ideas and client…
permissive · top 15,000 on PyPI
openbb-tradingeconomicsIntegrates Trading Economics data into the…
agpl · top 15,000 on PyPI
python-bcbStructured Python interface to fetch Brazilian…
unclear · top 15,000 on PyPI
metatrader5Connects Python to MetaTrader 5 Terminal to…
permissive · top 15,000 on PyPI
tradingview-screenerQuery TradingView's screener API to retrieve…
permissive · top 15,000 on PyPI
tradingview-taRetrieves technical analysis indicators and…
permissive · top 15,000 on PyPI
alpha-vantageFetches real-time and historical stock,…
permissive · top 15,000 on PyPI
spgciPython client library for the S&P Global…
permissive · top 15,000 on PyPI
openbbUnified interface to fetch financial market…
agpl · top 15,000 on PyPI
quanteconQuantEcon provides computational tools and…
unclear · top 15,000 on PyPI
Nasdaq-Data-LinkProvides Python access to Nasdaq Data Link's…
permissive · top 15,000 on PyPI