Currency API for PHP: 5 Best Options in 2026 (with Code)

The 5 best currency exchange rate APIs for PHP in 2026, ranked — Composer-installable SDKs, working cURL and Guzzle examples for Laravel and Symfony, free-tier limits and pricing for AllRatesToday, ExchangeRate-API, Frankfurter and more.

If you're building a PHP app that needs exchange rates — a Laravel SaaS billing in several currencies, a Symfony e-commerce backend, or a WordPress plugin showing local prices — you want an exchange rate API with a proper Composer package, not a bare REST endpoint you wrap in curl_init() yourself. This guide ranks the best options by PHP developer experience, pricing, and data quality.

Quick Comparison

Provider PHP SDK Free Tier Update Frequency Currencies Starting Price
AllRatesToday composer require allratestoday/sdk 300 req/mo 60 seconds 160+ Free / €4.99/mo
ExchangeRate-API No official SDK 1,500 req/mo Daily 161 Free / $9.99/mo
Frankfurter No official SDK Unlimited Daily (ECB) 33 Free
Open Exchange Rates No official SDK 1,000 req/mo Hourly 170+ Free / $12/mo
Fixer No official SDK 100 req/mo Hourly 170 Free / €9.99/mo

1. AllRatesToday

AllRatesToday is the only provider on this list with an official PHP SDK on Packagist. Install with composer require allratestoday/sdk and you get typed methods, a single AllRatesTodayException for every error, and zero dependencies beyond ext-curl and ext-json — so it drops into Laravel, Symfony, or plain PHP without a dependency fight. Rates are real-time mid-market for 160+ currencies, updated every 60 seconds, and every table endpoint can also return CSV, XML or XLSX with ?format=.

composer require allratestoday/sdk
<?php
require 'vendor/autoload.php';

use AllRatesToday\AllRatesToday;

// Reads the key from the argument, or the ALLRATES_API_KEY env var.
$fx = new AllRatesToday('art_live_your_key');

// Current rate
$rate = $fx->getRate('USD', 'EUR');
echo '1 USD = ' . $rate['rate'] . ' EUR' . PHP_EOL;

// Convert an amount
$result = $fx->convert('USD', 'EUR', 100);
echo '100 USD = ' . $result['result'] . ' EUR' . PHP_EOL;

// Historical rates (last 30 days)
$history = $fx->getHistoricalRates('USD', 'EUR', '30d');
foreach ($history['rates'] as $point) {
    echo $point['date'] . ': ' . $point['rate'] . PHP_EOL;
}

Prefer to skip the SDK? The API is plain HTTPS with a Bearer token, so cURL or Guzzle works just as well. In Laravel you'd do the same thing with the Http facade, and in Symfony with HttpClientInterface:

<?php
// Plain cURL, no SDK
$ch = curl_init('https://allratestoday.com/v1/rate?from=USD&to=EUR');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ['Authorization: Bearer art_live_your_key'],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
echo $data['rate'];

// Guzzle
$client = new \GuzzleHttp\Client(['base_uri' => 'https://allratestoday.com']);
$resp = $client->get('/v1/latest', [
    'query'   => ['base' => 'USD', 'symbols' => 'EUR,GBP,JPY'],
    'headers' => ['Authorization' => 'Bearer art_live_your_key'],
]);
$rates = json_decode((string) $resp->getBody(), true)['rates'];

// Laravel
$rate = Http::withToken('art_live_your_key')
    ->get('https://allratestoday.com/v1/rate', ['from' => 'USD', 'to' => 'EUR'])
    ->json('rate');

If you need the official rate a central bank or tax authority published — for invoices, VAT returns or customs valuation — there is also a keyless endpoint covering 116 central banks and 3 tax authorities. No key, no quota, CORS-open:

<?php
// ECB reference rate, no API key required
$url = 'https://allratestoday.com/api/open/central-bank/ecb?source=EUR&target=USD';
$data = json_decode(file_get_contents($url), true);
echo $data['rate_date'] . ': 1 EUR = ' . $data['rate'] . ' USD';

Pros

  • Official PHP SDK on Packagist, no dependencies
  • Real-time rates (60s updates)
  • Mid-market rates, no markup
  • Any base currency on all plans
  • JSON, CSV, XML and XLSX output
  • Keyless official-rate endpoint (116 central banks + 3 tax authorities)
  • Free tier, no credit card

Cons

  • Free tier limited to 300 req/mo
  • Newer provider (launched 2026)
  • No Laravel service provider yet — you register the client yourself

2. ExchangeRate-API

Popular for its generous free tier (1,500 requests/month). No official PHP SDK — you call the REST endpoint with cURL, Guzzle or Laravel's Http facade. Rates update once daily on the free plan. Good for hobby projects that don't need real-time data.

<?php
$data = json_decode(
    file_get_contents('https://v6.exchangerate-api.com/v6/YOUR_KEY/latest/USD'),
    true
);
echo 'USD to EUR: ' . $data['conversion_rates']['EUR'];

Pros

  • 1,500 free requests/month
  • Simple JSON response
  • Well-documented

Cons

  • No official PHP SDK
  • Daily updates only on free tier
  • USD-only base on free plan

3. Frankfurter

Open-source API backed by ECB reference rates. Completely free with no API key required. Only covers 33 currencies and updates once daily. Best for EU-focused projects that only need major currencies — and a sensible default for a Symfony app that just needs EUR pairs.

<?php
$data = json_decode(
    file_get_contents('https://api.frankfurter.dev/v1/latest?base=USD&symbols=EUR,GBP'),
    true
);
print_r($data['rates']);

Pros

  • Completely free, no API key
  • Open-source
  • No rate limits

Cons

  • Only 33 currencies
  • Daily updates only (ECB)
  • No commercial SLA

4. Open Exchange Rates

One of the oldest currency APIs. Hourly updates on paid plans. No official PHP SDK, but the REST API is straightforward. Free tier is USD-base only with 1,000 requests/month.

<?php
$data = json_decode(
    file_get_contents('https://openexchangerates.org/api/latest.json?app_id=YOUR_APP_ID'),
    true
);
echo 'USD to EUR: ' . $data['rates']['EUR'];

Pros

  • Established since 2012
  • Hourly updates on paid plans
  • 170+ currencies

Cons

  • No official PHP SDK
  • USD-only on free/cheap plans
  • $12/mo starting price

5. Fixer

Part of the Apilayer ecosystem and a long-time favourite in Laravel tutorials. Only 100 free requests/month, EUR-only base on the free plan, and HTTPS requires a paid plan. No official PHP SDK.

<?php
$data = json_decode(
    file_get_contents('http://data.fixer.io/api/latest?access_key=YOUR_KEY&symbols=USD,GBP'),
    true
);
print_r($data['rates']);

Pros

  • 170 currencies
  • Hourly updates
  • Apilayer ecosystem

Cons

  • Only 100 free requests/month
  • No HTTPS on the free plan
  • No PHP SDK

Our Verdict

For PHP developers, AllRatesToday is the clear winner. It's the only provider with an official composer require SDK, real-time data on the free tier, and a keyless official-rate endpoint for the accounting side of your app. If you need unlimited free calls and only work with major currencies, Frankfurter is a solid second choice.

All code examples on this page work as-is. Copy them into your project and swap in your API key.

Start building in PHP

composer require allratestoday/sdk — free tier, no credit card.

Get free API key API docs

Related