Fundamental
The Fundamentals class provides methods to interact with various endpoints of the Alphavantage API related to fundamental financial data. Each method fetches specific financial information about a given symbol or other relevant parameters.
Methods
1. Overview
Fetches the company overview for a given symbol.
Signature:
public function overview(string $symbol): arrayParameters:
symbol(string): The stock symbol to fetch the overview for.
Returns:
array: An array containing the company overview data.
Exceptions:
ApiVolumeReachedConnectionException
2. Income Statement
Fetches the income statement for a given symbol.
Signature:
public function incomeState(string $symbol): arrayParameters:
symbol(string): The stock symbol to fetch the income statement for.
Returns:
array: An array containing the income statement data.
Exceptions:
ApiVolumeReachedConnectionException
3. Balance Sheet
Fetches the balance sheet for a given symbol.
Signature:
public function balanceSheet(string $symbol): arrayParameters:
symbol(string): The stock symbol to fetch the balance sheet for.
Returns:
array: An array containing the balance sheet data.
Exceptions:
ApiVolumeReachedConnectionException
4. Cash Flow
Fetches the cash flow statement for a given symbol.
Signature:
public function cashFlow(string $symbol): arrayParameters:
symbol(string): The stock symbol to fetch the cash flow statement for.
Returns:
array: An array containing the cash flow data.
Exceptions:
ApiVolumeReachedConnectionException
5. Earnings
Fetches the earnings report for a given symbol.
Signature:
public function earnings(string $symbol): arrayParameters:
symbol(string): The stock symbol to fetch the earnings report for.
Returns:
array: An array containing the earnings data.
Exceptions:
ApiVolumeReachedConnectionException
6. Listing Status
Fetches the listing status of companies, either active or delisted, optionally filtered by date.
Signature:
public function listingStatus(?Carbon $date = null, string $state = 'active'): arrayParameters:
date(Carbon|null): Optional date to filter the listing status.state(string): The listing state, either 'active' or 'delisted'.
Returns:
array: An array containing the listing status data.
Exceptions:
ApiVolumeReachedConnectionExceptionInvalidArgumentException: Thrown if the state is not 'active' or 'delisted'.
7. Earnings Calendar
Fetches the earnings calendar for a given symbol over a specified number of months.
Signature:
public function earningsCalendar(?string $symbol, int $months = 3): arrayParameters:
symbol(string|null): The stock symbol to fetch the earnings calendar for.months(int): The number of months to look ahead. Default is 3.
Returns:
array: An array containing the earnings calendar data.
Exceptions:
ApiVolumeReachedConnectionException
8. IPO Calendar
Fetches the IPO calendar data.
Signature:
public function ipoCalendar(): arrayParameters:
None
Returns:
array: An array containing the IPO calendar data.
Exceptions:
ApiVolumeReachedConnectionException
Each method in the Fundamentals class is designed to interact with a specific endpoint of the Alphavantage API, ensuring easy and efficient retrieval of financial data. Be sure to handle the possible exceptions when using these methods to ensure robust error handling in your application.
Last updated
Was this helpful?