-
Notifications
You must be signed in to change notification settings - Fork 0
End‐of‐Day (EOD) Data
Igor Sazonov edited this page Feb 4, 2026
·
1 revision
The End-of-Day (EOD) endpoint is one of the most common and useful features of the Marketstack API. It provides historical stock data, including open, high, low, and close (OHLC) prices, as well as volume information.
You can retrieve EOD data using the eod() method on the Marketstack facade. The following examples demonstrate how to use the available methods to filter and retrieve the data you need.
To get historical data for a specific period, use the dateFrom() and dateTo() methods:
use Tigusigalpa\Marketstack\Facades\Marketstack;
$eodData = Marketstack::eod()
->symbols('AAPL')
->dateFrom('2023-01-01')
->dateTo('2023-12-31')
->exchange('XNAS')
->limit(100)
->offset(0)
->collect();To get the most recent EOD data for a symbol, use the latest() method:
$latest = Marketstack::eod()
->latest('AAPL')
->dto();
echo "Latest close: {$latest->close}";If you need data for a single day, use the date() method:
$specificDate = Marketstack::eod()
->date('2023-06-15')
->symbols('AAPL', 'GOOG')
->collect();The following methods are available for the EOD endpoint:
| Method | Description |
|---|---|
symbols(string ...$symbols) |
A list of stock symbols to retrieve data for. |
dateFrom(string $date) |
The start date for the data range (YYYY-MM-DD). |
dateTo(string $date) |
The end date for the data range (YYYY-MM-DD). |
date(string $date) |
The specific date to retrieve data for (YYYY-MM-DD). |
latest(string $symbol) |
Get the latest EOD data for a single symbol. |
exchange(string $exchange) |
Filter by the MIC code of the stock exchange. |
limit(int $limit) |
The number of results to return. |
offset(int $offset) |
The pagination offset. |
sort(string $order) |
The sort order (ASC or DESC). |
For more information on response formats, see the Response Formats page.