Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to get company earning announcements data api?

I want to get real-time earning annoouncements data api.
I tried yfinance but it doesn’t work currently.

So is there any other replacement api?
Most of API need to pay money, But I just want to try for my personal projects so it’s little pressured

Does Yahoo Finance no longer offer api? I heard that yfinance is not yahoo finance api.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I tried yfinance, yahooquery, other API’s

I want real-time earning announcements data api

>Solution :

Alphavantage: https://www.alphavantage.co/#page-top

Alphavantage has an awesome API with finance information and best part is it is completely free to get an API key.

import requests

api_key = ''#your api key

symbol = 'AAPL'# symbol of stock/company

url = f'https://www.alphavantage.co/query?function=EARNINGS&symbol={symbol}&apikey={api_key}'

response = requests.get(url)

if response.status_code == 200:
    data = response.json()

    earnings_announcements = data['quarterlyEarnings']

    for announcement in earnings_announcements:
        report_date = announcement['reportedDate']
        eps_estimate = announcement['estimatedEPS']
        eps_actual = announcement['reportedEPS']
        fiscal_period = announcement['fiscalDateEnding']

        print(f"Report Date: {report_date}")
        print(f"EPS Estimate: {eps_estimate}")
        print(f"EPS Actual: {eps_actual}")
        print(f"Fiscal Period: {fiscal_period}")
        print()
else:
    print("Error occurred while fetching earnings announcements.")
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading