{"id":108865,"date":"2021-10-28T09:46:00","date_gmt":"2021-10-28T13:46:00","guid":{"rendered":"https:\/\/ibkrcampus.com\/?p=108865"},"modified":"2022-11-21T09:48:49","modified_gmt":"2022-11-21T14:48:49","slug":"how-to-get-stock-earnings-data-with-python","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-get-stock-earnings-data-with-python\/","title":{"rendered":"How to Get Stock Earnings Data with Python"},"content":{"rendered":"\n<p>In this post, we\u2019ll walk through a few examples for getting stock earnings data with Python. We will be using&nbsp;<a href=\"https:\/\/theautomatic.net\/yahoo_fin-documentation\/\">yahoo_fin<\/a>, which was recently updated. The latest version now includes functionality to easily pull earnings calendar information for individual stocks or dates.<\/p>\n\n\n\n<p>If you need to install&nbsp;<strong>yahoo_fin<\/strong>, you can use pip:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install yahoo_fin<\/code><\/pre>\n\n\n\n<p>If you already have it installed and need to upgrade, you can update your version like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install yahoo_fin --upgrade<\/code><\/pre>\n\n\n\n<p>To get started, let\u2019s import&nbsp;<strong>yahoo_fin<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import yahoo_fin.stock_info as si<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Getting stock earnings calendar data<\/strong><\/h2>\n\n\n\n<p>The first method we\u2019ll cover is the&nbsp;<em>get_earnings_history<\/em>&nbsp;function.&nbsp;<em>get_earnings_history<\/em>&nbsp;returns a list of dictionaries. Each dictionary contains an earnings date along with EPS actual \/ expected information. Let\u2019s test it out with a few sample tickers.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># get earnings history for AAPL\naapl_earnings_hist = si.get_earnings_history(\"aapl\")<\/code><\/pre>\n\n\n\n<p>Depending on the ticker, the data returned may include future earnings dates. Any data for future earnings dates will have a&nbsp;<strong>None<\/strong>&nbsp;value for EPS actual. Below, we look at one of the entries returned. We can see the earnings date for this entry is July 30, 2019. The EPS actual is 0.55 and the EPS estimate is 0.53.<\/p>\n\n\n\n<figure class=\"wp-block-image img-twothird\"><img decoding=\"async\" width=\"421\" height=\"259\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2021\/10\/python-earnings-calendar-theautomatic-net.png\" alt=\"\" class=\"wp-image-108883 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/10\/python-earnings-calendar-theautomatic-net.png 421w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/10\/python-earnings-calendar-theautomatic-net-300x185.png 300w\" data-sizes=\"(max-width: 421px) 100vw, 421px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 421px; aspect-ratio: 421\/259;\" \/><\/figure>\n\n\n\n<p>If you want to convert the list of earnings dictionaries to a data frame, you can use&nbsp;<strong>pandas<\/strong>&nbsp;like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import pandas as pd\n \nframe &lt;- pd.DataFrame.from_dict(aapl_earnings_hist)<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image img-twothird\"><img decoding=\"async\" width=\"640\" height=\"416\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2021\/10\/python-historical-earnings-data-theautomatic-net.png\" alt=\"\" class=\"wp-image-108887 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/10\/python-historical-earnings-data-theautomatic-net.png 640w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/10\/python-historical-earnings-data-theautomatic-net-300x195.png 300w\" data-sizes=\"(max-width: 640px) 100vw, 640px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 640px; aspect-ratio: 640\/416;\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-how-to-get-the-next-earnings-date-for-a-stock\"><strong>How to get the next earnings date for a stock<\/strong><\/h2>\n\n\n\n<p><strong>yahoo_fin<\/strong>&nbsp;also now has a function to find the next upcoming earnings date for an input stock ticker. If the next earnings date is known, then you can find it using the&nbsp;<em>get_next_earnings_date<\/em>&nbsp;method.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>si.get_next_earnings_date(\"aapl\")\n \nsi.get_next_earnings_date(\"nflx\")<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to get stocks with earnings on a specific date<\/strong><\/h2>\n\n\n\n<p>What if you want to know all the stocks that have earnings on a specific date? You can find them using the&nbsp;<em>get_earnings_for_date<\/em>&nbsp;method. This function takes a single date as input and returns a list of dictionaries. Each dictionary contains a ticker, company name, EPS estimate, and (if known) EPS actual. The EPS actual value will only have a value if you input a date in the past \u2013 otherwise, you\u2019ll get a&nbsp;<strong>None<\/strong>&nbsp;type.&nbsp;<em>get_earnings_for_date<\/em>&nbsp;can handle a variety of date formats as input.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>si.get_earnings_for_date(\"02\/18\/2021\")\n \nsi.get_earnings_for_date(\"2021-02-25\")\n \nsi.get_earnings_for_date(\"March 1 2021\")<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to get stocks with earnings on a date range<\/strong><\/h2>\n\n\n\n<p>Extending from the above section, you can also get all the stocks that have earnings within an input date range. To do that, let\u2019s take a look at the&nbsp;<em>get_earninggs_in_date_range<\/em>&nbsp;method. This function takes a start date and end date as parameters.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>earnings_in_week = si.get_earnings_in_date_range(\"02\/16\/2021\", \"02\/23\/2021\")<\/code><\/pre>\n\n\n\n<p>If you\u2019re pulling a longer range, this method may take more time as the API needs to pull each day separately.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Getting recent revenue data<\/strong><\/h2>\n\n\n\n<p>The last function we\u2019ll cover in the article is the&nbsp;<em>get_earnings<\/em>&nbsp;method.&nbsp;<em>get_earnings<\/em>&nbsp;takes an input ticker and returns a dictionary of yearly \/ quarterly revenue and the last four quarters of EPS actual \/ estimate data (see here:&nbsp;<a href=\"https:\/\/finance.yahoo.com\/quote\/aapl\/financials?p=aapl\">https:\/\/finance.yahoo.com\/quote\/aapl\/financials?p=aapl<\/a>).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>si.get_earnings(\"aapl\")\n \nsi.get_earnings(\"amzn\")<\/code><\/pre>\n\n\n\n<p><em>Visit https:\/\/theautomatic.net\/ for additional insight on this topic:<br><a href=\"https:\/\/theautomatic.net\/2021\/02\/16\/how-to-get-stock-earnings-data-with-python\/\">https:\/\/theautomatic.net\/2021\/02\/16\/how-to-get-stock-earnings-data-with-python\/<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Andrew Treadway walks us through a few examples for getting stock earnings data with Python.<\/p>\n","protected":false},"author":388,"featured_media":24668,"comment_status":"closed","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[339,343,349,338,341,352,344],"tags":[806,1224,595,7485],"contributors-categories":[13695],"class_list":{"0":"post-108865","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-data-science","8":"category-programing-languages","9":"category-python-development","10":"category-ibkr-quant-news","11":"category-quant-development","12":"category-quant-north-america","13":"category-quant-regions","14":"tag-data-science","15":"tag-pandas","16":"tag-python","17":"tag-yahoo_fin","18":"contributors-categories-theautomatic-net"},"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Get Stock Earnings Data with Python | IBKR Quant<\/title>\n<meta name=\"description\" content=\"Andrew Treadway walks us through a few examples for getting stock earnings data with Python.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/108865\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Get Stock Earnings Data with Python | IBKR Quant Blog\" \/>\n<meta property=\"og:description\" content=\"Andrew Treadway walks us through a few examples for getting stock earnings data with Python.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-get-stock-earnings-data-with-python\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2021-10-28T13:46:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-21T14:48:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2019\/11\/coins-stocks.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"900\" \/>\n\t<meta property=\"og:image:height\" content=\"550\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Andrew Treadway\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andrew Treadway\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\n\t    \"@context\": \"https:\\\/\\\/schema.org\",\n\t    \"@graph\": [\n\t        {\n\t            \"@type\": \"NewsArticle\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-get-stock-earnings-data-with-python\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-get-stock-earnings-data-with-python\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Andrew Treadway\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/d4018570a16fb867f1c08412fc9c64bc\"\n\t            },\n\t            \"headline\": \"How to Get Stock Earnings Data with Python\",\n\t            \"datePublished\": \"2021-10-28T13:46:00+00:00\",\n\t            \"dateModified\": \"2022-11-21T14:48:49+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-get-stock-earnings-data-with-python\\\/\"\n\t            },\n\t            \"wordCount\": 533,\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-get-stock-earnings-data-with-python\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2019\\\/11\\\/coins-stocks.jpg\",\n\t            \"keywords\": [\n\t                \"Data Science\",\n\t                \"Pandas\",\n\t                \"Python\",\n\t                \"yahoo_fin\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"Data Science\",\n\t                \"Programming Languages\",\n\t                \"Python Development\",\n\t                \"Quant\",\n\t                \"Quant Development\",\n\t                \"Quant North America\",\n\t                \"Quant Regions\"\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-get-stock-earnings-data-with-python\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-get-stock-earnings-data-with-python\\\/\",\n\t            \"name\": \"How to Get Stock Earnings Data with Python | IBKR Quant Blog\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\"\n\t            },\n\t            \"primaryImageOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-get-stock-earnings-data-with-python\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-get-stock-earnings-data-with-python\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2019\\\/11\\\/coins-stocks.jpg\",\n\t            \"datePublished\": \"2021-10-28T13:46:00+00:00\",\n\t            \"dateModified\": \"2022-11-21T14:48:49+00:00\",\n\t            \"description\": \"Andrew Treadway walks us through a few examples for getting stock earnings data with Python.\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"ReadAction\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-get-stock-earnings-data-with-python\\\/\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"ImageObject\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-get-stock-earnings-data-with-python\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2019\\\/11\\\/coins-stocks.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2019\\\/11\\\/coins-stocks.jpg\",\n\t            \"width\": 900,\n\t            \"height\": 550,\n\t            \"caption\": \"Tech Dividends\"\n\t        },\n\t        {\n\t            \"@type\": \"WebSite\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"name\": \"IBKR Campus US\",\n\t            \"description\": \"Financial Education from Interactive Brokers\",\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"SearchAction\",\n\t                    \"target\": {\n\t                        \"@type\": \"EntryPoint\",\n\t                        \"urlTemplate\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/?s={search_term_string}\"\n\t                    },\n\t                    \"query-input\": {\n\t                        \"@type\": \"PropertyValueSpecification\",\n\t                        \"valueRequired\": true,\n\t                        \"valueName\": \"search_term_string\"\n\t                    }\n\t                }\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"Organization\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\",\n\t            \"name\": \"Interactive Brokers\",\n\t            \"alternateName\": \"IBKR\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"logo\": {\n\t                \"@type\": \"ImageObject\",\n\t                \"inLanguage\": \"en-US\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\",\n\t                \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"width\": 669,\n\t                \"height\": 669,\n\t                \"caption\": \"Interactive Brokers\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\"\n\t            },\n\t            \"publishingPrinciples\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/about-ibkr-campus\\\/\",\n\t            \"ethicsPolicy\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/cyber-security-notice\\\/\"\n\t        },\n\t        {\n\t            \"@type\": \"Person\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/d4018570a16fb867f1c08412fc9c64bc\",\n\t            \"name\": \"Andrew Treadway\",\n\t            \"description\": \"Andrew Treadway currently works as a Senior Data Scientist, and has experience doing analytics, software automation, and ETL. He completed a master\u2019s degree in computer science \\\/ machine learning, and an undergraduate degree in pure mathematics. Connect with him on LinkedIn: https:\\\/\\\/www.linkedin.com\\\/in\\\/andrew-treadway-a3b19b103\\\/In addition to TheAutomatic.net blog, he also teaches in-person courses on Python and R through my NYC meetup: more details.\",\n\t            \"sameAs\": [\n\t                \"https:\\\/\\\/theautomatic.net\\\/about-me\\\/\"\n\t            ],\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/andrewtreadway\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Get Stock Earnings Data with Python | IBKR Quant","description":"Andrew Treadway walks us through a few examples for getting stock earnings data with Python.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/108865\/","og_locale":"en_US","og_type":"article","og_title":"How to Get Stock Earnings Data with Python | IBKR Quant Blog","og_description":"Andrew Treadway walks us through a few examples for getting stock earnings data with Python.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-get-stock-earnings-data-with-python\/","og_site_name":"IBKR Campus US","article_published_time":"2021-10-28T13:46:00+00:00","article_modified_time":"2022-11-21T14:48:49+00:00","og_image":[{"width":900,"height":550,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2019\/11\/coins-stocks.jpg","type":"image\/jpeg"}],"author":"Andrew Treadway","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Andrew Treadway","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-get-stock-earnings-data-with-python\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-get-stock-earnings-data-with-python\/"},"author":{"name":"Andrew Treadway","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/d4018570a16fb867f1c08412fc9c64bc"},"headline":"How to Get Stock Earnings Data with Python","datePublished":"2021-10-28T13:46:00+00:00","dateModified":"2022-11-21T14:48:49+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-get-stock-earnings-data-with-python\/"},"wordCount":533,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-get-stock-earnings-data-with-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2019\/11\/coins-stocks.jpg","keywords":["Data Science","Pandas","Python","yahoo_fin"],"articleSection":["Data Science","Programming Languages","Python Development","Quant","Quant Development","Quant North America","Quant Regions"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-get-stock-earnings-data-with-python\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-get-stock-earnings-data-with-python\/","name":"How to Get Stock Earnings Data with Python | IBKR Quant Blog","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-get-stock-earnings-data-with-python\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-get-stock-earnings-data-with-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2019\/11\/coins-stocks.jpg","datePublished":"2021-10-28T13:46:00+00:00","dateModified":"2022-11-21T14:48:49+00:00","description":"Andrew Treadway walks us through a few examples for getting stock earnings data with Python.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-get-stock-earnings-data-with-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-get-stock-earnings-data-with-python\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2019\/11\/coins-stocks.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2019\/11\/coins-stocks.jpg","width":900,"height":550,"caption":"Tech Dividends"},{"@type":"WebSite","@id":"https:\/\/ibkrcampus.com\/campus\/#website","url":"https:\/\/ibkrcampus.com\/campus\/","name":"IBKR Campus US","description":"Financial Education from Interactive Brokers","publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ibkrcampus.com\/campus\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ibkrcampus.com\/campus\/#organization","name":"Interactive Brokers","alternateName":"IBKR","url":"https:\/\/ibkrcampus.com\/campus\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","width":669,"height":669,"caption":"Interactive Brokers"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/"},"publishingPrinciples":"https:\/\/www.interactivebrokers.com\/campus\/about-ibkr-campus\/","ethicsPolicy":"https:\/\/www.interactivebrokers.com\/campus\/cyber-security-notice\/"},{"@type":"Person","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/d4018570a16fb867f1c08412fc9c64bc","name":"Andrew Treadway","description":"Andrew Treadway currently works as a Senior Data Scientist, and has experience doing analytics, software automation, and ETL. He completed a master\u2019s degree in computer science \/ machine learning, and an undergraduate degree in pure mathematics. Connect with him on LinkedIn: https:\/\/www.linkedin.com\/in\/andrew-treadway-a3b19b103\/In addition to TheAutomatic.net blog, he also teaches in-person courses on Python and R through my NYC meetup: more details.","sameAs":["https:\/\/theautomatic.net\/about-me\/"],"url":"https:\/\/www.interactivebrokers.com\/campus\/author\/andrewtreadway\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2019\/11\/coins-stocks.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/108865","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/users\/388"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=108865"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/108865\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/24668"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=108865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=108865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=108865"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=108865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}