Closed IonutQo2 closed 3 weeks ago
from edgar.stock import Stock
import requests
original_get = requests.get
def get_with_user_agent(*args, **kwargs):
if 'headers' not in kwargs:
kwargs['headers'] = {}
kwargs['headers']['User-Agent'] = 'Your-name app-name your-email'
return original_get(*args, **kwargs)
requests.get = get_with_user_agent
stock = Stock('AAPL')
period = 'quarterly' # or 'annual', which is the default
year = 2016 # can use default of 0 to get the latest
quarter = 1 # 1, 2, 3, 4, or default value of 0 to get the latest
# using defaults to get the latest annual, can simplify to stock.get_filing()
filing = stock.get_filing(period, year, quarter)
# financial reports (contain data for multiple years)
# income_statements = filing.get_income_statements()
# balance_sheets = filing.get_balance_sheets()
cash_flows = filing.get_cash_flows()
print(cash_flows)
Hope this helps
Thanks a lot, it worked.
Hello,
I tried the standard script provided in the example and I received the following error:
My code is the following:
Anyone else encountered this? They say maximum 10 requests per second, is the provided script doing more?