Skip to main content

Economic Indicators

This page provides a tutorial for getting started using the obb.economy.indicators endpoint, with the openbb-econdb provider extension. The command provides access to over 100 standardized indicator symbols, covering countries around the world.

note

OpenBB is not affiliated with EconDB. All service is provided "AS IS" and without warranty.

Authorization

This command requires an API key. You can create an account here, and enter the key assigned.

Leaving the key as None will attempt to retrieve a temporary token that is assigned when downloading the data as a CSV file from a browser. This is a workaround and can be blocked by Cloudflare. In this instance, the temporary token can be viewed by opening any indicator in your browser, then selecting 'Python' from the 'Export' drop-down.

Temporary Token

The best method is to support the service by registering an account.

from openbb import obb
obb.user.credentials.econdb_api_key = REPLACE_WITH_KEY

See the API keys page for more information on credentials.

Important Considerations

Carefully inspect data before conducting analysis and arriving at conclusions.

EconDB sources data directly from national agencies, or other reputable sources such as the IMF, but the data itself may not be directly comparable between collections of countries. For example, some countries will have GDP data as 'annualized' (North America) while others report the values for the period.

These factors can be considered as "known-unknowns", the metadata will not contain this information.

important
  • This function will not attempt to normalize the values for cross-country comparison. Some values should be manually adjusted, post-request, to accommodate.

  • Transforming levels as USD, or % of GDP, may have unexpected results where values are not appropriate for this conversion. Do not attempt to apply these transformations universally.

  • Values that are scaled to, or transformed as, a percent are returned as a normalized value - i.e, 1% = 0.01. It will have a multiplier value of 1, which is not indicative of display values.

  • Contextual information is contained within metadata, returned under the "extra" attribute of the function response.

Available Indicators

EconDB has a list of "main" indicators, which are standardized base symbols across the available countries for each.

from openbb import obb

indicators = obb.economy.available_indicators(provider="econdb").to_df()

indicators.iloc[0]
symbol_rootPOLIR
symbolPOLIREA
countryEuro area
isoEA
descriptionPolicy rate - short term
frequencyD
currencyPERCENT
scaleUnits
multiplier1
transformationPeriod level
sourceEuropean Central Bank
first_date1999-01-01
last_date2024-04-08
last_insert_timestamp2024-04-08 12:27:05.089860
tip

Metadata is returned in the command response to the 'extra' attribute.

data = obb.economy.indicators("POLIR", country="EA")
data.extra["results_metadata"]
{'POLIREA': {'title': 'Euro area - Policy rate - short term',
'country': 'Euro area',
'frequency': 'D',
'dataset': 'ECBFM',
'transformation': None,
'units': 'PERCENT',
'scale': 'Units',
'multiplier': 1,
'additional_info': {'FREQ:Frequency': 'D:Daily',
'REF_AREA:Reference area': 'U2:Euro area (Member States and Institutions of the Euro Area) changing composition',
'CURRENCY:Currency': 'EUR:Euro',
'PROVIDER_FM:Financial market provider': '4F:ECB',
'INSTRUMENT_FM:Financial market instrument': 'KR:Key interest rate',
'PROVIDER_FM_ID:Financial market provider identifier': 'MRR_FR:ECB Main refinancing operations - fixed rate tenders (fixed rate) (date of changes)',
'DATA_TYPE_FM:Financial market data type': 'LEV:Level'}}}
Basic Descriptions

Basic descriptions of the base symbols can be imported from within the extension module helpers.

from openbb_econdb.utils.helpers import INDICATORS_DESCRIPTIONS
important

This list should not be considered as the absolute source of truth. The metadata for the indicator will be returned in the command response, under the extras attribute.

