Search by

Official PHP SDK for AllRatesToday exchange rate API

Package info

github.com/AllRates-Today/exchange-rates-api

Homepage

Language:TypeScript

pkg:composer/allratestoday/sdk

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 6

Open Issues: 6

v1.3.1 2026-04-09 20:01 UTC

This package is auto-updated.

Last update: 2026-09-22 18:07:46 UTC


README

Powered by AllRatesToday

AllRatesToday is a free, fast, and reliable REST API for real-time and historical currency exchange rates. Sourced from institutional interbank market data.

API Status Tests codecov Known Vulnerabilities zero dependencies License TypeScript npm PyPI Packagist

๐Ÿš€ Features

  • โšก Real-time rates โ€” Live mid-market exchange rates updated on every request
  • ๐ŸŒ 160+ currencies โ€” Major, emerging market, and popular currencies
  • ๐Ÿ“… Historical data โ€” Access historical rates with flexible date ranges (1d/7d/30d/1y)
  • ๐Ÿ“ฆ Official SDKs โ€” JavaScript/TypeScript, Python, PHP, and React
  • ๐Ÿ†“ Free tier โ€” Get started at no cost
  • ๐Ÿ›ก๏ธ Fast & reliable โ€” Powered by Cloudflare's global edge network
  • ๐Ÿ“ก Data source โ€” institutional interbank market data

๐Ÿ“ฆ Official SDKs

JavaScript / TypeScript

npm install @allratestoday/sdk
import AllRatesToday from '@allratestoday/sdk';

const client = new AllRatesToday();
const rate = await client.getRate('USD', 'EUR');
console.log(`1 USD = ${rate.rate} EUR`);

// Convert amount
const result = await client.convert('USD', 'EUR', 100);
console.log(`$100 = โ‚ฌ${result.result}`);

// With API key for higher limits & historical data
const auth = new AllRatesToday({ apiKey: 'art_live_...' });
const history = await auth.getHistoricalRates('USD', 'EUR', '30d');

Python

pip install allratestoday
from allratestoday import AllRatesToday

client = AllRatesToday()
rate = client.get_rate("USD", "EUR")
print(f"1 USD = {rate['rate']} EUR")

# Convert amount
result = client.convert("USD", "EUR", 100)
print(f"$100 = โ‚ฌ{result['result']}")

# With API key for higher limits & historical data
auth = AllRatesToday(api_key="art_live_...")
history = auth.get_historical_rates("USD", "EUR", "30d")

PHP

composer require allratestoday/sdk
use AllRatesToday\AllRatesToday;

$client = new AllRatesToday();
$rate = $client->getRate('USD', 'EUR');
echo "1 USD = {$rate['rate']} EUR";

// Convert amount
$result = $client->convert('USD', 'EUR', 100);
echo "$100 = โ‚ฌ{$result['result']}";

// With API key for higher limits & historical data
$auth = new AllRatesToday('art_live_...');
$history = $auth->getHistoricalRates('USD', 'EUR', '30d');

React

npm install react-currency-localizer-realtime
import { LocalizedPrice } from 'react-currency-localizer-realtime';

// Automatically detects the visitor's currency. No API key needed:
// keyless mode uses free daily ECB rates (~30 currencies) and renders a
// "Rates by AllRatesToday" link. Pass apiKey for real-time + 160 currencies.
function PricingCard() {
  return (
    <div>
      <h3>Pro Plan</h3>
      <LocalizedPrice basePrice={19.99} baseCurrency="USD" />
    </div>
  );
}
import { useCurrencyConverter } from 'react-currency-localizer-realtime';

// Hook-based API for full control
function ProductPrice({ price }: { price: number }) {
  const { convertedPrice, localCurrency, isLoading } = useCurrencyConverter({
    basePrice: price,
    baseCurrency: 'USD',
    apiKey: 'art_live_...',
  });

  if (isLoading) return <span>Loading...</span>;

  return (
    <span>
      {new Intl.NumberFormat(undefined, {
        style: 'currency',
        currency: localCurrency || 'USD',
      }).format(convertedPrice || price)}
    </span>
  );
}
import { useCurrencyLocalizer } from 'react-currency-localizer-realtime';

// Batch conversion for product lists
function ProductList({ products }) {
  const { convertAndFormat, isReady } = useCurrencyLocalizer({
    baseCurrency: 'USD',
    apiKey: 'art_live_...',
  });

  return (
    <ul>
      {products.map(p => (
        <li key={p.id}>{p.name}: {isReady ? convertAndFormat(p.price) : '...'}</li>
      ))}
    </ul>
  );
}

๐Ÿ Quick Start (No SDK)

curl "https://allratestoday.com/api/v1/rates?source=USD&target=EUR" \
  -H "Authorization: Bearer YOUR_API_KEY"

Get your free API key at allratestoday.com/register.

๐Ÿ“š API Endpoints

Method Endpoint Auth Description
GET /api/v1/rates Yes Exchange rates (supports comma-separated targets)
GET /api/v1/symbols No List all supported currencies
GET /api/rate Yes Simple pair rate lookup
GET /api/historical-rates Yes Historical rate data & time series

๐ŸŒ Supported Currencies

160+ currencies including:

Major: USD, EUR, GBP, JPY, CHF, CAD, AUD, NZD

Popular: INR, CNY, BRL, MXN, TRY, ZAR, SGD, HKD, KRW, THB, PHP, PKR, BDT, LKR, NGN, GHS, KES, AED, SAR, EGP, and more

๐Ÿ›ก๏ธ Error Handling

Code Description
400 Bad request โ€” missing or invalid parameters
401 Missing or invalid API key
429 Rate limit or monthly quota exceeded
500 Internal server error
503 Service temporarily unavailable

๐Ÿ“„ API Specifications

For the complete technical reference, download the AllRatesToday Currency Data API Specifications document:

  • Download PDF โ€” Full 20-page API specification (endpoints, parameters, responses, error codes, SDKs)
  • View Online โ€” Browse the specification on our website

๐Ÿ”— Links

๐Ÿ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.