Informs Knowledge Cafe' (Spring 2021)
Tutorial-Data Collection
The Informs Student Chapter, University of Iowa holds an informal gathering known as Knowledge Café in which people share their knowledge and expertise.
Anyone interested in learning from other researchers is welcomed. More about the University of Iowa Student INFORMS can be found here!
As a member of INFORMS Student Chapter, I hold a workshop to teach PhD and Master students (Business Analytics and Finance) how to setup the Application Programming Interface (API) for collecting data
from Blomberg, Eikon, and WRDS. We mainly focus on Wharton Research Data Services (WRDS), Bloomberg terminal, and Refinitiv Eikon using Python API.
1. WRDS
Setup
The installation is fairly easy. You need to create account or register here. For more information, you may ask Kim Bloedel, the head of Pomerantz Business Library.
Install the WRDS Python Module by running the following command in your Anaconda Terminal.
pip install wrds
Data Collection from WRDS
import the WRDS Python Module
import wrds
Connect to WRDSdb = wrds.Connection(wrds_username='your-username')

Find your library and tables. They can be found in the "Variable Description" of interested libraries, see the following picture:

db.list_tables(library="intersted library")
.For example, in the follwing picture, I am going to find out what tables are included in the library of
'comp'
:

'wrds_seg_customer'

'wrds_seg_customer'
and the library 'comp'


First, we need to create a dictionary of tickers with the following format:



2. Bloobmerg
Two python APIs are available:2.1. Installation
2.1.1. pdblp
I personally do not recommend this API since I did not find it very user-friendly compared to the Xbbg (next one that I am using). But you can find installation and documentation in the following links:
2.1.2. xbbg
You can find the installation and documetationpip install xbbg
pconda install -c conda-forge blpapi
blpapi3_32.dll
,etc
Next, download the file. I am using Windows, so I download the file which is compatible with windows.

blpapi3_32.dll
and blpapi3_64.dll
under bin folder to Bloomberg BLPAPI_ROOT folder, normally blp/DAPI.

2.2. Data Collection from Bloomberg by using xbbg

blp.bdh('tickers', field,override,start_date='YYYY-MM-DD', end_date='YYYY-MM-DD')
. 'tickers': This is where you put tickers. Notice that tickers format in WRDS are differnt than Bloomberg. For example, the ticker of Ford motors Co. in Bloomberg is 'F US Equity' but it 'F' in WRDS.
See the following figure which shows revenue of Ford motors Co. from 2019-01-01 till 2020-12-30

blp.bdp(tickers,fields)


3. EIKON
Eikon is a set of software products provided by Refinitiv. At the Uiowa we have one MAchine in Fin Lab have access to EIKON. API installation is fairly easy, you can find more information here!.