EOD Stock API - Financial News API

Our Financial News API - EOD Stock API simplifies the process of accessing financial news. It supports multiple methods of accessing the API to allow for timely news delivery to your customers.

If you're developing a financial news website or portal or conducting research, our API is the ideal choice. To begin using it, follow the instructions below to install requests or your preferred HTTP request library.

Financial news plays a crucial role in the lives of individuals, companies, and the global economy. Investors and traders rely on timely financial news to make informed decisions about buying, selling, or holding their investments.

Financial news also impacts the stock market, currency values, and commodity prices. Thus, financial news APIs have become essential for financial news websites, portals, and businesses.

Using Requests & Other HTTP Libraries to Access Our API

API version: v1

Requirements: Python 3.7+

Installation & Usage

To install on Windows:

pip install requests

To install on Linux:

sudo pip install requests

After installation, import the package:

import requests

Financial News By Date

Retrieving financial news by date: You can use the get_financial_news_by_date() function to retrieve financial news published on a particular date. This feature is useful when you want to retrieve news that is relevant to a specific event or period.

def get_financial_news_by_date(_date: str) -> list[dict[str, str]]:
    """

    : param _date (str): YYYY-MM-DD 
    """

    url = f'https://gateway.eod-stock-api.site/api/v1/news/articles-by-date/{_date}'
      headers = {
          'Content-Type': 'application/json'
      }

    params = {'api_key':'API KEY HERE'}
    response = requests.get(url, headers=headers, params=params)

    if response.headers['Content-Type'] != 'application/json':
        raise Exception

    response_data: dict[str, str | dict] = response.json()

    if not response_data['status']:
        print(response_data['message'])
        raise Exception(response_data['message'])

    return response_data['payload']

Financial News By Ticker Symbol (stock_code)

Retrieving financial news by ticker symbol: You can use the get_financial_news_by_ticker() function to retrieve financial news related to a particular stock code. This feature is useful when you want to retrieve news related to a specific company or industry.

def get_financial_news_by_ticker(stock_code: str) -> list[dict[str, str]]:
    """

    : param stock_code (str): ticker symbol for the company you want to fetch the news for 
    """

    url = f'https://gateway.eod-stock-api.site/api/v1/news/articles-by-ticker/{stock_code}'
      headers = {
          'Content-Type': 'application/json'
      }

    params = {'api_key':'API KEY HERE'}
    response = requests.get(url, headers=headers, params=params)

    if response.headers['Content-Type'] != 'application/json':
        raise Exception

    response_data: dict[str, str | dict] = response.json()

    if not response_data['status']:
        print(response_data['message'])
        raise Exception(response_data['message'])

    return response_data['payload']

Conclusion

In conclusion, our Financial News API - EOD Stock API provides a simple and effective way to access financial news. It offers multiple functionalities and is flexible and customizable to suit your needs. If you're looking for a reliable and secure financial news API, look no further than our EOD Stock API.

Developer Resources | Blog

Developer Guide Articles

Related Articles & Resources