Financial & Economic Indicators Database


Explore MacroVar Financial and Macroeconomic indicators database. Access historical data using MacroVar's web interface Excel or API.


Financial Data

varnmSymbolCountryType
POSCOCDS.POSCOSouth KoreaCorporate CDS
RIO TINTO LIMITEDCDS.RIO-TINTOAustraliaCorporate CDS
BHP BILLITON LIMITEDCDS.BHP-BILLITONAustraliaCorporate CDS
Hutchison Whampoa LimitedCDS.Hutchison-WhampoaHong KongCorporate CDS
MATALAN FINANCE PLCCDS.MATALAN-FINANCEUnited KingdomCorporate CDS
PEUGEOT SACDS.PEUGEOTFranceCorporate CDS
ACWI ETFEWAGlobalCDS
ARDAGH PACKAGING FINANCE PUBLIC LIMITED COMPANYCDS.Ardagh-Packaging-FinanceUnited KingdomCorporate CDS
CROWN EUROPEAN HOLDINGSCDS.Crown-HoldingsFranceCorporate CDS
CMA CGMCDS.CMA-CGMFranceCorporate CDS

Economic Indicators

Economic IndicatorSymbolCountryurl
balance of tradeal.balanceoftradeAlbaniahttps://macrovar.com/albania/balance-of-trade
bank lending rateal.banks.lendingrateAlbaniahttps://macrovar.com/albania/bank-lending-rate
banks balance sheetal.banks.bsAlbaniahttps://macrovar.com/albania/banks-balance-sheet
building permitsal.buildingpermitsAlbaniahttps://macrovar.com/albania/building-permits
business confidenceal.bizconfidenceAlbaniahttps://macrovar.com/albania/business-confidence
central bank balance sheetal.cb.assetsAlbaniahttps://macrovar.com/albania/central-bank-balance-sheet
consumer confidenceal.consconfidenceAlbaniahttps://macrovar.com/albania/consumer-confidence
consumer price index cpial.cpiAlbaniahttps://macrovar.com/albania/consumer-price-index-cpi
current accountal.currentaccountAlbaniahttps://macrovar.com/albania/current-account
current account to gdpal.currentaccountgdpAlbaniahttps://macrovar.com/albania/current-account-to-gdp

MacroVar API


Follow the Steps below to Access the MacroVar Database via the following API:
Step 1: Copy the following Code or click to download python file MacroVar Python API
Step 2: Search MacroVar financial securities and macroeconomic indicators database using the search options above Step 3:Insert your Query's criteria in d=am.load by specifying the variable name, start and end date
Alternatively, you can access MacroVar using MS Excel

# -*- coding: utf-8 -*-
"""
MacroVar API Python Script
Upgrade your Account to gain unlimited access https://macrovar.com/plans
Please find and search the full list of macroeconomic variables & financial variables at https://MacroVar.com/financial-database-variables
Instructions: 1. Insert your username, password 2. variable name, start date, end date 3. Run Script
"""
import http.client
from urllib.parse import quote
import pandas as pd
class MacroVar(object):
user_name, password, conn, headers, payload = None, None, None, None, None
def __init__(self, user_name, password):
self.auth(user_name, password)
self.conn = http.client.HTTPConnection("api.MacroVar.com:8080")
def auth(self, user_name, password):
self.user_name = user_name
self.password = password
self.headers = {'Authorization': '{};{}'.format(self.user_name, self.password)}
def get_vars(self):
self.conn.request(method="GET", url="/vars", headers=self.headers)
response = self.conn.getresponse()
data = response.read()
str_data = data.decode("utf-8")
return str_data.split(',')
def load_data(self, var_name, start_date=None, end_date=None):
v = self.get_vars()
if var_name not in v:
raise ValueError('Variable name not found, check the get_vars() result.')
params = 'name={}'.format(quote(var_name))
if start_date:
params += '&start_date={}'.format(start_date)
if end_date:
params += '&end_date={}'.format(end_date)
url = "/query?" + params
self.conn.request(method="GET", url=url, headers=self.headers)
response = self.conn.getresponse()
if response.status == 200:
data = response.read()
str_data = data.decode("utf-8")
data_rows = str_data.split('\r\n')
if len(data_rows) <= 1:
return data_rows
data_arr = []
for d in data_rows:
data_arr.append(d.split(','))
d = data_arr[:-1] # skip the last empty row
return pd.DataFrame(d[2:], columns=d[0])
else:
raise ValueError('Server error {} {}'.format(response.status, response.reason))
return None
if __name__ == '__main__':
am = MacroVar('MacroVartest', 'test')
v = am.get_vars()
d = am.load_data('US-1Y', '2010-01-03', '2019-02-01')
print (d)
Feedback
Feedback
How would you rate your experience?
Do you have any additional comment?
Next
Enter your email if you'd like us to contact you regarding with your feedback.
Back
Submit
Thank you for submitting your feedback!