Core
The Core
class provides methods to interact with essential endpoints of the Alphavantage API. It includes methods for fetching global quotes and searching for stock symbols.
Methods
1. Quote Endpoint
Fetches the latest global quote for a given stock symbol.
Signature:
Parameters:
symbol
(string): The stock symbol to fetch the global quote for.
Returns:
array
: An array containing the global quote data.
Exceptions:
ApiVolumeReached
ConnectionException
2. Search
Searches for stock symbols based on keywords.
Signature:
Parameters:
keywords
(string): The keywords to search for stock symbols.
Returns:
array
: An array containing the search results.
Exceptions:
ApiVolumeReached
ConnectionException
The Core
class is designed to provide essential functionalities using the Alphavantage API. The quoteEndpoint
method fetches the latest global quote for a given stock symbol, while the search
method allows for searching stock symbols based on keywords. Be sure to handle the possible exceptions when using these methods to ensure robust error handling in your application.
Last updated