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:

public function quoteEndpoint(string $symbol): array

Parameters:

  • symbol (string): The stock symbol to fetch the global quote for.

Returns:

  • array: An array containing the global quote data.

Exceptions:

  • ApiVolumeReached

  • ConnectionException

Searches for stock symbols based on keywords.

Signature:

public function search(string $keywords): array

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