{"id":22473,"library":"tradingeconomics","title":"Trading Economics API","description":"Python wrapper for the Trading Economics API, providing access to economic indicators, calendar events, commodities, currencies, bonds, and forecasts. Current version 4.5.9. Active development with irregular releases.","status":"active","version":"4.5.9","language":"python","source_language":"en","source_url":"https://github.com/tradingeconomics/tradingeconomics-python","tags":["economics","api","data","financial","indicators"],"install":[{"cmd":"pip install tradingeconomics","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"","wrong":null,"symbol":"tradingeconomics","correct":"import tradingeconomics as te"},{"note":"Case-sensitive parameter name","wrong":"te.login('key')","symbol":"te.login()","correct":"te.login('YOUR_KEY')"}],"quickstart":{"code":"import tradingeconomics as te\nte.login(os.environ.get('TE_API_KEY', ''))\ndata = te.getIndicatorData(country='United States', indicator='GDP')\nprint(data)","lang":"python","description":"Logs in with API key from env var and fetches GDP data for United States."},"warnings":[{"fix":"Use module-level functions: import tradingeconomics as te then te.login() and te.getIndicatorData()","message":"Version 4.x removed direct function access; all endpoints are now methods under the tradingeconomics module (e.g., te.getIndicatorData instead of standalone getIndicatorData). Rewrite imports and calls.","severity":"breaking","affected_versions":"4.0+"},{"fix":"Always call te.login('YOUR_API_KEY') first.","message":"The login() function must be called before any data fetch. Missing leads to AuthenticationError.","severity":"gotcha","affected_versions":"all"},{"fix":"Use getCalendarData() instead of getCalendar() for filtered results.","message":"getCalendar() returns raw JSON; consider using getCalendarData() with filters for structured responses.","severity":"deprecated","affected_versions":"4.0 - 4.5.*"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Ensure te.login('YOUR_API_KEY') is called and key is correct.","cause":"Invalid API key or missing login call before data request.","error":"tradingeconomics.exceptions.AuthenticationError: Authentication failed"},{"fix":"Update imports: use import tradingeconomics as te, then te.getIndicatorData().","cause":"Using version 3.x style direct function calls; version 4.x uses module-level functions.","error":"AttributeError: module 'tradingeconomics' has no attribute 'getIndicatorData'"},{"fix":"Use te.login('YOUR_API_KEY') or te.login(api_key='YOUR_API_KEY') depending on version. Check docs.","cause":"Version 4.5.9 requires keyword argument: te.login(api_key='YOUR_KEY') or positional in older versions.","error":"TypeError: login() takes 0 positional arguments but 1 was given"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}