Is there any API for getting past/future earnings date for a specific symbol?
I tried TDAmeritrade API, Ally and IEX, none of them provide this information yet.
I just found this free simple API, returning today's earnings by default and symbols with earnings call if you pass date:
https://api.earningscalendar.net/
or
https://api.earningscalendar.net/?date=20190925
Here is a short python3 script that will parse the info that you're looking for from Yahoo Finance:
import requests
import json
import pprint
symbol='T'
url='https://finance.yahoo.com/quote/' + symbol
resp=requests.get(url)
r=resp.text
i1=0
i1=r.find('root.App.main', i1)
i1=r.find('{', i1)
i2=r.find("\n", i1)
i2=r.rfind(';', i1, i2)
jsonstr=r[i1:i2]
data = json.loads(jsonstr)
pprint.pprint(data['context']['dispatcher']['stores']['QuoteSummaryStore']['calendarEvents']['earnings'])