-
Notifications
You must be signed in to change notification settings - Fork 0
Tickers
The Tickers endpoint allows you to search for and retrieve information about stock tickers. You can search for tickers by name, filter them by exchange, or retrieve details for a specific ticker.
Use the tickers() method on the Marketstack facade to access the Tickers endpoint.
To retrieve a list of all available tickers, you can make a simple call. It is recommended to use limit() to paginate the results.
use Tigusigalpa\Marketstack\Facades\Marketstack;
$tickers = Marketstack::tickers()
->limit(100)
->collect();You can search for tickers by a keyword using the search() method:
$searchResults = Marketstack::tickers()
->search("Apple")
->collect();To get all tickers for a particular exchange, use the exchange() method with the exchange's MIC code:
$nasdaqTickers = Marketstack::tickers()
->exchange("XNAS")
->limit(50)
->collect();To retrieve information for a single ticker, use the ticker() method:
$ticker = Marketstack::tickers()
->ticker("AAPL")
->dto();
echo "Name: {$ticker->name}\n";
echo "Has Intraday: " . ($ticker->has_intraday ? 'Yes' : 'No');The following methods are available for the Tickers endpoint:
| Method | Description |
|---|---|
search(string $search) |
Search for tickers by a keyword. |
exchange(string $exchange) |
Filter tickers by the stock exchange's MIC code. |
ticker(string $symbol) |
Get information for a specific ticker symbol. |
limit(int $limit) |
The number of results to return. |
offset(int $offset) |
The pagination offset. |
For more information on response formats, see the Response Formats page.