---
title: "Currency API for PHP: 5 Best Options in 2026 (with Code)"
description: "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."
canonical: https://allratestoday.com/best/best-currency-api-for-php/
source: AllRatesToday (https://allratestoday.com/) — Markdown mirror of the page above; index of all pages at https://allratestoday.com/llms.txt
generated: 2026-10-25T10:04:13.650Z
---

# 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.

By [Madhushan](https://allratestoday.com/authors/madhushan/), Founder & Lead Developer

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](https://allratestoday.com/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` | Free | 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;

// Pass your API key to the constructor.
$fx = new AllRatesToday('art_live_your_key');

// Current rate (an array of rows, one per target)
$rows = $fx->getRates('USD', 'EUR');
echo '1 USD = ' . $rows[0]['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, paid plans)
$history = $fx->getHistoricalRates('USD', 'EUR', '30d');
foreach ($history['rates'] as $point) {
    echo $point['time'] . ': ' . $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/api/v1/rates?source=USD&target=EUR');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ['Authorization: Bearer art_live_your_key'],
]);
$rows = json_decode(curl_exec($ch), true); // array of rows
curl_close($ch);
echo $rows[0]['rate'];

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

// Laravel
$rate = Http::withToken('art_live_your_key')
    ->get('https://allratestoday.com/api/v1/rates', ['source' => 'USD', 'target' => 'EUR'])
    ->json('0.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 [122 central banks and 4 tax authorities](https://allratestoday.com/central-bank-rates-api/institutions/). 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 ([122 central banks + 4 tax authorities](https://allratestoday.com/central-bank-rates-api/institutions/))
- Free tier, no credit card

#### Cons

- Free tier is non-commercial, no historical data
- 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](https://allratestoday.com/register) [API docs](https://allratestoday.com/docs/)

## Related

  [All official SDKsInstall commands and minimum versions](https://allratestoday.com/docs/sdks/) [Exchange rate APIEndpoints, live table, pricing](https://allratestoday.com/exchange-rate-api/) [Best currency API 2026Full buyer's guide](https://allratestoday.com/best/best-currency-api-2026/) [Exchange rate APIEndpoints, formats and pricing](https://allratestoday.com/exchange-rate-api/) [Best currency API for Pythonpip install guide](https://allratestoday.com/best/best-currency-api-for-python/) [Best currency API for JavaScriptNode.js & React](https://allratestoday.com/best/best-currency-api-for-javascript/)
