Last active
December 24, 2019 17:43
-
-
Save ChristopherNickels/0afc6ad1648c715bde31eabcdd3cb007 to your computer and use it in GitHub Desktop.
This file was used to create a txt file of every company's cash flow statement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| @authors: Christopher, Lorenzo | |
| """ | |
| import requests | |
| import json | |
| from utils import companies | |
| def get_cash_flow(company): | |
| resp = requests.get(f"https://financialmodelingprep.com/api/v3/financials/cash-flow-statement/{company}") | |
| resp = resp.json() | |
| file = open(f"cash-flow-{company}.txt", "w") | |
| json.dump(resp, file, indent=2) | |
| file.close() | |
| for company in companies: | |
| get_cash_flow(company) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment