You are on page 1of 1

Assignment 2: Collect Company Financial Data with Finnhub API

The objective of this assignment is to use Finnhub API to collect financial information (specifically
the amount of total assets) about a few focal companies and their peer companies.

Please follow the following steps to set up this assignment.

Preparation

1. Go to https://finnhub.io/, click on “Get free API key”, and sign up as a new user
2. Copy and paste your API key to a text file, name the text file as finnhub_api_key.txt and put it
in your Google Drive/Colab Notebooks folder
3. Download company_symbols.csv from Canvas and put it in your Google Drive/Colab
Notebooks folder. You will need to collect the total assets of year 2022 for each company in
this csv file and its peer companies.
4. Click on Assignment2: Data Collection and Processing Starting Colab Link:
https://colab.research.google.com/drive/1oj21Bwj89G8mwIN3NwZroPghZiO7iiCy?usp=sha
ring
5. Make a copy of the starting notebook and connect it to your Google Drive
6. Run the fourth and fifth cells to ensure you have connected to your Google Drive and are
able to access finnhub_api_key.txt and company_symbols.csv
7. Access Finnhub API documentation: https://finnhub.io/docs/api/introduction to learn about
API parameters and responses

Main Tasks

8. Follow the instructions in the notebook to fill out the function named:
get_company_peers(api_key, company) and get_total_assets(api_key, company). Please
listen to the lecture attentively for more details of the functions.
9. Uncomment the last line of code in the starting Colab Notebook to call the
get_total_assets(api_key, company) function
10. Please see AAPL.csv and MMM.csv for example output files corresponding to AAPL and
MMM. You should have 10 output files like AAPL.csv and MMM.csv as the result of your data
collection.

Submission

11. Please download your notebook and submit it to Canvas Assignment 2: Submission folder
12. Please download the output files (e.g., AAPL.csv and MMM.csv) that you have collected,
compress them to a ZIP file, and submit the ZIP file to Canvas Assignment 2: Submission
folder
13. Please also share your notebook with view access and paste the link as a comment when
you submit

You might also like