-
Notifications
You must be signed in to change notification settings - Fork 0
Currencies
Igor Sazonov edited this page Feb 4, 2026
·
1 revision
The Currencies endpoint provides information about the currencies supported by the Marketstack API. You can retrieve a list of all currencies or get details for a specific currency by its code.
Use the currencies() method on the Marketstack facade to access the Currencies endpoint.
To get a list of all supported currencies, you can make a simple call. Use limit() and offset() to paginate through the results.
use Tigusigalpa\Marketstack\Facades\Marketstack;
// Get all currencies
$currencies = Marketstack::currencies()
->limit(50)
->collect();
// Paginate through currencies
$page1 = Marketstack::currencies()
->limit(20)
->offset(0)
->collect();
$page2 = Marketstack::currencies()
->limit(20)
->offset(20)
->collect();To retrieve details for a specific currency, use the code() method with the currency code:
$currency = Marketstack::currencies()
->code("USD")
->dto();
echo "Name: {$currency->name}\n";
echo "Symbol: {$currency->symbol}";The following methods are available for the Currencies endpoint:
| Method | Description |
|---|---|
code(string $code) |
Get information for a specific currency by its code. |
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.