ACPOPActive population
CACurrent account balance
CARPassenger car sales
CBALCommercial balance (goods + services)
CIChange in inventories
CKANet foreign investment
CLAIMSWeekly unemployment insurance claims
CLIOECD CLI
CONTotal consumption
CONFConsumer confidence index
CORECore consumer price index
CPConstruction production
CPIConsumer price index
CREDDomestic credit
CREDEADomestic credit
DWPEDwelling permits
ELEProduction electricity
EMPTotal employment
EMRATIOEmployment to working age population
EQYCAPMarket capitalization
EXPExports of goods and services
EXPMONMonthly exports
GASDEMGas demand
GASODEMGasoline demand
GASOPRODGasoline production
GASPRODGas production
GBALGovernment balance
GCFGross capital formation
GDEBTGovernment debt
GDEBTNGovernment net debt
GDPGross domestic product
GDPDEFGDP deflator
GDPPCGDP per capita
GFCFGross fixed capital formation
GREVGeneral government total revenue
GSPEGeneral government total expenditure
HHDIRHousehold debt to income ratio
HHSHousehold saving
HOUHouse price
IBD1Interbank lending overnight rate
IIPAInternational investment position: Assets
IIPLInternational investment position: Liabilities
IMPImports of goods and services
IMPMONMonthly imports
INVERInvestment rate
IPIndustrial production
JHRJob hires rate
JLRJob layoffs rate
JQRJob quits rate
JVRJob vacancy rate
KACapital account
LE00Life expectancy at birth
LMICSLow and Middle Income Commodity Index (World Bank)
M3Money supply
M3YD3 month yield
MBMonetary base
NCTNet current transfers (Secondary Income)
NFCINon-financial corporations investment rate
NFCLOANLending to non-financial corporations
NIIPNet international investment position
NPLNon performing loans
NYNet income from abroad (Primary Income)
OILDEMOil demand
OILPRODOil production
PALUMAluminum
PAPPLENon-Citrus Fruit, Apple
PARTParticipation rate
PBANSOPBananas
PBARLBarley
PBEEFBeef
PCEPersonal consumption expenditure price index
PCHANALegumes, Chickpea
PCHROMChromium
PCOALAUCoal, Australia
PCOALSACoal, South Africa
PCOBACobalt
PCOCOCocoa
PCOFFOTMCoffee, Other Mild Arabica
PCOFFROBCoffee, Robustas
PCOILCoconut Oil
PCOPPCopper
PCOTTINDCotton
PDAPDiammonium phosphate
PFSHMEALFish Meal
PGASOGasoline
PGNUTSGroundnuts
PGOLDGold
PHEATOILHeating Oil
PHIDEHides
PIORECRIron
PLAMBLamb
PLEADLead
PLITHLithium
PLMMODYMolybdenum
PLOGORESoft Logs
PLOGSKHard Logs, Import Price Japan
PMAIZMTCorn
PMANGELEManganese
PMILKDairy Products, Milk
PNGASEUNatural gas, EU
PNGASJPLNG, Asia
PNGASUSNatural Gas, US Henry Hub Gas
PNICKNickel
POATSOats
POILAPSPAPSP crude oil($/bbl)
POILBREBrent Crude
POILDUBDubai Crude
POILWTIWTI Crude
POLIRPolicy rate - short term
POLVOILOlive Oil
POPPopulation
PORANGOrange
PPALLAPalladium
PPIProducer price index
PPLATPlatinum
PPOILPalm Oil
PPORKSwine
PPOTASHPotassium Fertilizer
PPOULTPoultry
PPROPANEPropane
PRCPrivate consumption
PREODOMRare Earth Elements
PRICENPQRice, Thailand
PRIDEBTPrivate debt
PROILRapeseed Oil
PRUBBRubber
PSALMFish
PSAWMALHard Sawnwood, Dark Red Meranti
PSAWORESoft Sawnwood, Average of Softwoods,
PSHRIShrimp
PSILLUMPSilicon
PSILVERSilver
PSMEASoybean Meal
PSOILSoybeans Oil
PSORGSorghum
PSOYBSoybeans
PSUGAISASugar, No. 11, World
PSUGAUSASugar, No. 16, US
PSUNOSunflower Oil
PTEATea, Kenyan
PTEAINDIATea, Kolkata
PTEAMOMTea, Mombasa
PTEASLTea, Colombo
PTINTin
PTOMATOVegetables, Tomato
PUCPublic consumption
PURANUranium
PUREAUrea
PVANPENTVanadium
PWHEAMTWheat
PWOOLCWool, Coarse
PWOOLFWool, Fine
PZINCZinc
RCIReal change in inventories
RCONReal total consumption
REERReal effective exchange rate
REEREAReal effective exchange rate
RETARetail trade
REXPReal exports of goods and services
RGCFReal gross capital formation
RGDPReal gross domestic product
RGDPPCReal GDP per capita
RGFCFReal gross fixed capital formation
RIMPReal imports of goods and services
RPRCReal private consumption
RPUCReal public consumption
SEIStock exchange index
SENTSentiment index
TBTrade balance
URATEUnemployment
UTILUtilization rate
WAGEWages/Earnings
WAGEMANHourly wage manufacturing
Y10YDLong term yield

