{"id":7394,"date":"2024-09-16T14:26:26","date_gmt":"2024-09-16T18:26:26","guid":{"rendered":"https:\/\/www.benzinga.com\/apis\/?p=7394"},"modified":"2024-10-08T14:34:34","modified_gmt":"2024-10-08T18:34:34","slug":"benzinga-earnings-api-tutorial","status":"publish","type":"post","link":"https:\/\/www.benzinga.com\/apis\/blog\/benzinga-earnings-api-tutorial\/","title":{"rendered":"Benzinga Earnings API: Extracting and Analyzing Historical Earnings Data in Python"},"content":{"rendered":"\n<p>Access to accurate and timely earnings data is essential for investors and analysts who want to understand a company\u2019s financial performance. We offer an API service that provides users with valuable tools for retrieving earnings data. Through our Python SDK, users can easily extract and analyze historical earnings data for specific companies. In this guide, we will focus on retrieving Apple Inc.&#8217;s (AAPL) historical earnings data and conducting further analysis using Benzinga\u2019s Earnings API. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Earnings API by Benzinga<\/strong><\/h2>\n\n\n\n<p><a href=\"https:\/\/docs.benzinga.com\/benzinga-apis\/calendar\/get-earnings\">The Earnings API<\/a> provides critical information regarding company earnings, including earnings per share (EPS), revenue, and earnings surprises. This data is a key component in understanding how well a company has performed relative to analyst expectations, and it can help investors make informed decisions based on financial trends.<\/p>\n\n\n\n<p>The Benzinga Earnings API can be accessed through their <a href=\"https:\/\/docs.benzinga.com\/python-client\">Python SDK<\/a>, allowing for seamless integration into analytical workflows. In this article, we will walk through the process of importing packages, authenticating the API key, extracting earnings data for AAPL, and performing further analysis on the extracted data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Importing Packages<\/strong><\/h2>\n\n\n\n<p>To get started, we will import the necessary packages. We will use Benzinga\u2019s Python SDK to access the API, Pandas to format and manipulate the data, and Matplotlib to visualize the earnings data.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; gutter: false; title: ; notranslate\" title=\"\">\nfrom benzinga import financial_data  # Benzinga&#039;s Python SDK\nimport pandas as pd  # For data formatting\nimport matplotlib.pyplot as plt  # For data visualization\n<\/pre><\/div>\n\n\n<p>Here, the financial_data module from Benzinga\u2019s Python SDK provides easy access to financial data APIs, including the Earnings API. Pandas is used to manage the data as a DataFrame, which makes it easier to manipulate and analyze. Additionally, Matplotlib is imported to help visualize the extracted data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Authenticating API Key<\/strong><\/h2>\n\n\n\n<p>Before you can access any data through the Benzinga API, you need to authenticate your API key. This key acts as your access token, allowing you to retrieve data.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; gutter: false; title: ; notranslate\" title=\"\">\napi_key = &quot;YOUR_API_KEY&quot;\nfin = financial_data.Benzinga(api_key)\n<\/pre><\/div>\n\n\n<p>Replace &#8220;YOUR_API_KEY&#8221; with your actual Benzinga API key, which you can obtain by signing up for Benzinga\u2019s API service. This step is essential as it enables you to interact with Benzinga\u2019s financial data API and retrieve earnings data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Extracting Earnings Data of AAPL<\/strong><\/h2>\n\n\n\n<p>Now that we\u2019ve authenticated the API key, let\u2019s move on to extracting the earnings data for Apple Inc. (AAPL). The code below requests the earnings data from <a href=\"https:\/\/docs.benzinga.com\/benzinga-apis\/calendar\/get-earnings\">Benzinga\u2019s Earnings API<\/a> and formats it as a Pandas DataFrame for further analysis.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; gutter: false; title: ; notranslate\" title=\"\">\naapl_earnings = pd.DataFrame(fin.earnings(company_tickers=&#039;AAPL&#039;)&#x5B;&#039;earnings&#039;]).set_index(&#039;date&#039;)\naapl_earnings = aapl_earnings.iloc&#x5B;::-1]\n\naapl_earnings.head()\n<\/pre><\/div>\n\n\n<p>This code first calls the earnings() method from Benzinga\u2019s API using the AAPL ticker symbol to retrieve Apple\u2019s earnings data. The JSON response from the API is then converted into a Pandas DataFrame. We set the \u2018date\u2019 column as the DataFrame\u2019s index and reverse the order of the data to ensure it is arranged chronologically (from oldest to newest).<\/p>\n\n\n\n<p>Here\u2019s a sample output of the DataFrame:<\/p>\n\n\n\n<figure class=\"wp-block-image alignfull\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXcKe7tq8EzMP6YyYJNwB5CBaWmvmi7xLwd8H5GyAL1P4EC1uG1gnd0NLDT1JMp0mjF5FuB-GoTxqBD0BqeHl_zUAsx0taxNPJWS3PU5hVfbqZQMEV-MNfLpb5fohY3qnzCNyyWqIKgEQmfXF2redNh_t9au?key=m8YR0fJfYUv0T6D1FD0-lA\" alt=\"\"\/><\/figure>\n\n\n\n<p>The DataFrame contains important earnings-related metrics such as EPS (Earnings Per Share), revenue, and EPS surprises, allowing us to perform meaningful analysis.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Further Data Analysis<\/strong><\/h2>\n\n\n\n<p>With the earnings data extracted, we can now perform further analysis to gain insights into Apple\u2019s financial performance. We will look at revenue growth over time, visualize EPS surprises, and calculate the average EPS and revenue.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. Revenue Growth Over Time<\/strong><\/h3>\n\n\n\n<p>Revenue growth is an important metric to evaluate a company\u2019s ability to expand its business. Let\u2019s calculate Apple\u2019s revenue growth from year to year and store it in a separate DataFrame.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; gutter: false; title: ; notranslate\" title=\"\">\naapl_earnings_revenue = aapl_earnings&#x5B;aapl_earnings&#x5B;&#039;revenue&#039;] != &#039;&#039;]&#x5B;&#039;revenue&#039;]\naapl_earnings_revenue = aapl_earnings_revenue.astype(float)\n\naapl_earnings_revenue_growth = aapl_earnings_revenue.pct_change() * 100\nrevenue_df = pd.DataFrame(columns=&#x5B;&#039;revenue&#039;, &#039;revenue_growth&#039;])\nrevenue_df&#x5B;&#039;revenue&#039;] = aapl_earnings_revenue\nrevenue_df&#x5B;&#039;revenue_growth&#039;] = aapl_earnings_revenue_growth\n\nrevenue_df.tail()\n<\/pre><\/div>\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXeruQ-AlaepJZ60YWNKKWxIcg2LdM7fgv8MWU1iA7iZHEWgixXHpA0pUXQX2sFNXbJtkklQdiUdqnjzUc6Te-22E9oa2gKkcxapOojnPG7gLI-SFcKsiaWWkEOeOmsQ3mZuFIxTWgBJtBPTO51N0ZVnCuI?key=m8YR0fJfYUv0T6D1FD0-lA\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Code Explanation:<\/strong><\/p>\n\n\n\n<p>Here, we extract the revenue data, convert it to a float type (since financial data is numeric), and calculate the percentage change in revenue using the pct_change() method. The revenue growth is expressed as a percentage. The results are stored in a new DataFrame, allowing us to track Apple\u2019s revenue growth over time.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. EPS Surprises Over Time<\/strong><\/h3>\n\n\n\n<p>Next, we\u2019ll visualize Apple\u2019s EPS (Earnings Per Share) surprises. EPS surprises indicate how much the reported EPS deviated from analysts\u2019 expectations, and they can provide insight into the company\u2019s financial performance.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; gutter: false; title: ; notranslate\" title=\"\">\nplt.style.use(&#039;ggplot&#039;)\nplt.rcParams&#x5B;&#039;figure.figsize&#039;] = (12,6)\n\naapl_earnings_eps_surprise = aapl_earnings&#x5B;aapl_earnings.eps_surprise != &#039;&#039;]&#x5B;&#039;eps_surprise&#039;]\naapl_earnings_eps_surprise = aapl_earnings_eps_surprise.astype(float)\n\naapl_earnings_eps_surprise.plot(kind=&#039;bar&#039;, title=&#039;Apple EPS Surprises Over Time&#039;)\nplt.ylabel(&#039;EPS Surprise&#039;)\n\nplt.show()\n<\/pre><\/div>\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXciBrHt4Ah3xLpWeXQcRoqTInboT7D2kj7XGvVh0RHH6fbCUiQ8ZGCyqX1KZNd-C0SDGFDRKJGXpaxdKGovL4ZKfvEz0599vtzbfcfTBT0Dp7pcNaH-SLhpFcvKCGUqvXi2y6z6-jKCoBSPNsOsTJK9-rQ?key=m8YR0fJfYUv0T6D1FD0-lA\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Code Explanation:<\/strong><\/p>\n\n\n\n<p>We filter out empty values from the eps_surprise column and convert the data to float. Using Matplotlib, we plot the EPS surprises in a bar chart, providing a visual representation of how Apple\u2019s reported earnings have compared to market expectations over time.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. Average EPS and Revenue<\/strong><\/h3>\n\n\n\n<p>Lastly, we calculate Apple\u2019s average EPS and revenue over the available time period. This provides a broader overview of Apple\u2019s historical performance.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; gutter: false; title: ; notranslate\" title=\"\">\naapl_earnings_eps = aapl_earnings&#x5B;aapl_earnings.eps != &#039;&#039;]&#x5B;&#039;eps&#039;].astype(float)\naverage_eps = aapl_earnings_eps.mean()\naverage_revenue = aapl_earnings_revenue.mean()\n\nprint(f&#039;Average EPS: {average_eps:.2f}&#039;)\nprint(f&#039;Average Revenue: {average_revenue:.2f}&#039;)\n<\/pre><\/div>\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXeoeSC0GQnW6whYxRoMKdozj2XBrUA6Kv7hRB6EyV_c5fw3LO19ES3x6FbZZmRHveUDAOXdqDe_19sSgTbxquWbG8UiPv9zgoaOTHFyyMBphpdMGqxFWrDPMoIagwn7cnqr8GP-xmMUJ5rmnNi_d3BGPkq7?key=m8YR0fJfYUv0T6D1FD0-lA\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Code Explanation:<\/strong><\/p>\n\n\n\n<p>By calculating the mean of the EPS and revenue columns, we obtain the average EPS and average revenue for the analyzed period. This gives us a snapshot of Apple\u2019s overall financial performance across multiple earnings reports.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>In this article, we demonstrated how to use <a href=\"https:\/\/docs.benzinga.com\/benzinga-apis\/calendar\/get-earnings\">Benzinga\u2019s Earnings API<\/a> to extract and analyze historical earnings data for Apple Inc. Using <a href=\"https:\/\/benzinga.mintlify.app\/python-client\">Benzinga&#8217;s Python SDK<\/a>, we fetched detailed earnings data and performed further analysis, including calculating revenue growth, visualizing EPS surprises, and computing average EPS and revenue.<\/p>\n\n\n\n<p>Benzinga\u2019s API service, combined with its Python SDK, makes it easy for investors and analysts to access and analyze financial data. Whether you\u2019re looking to track earnings trends, analyze performance, or develop trading strategies, Benzinga&#8217;s Earnings API provides the tools you need for insightful analysis.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, we will focus on retrieving Apple Inc.&#8217;s (AAPL) historical earnings data and conducting further analysis using Benzinga\u2019s Earnings API. <\/p>\n","protected":false},"author":77,"featured_media":7396,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[146,147,137],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Benzinga Earnings API: Extracting and Analyzing Historical Earnings Data in Python - Benzinga API\u2019s<\/title>\n<meta name=\"description\" content=\"In this guide, we will focus on retrieving Apple Inc.&#039;s historical earnings data and conducting further analysis using Benzinga\u2019s Earnings API.\" \/>\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.benzinga.com\/apis\/blog\/benzinga-earnings-api-tutorial\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Benzinga Earnings API: Extracting and Analyzing Historical Earnings Data in Python - Benzinga API\u2019s\" \/>\n<meta property=\"og:description\" content=\"In this guide, we will focus on retrieving Apple Inc.&#039;s historical earnings data and conducting further analysis using Benzinga\u2019s Earnings API.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.benzinga.com\/apis\/blog\/benzinga-earnings-api-tutorial\/\" \/>\n<meta property=\"og:site_name\" content=\"Benzinga API\u2019s\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Benzinga\" \/>\n<meta property=\"article:published_time\" content=\"2024-09-16T18:26:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-08T18:34:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.benzinga.com\/apis\/wp-content\/uploads\/2024\/09\/AAPL.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1005\" \/>\n\t<meta property=\"og:image:height\" content=\"618\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Tommy Cotter\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Benzinga\" \/>\n<meta name=\"twitter:site\" content=\"@Benzinga\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tommy Cotter\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.benzinga.com\/apis\/blog\/benzinga-earnings-api-tutorial\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.benzinga.com\/apis\/blog\/benzinga-earnings-api-tutorial\/\"},\"author\":{\"name\":\"Tommy Cotter\",\"@id\":\"https:\/\/www.benzinga.com\/apis\/#\/schema\/person\/0f1603d4e33f044ab59c4a9faf26f2a3\"},\"headline\":\"Benzinga Earnings API: Extracting and Analyzing Historical Earnings Data in Python\",\"datePublished\":\"2024-09-16T18:26:26+00:00\",\"dateModified\":\"2024-10-08T18:34:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.benzinga.com\/apis\/blog\/benzinga-earnings-api-tutorial\/\"},\"wordCount\":873,\"publisher\":{\"@id\":\"https:\/\/www.benzinga.com\/apis\/#organization\"},\"keywords\":[\"Earnings\",\"How-To\",\"Python\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.benzinga.com\/apis\/blog\/benzinga-earnings-api-tutorial\/\",\"url\":\"https:\/\/www.benzinga.com\/apis\/blog\/benzinga-earnings-api-tutorial\/\",\"name\":\"Benzinga Earnings API: Extracting and Analyzing Historical Earnings Data in Python - Benzinga API\u2019s\",\"isPartOf\":{\"@id\":\"https:\/\/www.benzinga.com\/apis\/#website\"},\"datePublished\":\"2024-09-16T18:26:26+00:00\",\"dateModified\":\"2024-10-08T18:34:34+00:00\",\"description\":\"In this guide, we will focus on retrieving Apple Inc.'s historical earnings data and conducting further analysis using Benzinga\u2019s Earnings API.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.benzinga.com\/apis\/blog\/benzinga-earnings-api-tutorial\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.benzinga.com\/apis\/blog\/benzinga-earnings-api-tutorial\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.benzinga.com\/apis\/blog\/benzinga-earnings-api-tutorial\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.benzinga.com\/apis\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Benzinga Earnings API: Extracting and Analyzing Historical Earnings Data in Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.benzinga.com\/apis\/#website\",\"url\":\"https:\/\/www.benzinga.com\/apis\/\",\"name\":\"Benzinga API\u2019s\",\"description\":\"Accurate &amp; Lightning Fast - Cloud Based Financial Market Data &amp; APIs\",\"publisher\":{\"@id\":\"https:\/\/www.benzinga.com\/apis\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.benzinga.com\/apis\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.benzinga.com\/apis\/#organization\",\"name\":\"Benzinga\",\"url\":\"https:\/\/www.benzinga.com\/apis\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.benzinga.com\/apis\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/s3.amazonaws.com\/wp-uploads.benzinga-events.prod\/apis\/wp-content\/uploads\/2022\/07\/05134917\/schema-image-default.jpg\",\"contentUrl\":\"https:\/\/s3.amazonaws.com\/wp-uploads.benzinga-events.prod\/apis\/wp-content\/uploads\/2022\/07\/05134917\/schema-image-default.jpg\",\"width\":1043,\"height\":1043,\"caption\":\"Benzinga\"},\"image\":{\"@id\":\"https:\/\/www.benzinga.com\/apis\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/Benzinga\",\"https:\/\/twitter.com\/Benzinga\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.benzinga.com\/apis\/#\/schema\/person\/0f1603d4e33f044ab59c4a9faf26f2a3\",\"name\":\"Tommy Cotter\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.benzinga.com\/apis\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/67cc88628b8c592df6e75a706d5c0cdf?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/67cc88628b8c592df6e75a706d5c0cdf?s=96&d=mm&r=g\",\"caption\":\"Tommy Cotter\"},\"url\":\"https:\/\/www.benzinga.com\/apis\/author\/thomascotterbenzinga-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Benzinga Earnings API: Extracting and Analyzing Historical Earnings Data in Python - Benzinga API\u2019s","description":"In this guide, we will focus on retrieving Apple Inc.'s historical earnings data and conducting further analysis using Benzinga\u2019s Earnings API.","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.benzinga.com\/apis\/blog\/benzinga-earnings-api-tutorial\/","og_locale":"en_US","og_type":"article","og_title":"Benzinga Earnings API: Extracting and Analyzing Historical Earnings Data in Python - Benzinga API\u2019s","og_description":"In this guide, we will focus on retrieving Apple Inc.'s historical earnings data and conducting further analysis using Benzinga\u2019s Earnings API.","og_url":"https:\/\/www.benzinga.com\/apis\/blog\/benzinga-earnings-api-tutorial\/","og_site_name":"Benzinga API\u2019s","article_publisher":"https:\/\/www.facebook.com\/Benzinga","article_published_time":"2024-09-16T18:26:26+00:00","article_modified_time":"2024-10-08T18:34:34+00:00","og_image":[{"width":1005,"height":618,"url":"https:\/\/www.benzinga.com\/apis\/wp-content\/uploads\/2024\/09\/AAPL.png","type":"image\/png"}],"author":"Tommy Cotter","twitter_card":"summary_large_image","twitter_creator":"@Benzinga","twitter_site":"@Benzinga","twitter_misc":{"Written by":"Tommy Cotter","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.benzinga.com\/apis\/blog\/benzinga-earnings-api-tutorial\/#article","isPartOf":{"@id":"https:\/\/www.benzinga.com\/apis\/blog\/benzinga-earnings-api-tutorial\/"},"author":{"name":"Tommy Cotter","@id":"https:\/\/www.benzinga.com\/apis\/#\/schema\/person\/0f1603d4e33f044ab59c4a9faf26f2a3"},"headline":"Benzinga Earnings API: Extracting and Analyzing Historical Earnings Data in Python","datePublished":"2024-09-16T18:26:26+00:00","dateModified":"2024-10-08T18:34:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.benzinga.com\/apis\/blog\/benzinga-earnings-api-tutorial\/"},"wordCount":873,"publisher":{"@id":"https:\/\/www.benzinga.com\/apis\/#organization"},"keywords":["Earnings","How-To","Python"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.benzinga.com\/apis\/blog\/benzinga-earnings-api-tutorial\/","url":"https:\/\/www.benzinga.com\/apis\/blog\/benzinga-earnings-api-tutorial\/","name":"Benzinga Earnings API: Extracting and Analyzing Historical Earnings Data in Python - Benzinga API\u2019s","isPartOf":{"@id":"https:\/\/www.benzinga.com\/apis\/#website"},"datePublished":"2024-09-16T18:26:26+00:00","dateModified":"2024-10-08T18:34:34+00:00","description":"In this guide, we will focus on retrieving Apple Inc.'s historical earnings data and conducting further analysis using Benzinga\u2019s Earnings API.","breadcrumb":{"@id":"https:\/\/www.benzinga.com\/apis\/blog\/benzinga-earnings-api-tutorial\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.benzinga.com\/apis\/blog\/benzinga-earnings-api-tutorial\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.benzinga.com\/apis\/blog\/benzinga-earnings-api-tutorial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.benzinga.com\/apis\/"},{"@type":"ListItem","position":2,"name":"Benzinga Earnings API: Extracting and Analyzing Historical Earnings Data in Python"}]},{"@type":"WebSite","@id":"https:\/\/www.benzinga.com\/apis\/#website","url":"https:\/\/www.benzinga.com\/apis\/","name":"Benzinga API\u2019s","description":"Accurate &amp; Lightning Fast - Cloud Based Financial Market Data &amp; APIs","publisher":{"@id":"https:\/\/www.benzinga.com\/apis\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.benzinga.com\/apis\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.benzinga.com\/apis\/#organization","name":"Benzinga","url":"https:\/\/www.benzinga.com\/apis\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.benzinga.com\/apis\/#\/schema\/logo\/image\/","url":"https:\/\/s3.amazonaws.com\/wp-uploads.benzinga-events.prod\/apis\/wp-content\/uploads\/2022\/07\/05134917\/schema-image-default.jpg","contentUrl":"https:\/\/s3.amazonaws.com\/wp-uploads.benzinga-events.prod\/apis\/wp-content\/uploads\/2022\/07\/05134917\/schema-image-default.jpg","width":1043,"height":1043,"caption":"Benzinga"},"image":{"@id":"https:\/\/www.benzinga.com\/apis\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Benzinga","https:\/\/twitter.com\/Benzinga"]},{"@type":"Person","@id":"https:\/\/www.benzinga.com\/apis\/#\/schema\/person\/0f1603d4e33f044ab59c4a9faf26f2a3","name":"Tommy Cotter","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.benzinga.com\/apis\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/67cc88628b8c592df6e75a706d5c0cdf?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/67cc88628b8c592df6e75a706d5c0cdf?s=96&d=mm&r=g","caption":"Tommy Cotter"},"url":"https:\/\/www.benzinga.com\/apis\/author\/thomascotterbenzinga-com\/"}]}},"_links":{"self":[{"href":"https:\/\/www.benzinga.com\/apis\/wp-json\/wp\/v2\/posts\/7394"}],"collection":[{"href":"https:\/\/www.benzinga.com\/apis\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.benzinga.com\/apis\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.benzinga.com\/apis\/wp-json\/wp\/v2\/users\/77"}],"replies":[{"embeddable":true,"href":"https:\/\/www.benzinga.com\/apis\/wp-json\/wp\/v2\/comments?post=7394"}],"version-history":[{"count":4,"href":"https:\/\/www.benzinga.com\/apis\/wp-json\/wp\/v2\/posts\/7394\/revisions"}],"predecessor-version":[{"id":7437,"href":"https:\/\/www.benzinga.com\/apis\/wp-json\/wp\/v2\/posts\/7394\/revisions\/7437"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.benzinga.com\/apis\/wp-json\/wp\/v2\/media\/7396"}],"wp:attachment":[{"href":"https:\/\/www.benzinga.com\/apis\/wp-json\/wp\/v2\/media?parent=7394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.benzinga.com\/apis\/wp-json\/wp\/v2\/categories?post=7394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.benzinga.com\/apis\/wp-json\/wp\/v2\/tags?post=7394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}