Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Scrapes data from Yahoo! Finance earnings calendar

Project description

Yahoo! Earnings Calendar Scraper

codecov Build Status

Scrapes Yahoo! Finance earnings calendar to get data for a specific date or a date range.



pip install yahoo_earnings_calendar


Get earnings date information on a specific date or in a date range

import datetime
from yahoo_earnings_calendar import YahooEarningsCalendar

date_from = datetime.datetime.strptime(
    'May 5 2017  10:00AM', '%b %d %Y %I:%M%p')
date_to = datetime.datetime.strptime(
    'May 8 2017  1:00PM', '%b %d %Y %I:%M%p')
yec = YahooEarningsCalendar()
print(yec.earnings_between(date_from, date_to))

Data attributes

  • companyshortname: Company Name
    • e.g., 20160606
  • ticker: Ticker
    • e.g., AAPL
  • startdatetime: Event Start Time
    • e.g., 2017-04-23T21:00:00.000-04:00
  • startdatetimetype: Event Start Time Type
    • e.g., TAS (Time Not Supplied), AMC (After Market Close )
  • epsestimate: EPS Estimate
  • epsactual: Reported EPS
  • epssurprisepct: Surprise (%)
  • gmtOffsetMilliSeconds: GMT Offset in MS

Get the next earnings date of a specific symbol

import datetime
from yahoo_earnings_calendar import YahooEarningsCalendar

yec = YahooEarningsCalendar()
# Returns the next earnings date of BOX in Unix timestamp
# 1508716800

Get all the available earnings data of a specific symbol

from yahoo_earnings_calendar import YahooEarningsCalendar

yec = YahooEarningsCalendar()
    # Returns a list of all available earnings of BOX

Set delay between requests

By default, requests are delayed by 1.8 sec to avoid exceeding the 2000/hour rate limit. You can override the default delay by passing an argument to the YahooEarningsCalendar constructor.

import datetime
from yahoo_earnings_calendar import YahooEarningsCalendar

my_custom_delay_s = 0.5

yec = YahooEarningsCalendar(my_custom_delay_s)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for yahoo-earnings-calendar, version 0.6.0
Filename, size File type Python version Upload date Hashes
Filename, size yahoo_earnings_calendar-0.6.0-py3-none-any.whl (7.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size yahoo_earnings_calendar-0.6.0.tar.gz (4.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page