Countries

Details

The country parameter will accept the ISO country code, or the country name. Regional groups listed below are also valid:

  • all
  • africa
  • central_asia
  • east_asia
  • europe
  • g7
  • g20
  • latin_america
  • middle_east
  • north_america
  • oceania
  • south_asia
  • southeast_asia
note

Some symbols do not have a country - e.g., commodity items - and they will ignore any supplied values to the parameter. Not every indicator has data for every country. Items with no results will be communicated via the warnings attribute of the response object.

obb.economy.indicators("POLIR", country="southeast_asia")
OBBject

id: 0661ac07-ab9c-7ebf-8000-849fef1202bc
results: [{'date': datetime.date(2013, 4, 29), 'symbol': 'POLIRSG', 'country': 'Sin...
provider: econdb
warnings: [{'category': 'UserWarning', 'message': "Invalid country code for...
chart: None
extra: {'results_metadata': {'POLIRID': {'title': 'Indonesia - Policy rate - short ...

Countries By Indicator

In addition to filtering the available_indicators data locally, countries by indicator can be imported as a utility function from the openbb_econdb.utils.helpers module.

from openbb_econdb.utils.helpers import get_indicator_countries

get_indicator_countries("GDPPC") # returns a list of two-letter ISO country codes

How To Enter Symbols

Details

The three parameters - symbol, country, transform - all work together.

  • Symbol (base symbol)
    • CPI, GDP, CORE, etc
    • Multiple items allowed
  • Country
    • ISO country code, or name
    • Multiple items allowed
  • Transform
    • tpop: Percent change from previous period
    • toya: Percent change from year ago
    • tusd: Values as US dollars
    • tpgp: Values as a percent of GDP

The transform will apply to all combinations of symbol and country.

warning

If you attempt to pass a base symbol (excluding commodity and world indicators) with no country, it will raise an error.

Example - One Indicator & Country

M3 Money Supply

data = obb.economy.indicators("M3", country="us")

data.to_df().tail(12)
datesymbol_rootsymbolcountryvalue
2023-03-01M3M3USUnited States21027
2023-04-01M3M3USUnited States20843
2023-05-01M3M3USUnited States20711
2023-06-01M3M3USUnited States20749
2023-07-01M3M3USUnited States20724
2023-08-01M3M3USUnited States20695
2023-09-01M3M3USUnited States20669
2023-10-01M3M3USUnited States20636
2023-11-01M3M3USUnited States20723
2023-12-01M3M3USUnited States20890
2024-01-01M3M3USUnited States20862
2024-02-01M3M3USUnited States20788
data.extra.get("results_metadata")
{'M3US': {'title': 'United States - Money supply',
'country': 'United States',
'frequency': 'M',
'dataset': 'FRB_H6_M2',
'transform': None,
'units': 'DOMESTIC',
'scale': 'Billions',
'multiplier': 1000000000,
'additional_info': {'ADJUSTED:Seasonal Adjustment': 'NSA:Not seasonally adjusted',
'CURRENCY:Currency': 'USD:United States / United States Dollar',
'FREQ:Frequency': '129:Monthly',
'SERIES_NAME:Series name (FRB)': 'M2_N.M:M2_N.M',
'UNIT:Units': 'CURRENCY:Currency'}}}
Example - One Indicator & Country With Transform

US PPI - Change from one year ago.

data = obb.economy.indicators("PPI", country="us", transform="toya")

data.to_df().tail(12)
datesymbol_rootsymbolcountryvalue
2023-04-01PPIPPIUS~TOYAUnited States0.022995
2023-05-01PPIPPIUS~TOYAUnited States0.011822
2023-06-01PPIPPIUS~TOYAUnited States0.001912
2023-07-01PPIPPIUS~TOYAUnited States0.008722
2023-08-01PPIPPIUS~TOYAUnited States0.016003
2023-09-01PPIPPIUS~TOYAUnited States0.021542
2023-10-01PPIPPIUS~TOYAUnited States0.013481
2023-11-01PPIPPIUS~TOYAUnited States0.008465
2023-12-01PPIPPIUS~TOYAUnited States0.00948
2024-01-01PPIPPIUS~TOYAUnited States0.008222
2024-02-01PPIPPIUS~TOYAUnited States0.015153
2024-03-01PPIPPIUS~TOYAUnited States0.020896
data.extra.get("results_metadata")
{'PPIUS~TOYA': {'title': 'United States - Producer price index',
'country': 'United States',
'frequency': 'M',
'dataset': 'BLS_PPI00',
'transform': 'Change from one year ago',
'units': 'INDEX',
'scale': 'PERCENT',
'multiplier': 1,
'additional_info': {'DATA_DOMAIN:Data Domain': 'PPI:Producer price indices',
'REF_AREA:Reference country or area': 'US:United States',
'INDICATOR:Economic Indicator': 'PPPI_SA_IX:Prices, Producer Price Index, All Commodities, Seasonally adjusted, Index',
'COUNTERPART_AREA:Counterpart country or area': '_Z:Not applicable',
'FREQ:Frequency': 'M:Monthly',
'UNIT_MULT:Unit multiplier': '0:Units'}}}
Example - Commodity Indicator

Values are always in USD.

lead = obb.economy.indicators("plead")

lead.to_df().tail(4)
datesymbol_rootsymbolcountryvalue
2023-10-01PLEADPLEADWorld2131.4
2023-11-01PLEADPLEADWorld2188.5
2023-12-01PLEADPLEADWorld2027.2
2024-01-01PLEADPLEADWorld2087.4
lead.extra["results_metadata"]
{'PLEAD': {'title': 'World - Lead',
'country': 'World',
'frequency': 'M',
'dataset': 'IMF_PCPS',
'transform': None,
'units': 'USD',
'scale': 'Units',
'multiplier': 1,
'additional_info': {'FREQ:Frequency': 'M:Monthly',
'REF_AREA:Reference Area': 'W00:All Countries, excluding the IO',
'COMMODITY:Commodity': 'PLEAD:Primary Commodity Prices, Lead',
'UNIT_MEASURE:Unit of Measure': 'USD:US Dollars',
'UNIT_MULT:Scale': '0:Units'}}}
Example - Multiple Indicators & Countries With Transform
params = {"symbol": "core,cpi", "country": "us,de,jp", "transform": "toya"}
data = obb.economy.indicators(**params)
df = data.to_df().filter(like="2024", axis=0)

df
datesymbol_rootsymbolcountryvalue
2024-01-01CORECOREDE~TOYAGermany0.03394
2024-01-01CORECOREJP~TOYAJapan0.03523
2024-01-01CORECOREUS~TOYAUnited States0.03875
2024-01-01CPICPIDE~TOYAGermany0.02887
2024-01-01CPICPIJP~TOYAJapan0.021012
2024-01-01CPICPIUS~TOYAUnited States0.03106
2024-02-01CORECOREDE~TOYAGermany0.03454
2024-02-01CORECOREJP~TOYAJapan0.03216
2024-02-01CORECOREUS~TOYAUnited States0.03762
2024-02-01CPICPIDE~TOYAGermany0.02517
2024-02-01CPICPIJP~TOYAJapan0.02788
2024-02-01CPICPIUS~TOYAUnited States0.03166
2024-03-01CORECOREUS~TOYAUnited States0.03797
2024-03-01CPICPIDE~TOYAGermany0.021533
2024-03-01CPICPIUS~TOYAUnited States0.03475
Example - All Countries

Setting the country to "all" will retrieve data for all available countries.

data = obb.economy.indicators("ny", country="all", transform="tusd")

data.to_df().filter(like="2024", axis=0)
datesymbol_rootsymbolcountryvalue
2024-01-01NYNYBE~TUSDBelgium1132.6
2024-01-01NYNYBG~TUSDBulgaria-78.79
2024-01-01NYNYHR~TUSDCroatia31.99
2024-01-01NYNYCZ~TUSDCzechia-676.3
2024-01-01NYNYDK~TUSDDenmark1323.6
2024-01-01NYNYEE~TUSDEstonia-131.74
2024-01-01NYNYFI~TUSDFinland626.4
2024-01-01NYNYFR~TUSDFrance8570
2024-01-01NYNYDE~TUSDGermany13656
2024-01-01NYNYGR~TUSDGreece451.5
2024-01-01NYNYHU~TUSDHungary-528.7
2024-01-01NYNYIT~TUSDItaly-509.5
2024-01-01NYNYLV~TUSDLatvia53.57
2024-01-01NYNYLT~TUSDLithuania-111.62
2024-01-01NYNYLU~TUSDLuxembourg-3791
2024-01-01NYNYMT~TUSDMalta-218.54
2024-01-01NYNYPL~TUSDPoland-3029
2024-01-01NYNYPT~TUSDPortugal28.42
2024-01-01NYNYRO~TUSDRomania-410.1
2024-01-01NYNYSK~TUSDSlovakia-342.7
2024-01-01NYNYSI~TUSDSlovenia-82.76
2024-01-01NYNYSE~TUSDSweden2334.1
data.extra.get("results_metadata")["NYSE~TUSD"]
{'title': 'Sweden - Net income from abroad (Primary Income)',
'country': 'Sweden',
'frequency': 'M',
'dataset': 'BOP_C6_M',
'transform': 'Values as US dollars',
'units': 'USD',
'scale': 'Units',
'multiplier': 1000000,
'additional_info': {'GEO:Geopolitical entity (reporting)': 'SE:Sweden',
'PARTNER:Geopolitical entity (partner)': 'WRL_REST:Rest of the world',
'SECTPART:Sector (ESA 2010)': 'S1:Total economy',
'SECTOR10:Sector (ESA 2010)': 'S1:Total economy',
'FREQ:Frequency': 'M:Monthly',
'STK_FLOW:Stock or flow': 'BAL:Balance',
'CURRENCY:Currency': 'MIO_NAC:Million units of national currency',
'BOP_ITEM:BOP_item': 'IN1:Primary income'}}

Advanced Symbols

Details

The grouping behaviour can be overridden. This will allow multiple transformations, or for a specific symbol to ignore the supplied country and transform parameters.

Example - Bypass Group Parameters

The "~" character is used to separate the base symbol + 2-letter ISO country code, and the transformation. It works as a flag to exclude from the other parameters.

obb.economy.indicators("CPIUS~").to_df().tail(2)
datesymbol_rootsymbolcountryvalue
2024-02-01CPICPIUSUnited States311.1
2024-03-01CPICPIUSUnited States312.2

Without "~", symbols are assumed to be a base symbol, and require a country parameter. An error (or warning where at least one symbol supplied was valid) is raised if the condition is not met.

obb.economy.indicators("CPIUS")
OpenBBError: No valid combination of indicator symbols and countries were supplied.
Valid countries for 'CPIUS' are: None
If the symbol - CPIUS - is missing a country code. Please add the two-letter country code or use the country parameter.
If already included, add '~' to the end of the symbol.

This example bypasses the transformation for US data, applying it only to France.

obb.economy.indicators(symbol=["CPIUS~","CPI"], country="fr", transform="toya").to_df().tail(2)
datesymbol_rootsymbolcountryvalue
2024-03-01CPICPIFR~TOYAFrance0.022947
2024-03-01CPICPIUSUnited States312.2
Example - Non-Standard Symbols

The symbol parameter can also be used to access non-standard series. These are specific to reporting entities, like the Ministry of Finance, Japan. These symbols are not searchable, but the structure will be familiar if you have worked with the particular source before. For this purpose, enter each symbol ending with, "~".

important

Non-standard symbols will not have transformations, standardized metadata, or normalized percent values.

Japan Yield Curve

symbols = [
"MFJP_IR.1Y.D.JP~",
"MFJP_IR.2Y.D.JP~",
"MFJP_IR.3Y.D.JP~",
"MFJP_IR.4Y.D.JP~",
"MFJP_IR.5Y.D.JP~",
"MFJP_IR.6Y.D.JP~",
"MFJP_IR.7Y.D.JP~",
"MFJP_IR.8Y.D.JP~",
"MFJP_IR.9Y.D.JP~",
"MFJP_IR.10Y.D.JP~",
"MFJP_IR.15Y.D.JP~",
"MFJP_IR.20Y.D.JP~",
"MFJP_IR.25Y.D.JP~",
"MFJP_IR.30Y.D.JP~",
"MFJP_IR.40Y.D.JP~",
]
data = obb.economy.indicators(symbol=symbols)

curve = data.to_df().filter(like="2024-04-11", axis=0)

curve
datesymbol_rootsymbolcountryvalue
2024-04-11MFJP_IR.1Y.D.JPJapan0.068
2024-04-11MFJP_IR.2Y.D.JPJapan0.27
2024-04-11MFJP_IR.3Y.D.JPJapan0.28
2024-04-11MFJP_IR.4Y.D.JPJapan0.37
2024-04-11MFJP_IR.5Y.D.JPJapan0.485
2024-04-11MFJP_IR.6Y.D.JPJapan0.508
2024-04-11MFJP_IR.7Y.D.JPJapan0.592
2024-04-11MFJP_IR.8Y.D.JPJapan0.68
2024-04-11MFJP_IR.9Y.D.JPJapan0.757
2024-04-11MFJP_IR.10Y.D.JPJapan0.854
2024-04-11MFJP_IR.15Y.D.JPJapan1.289
2024-04-11MFJP_IR.20Y.D.JPJapan1.625
2024-04-11MFJP_IR.25Y.D.JPJapan1.78
2024-04-11MFJP_IR.30Y.D.JPJapan1.907
2024-04-11MFJP_IR.40Y.D.JPJapan2.065
data.extra["results_metadata"].get("MFJP_IR.5Y.D.JP")
{'title': 'Japan - Japanese Government Bonds - 5Y yield',
'country': 'Japan',
'frequency': 'D',
'dataset': 'MFJP_IR',
'transform': None,
'units': None,
'scale': None,
'multiplier': 1,
'additional_info': {'3:Indicator': '8:Japanese Government Bonds - 5Y yield',
'GEO:None': '107:None'}}