PHPackages                             fastforex/fastforex-php-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. fastforex/fastforex-php-client

ActiveLibrary[API Development](/categories/api)

fastforex/fastforex-php-client
==============================

PHP client for fastFOREX.io Currency Exchange Rate API

v2.0.0(3mo ago)16.4k↑128.6%MITPHPPHP &gt;=7.4CI passing

Since Feb 15Pushed 3mo agoCompare

[ Source](https://github.com/fastforex/fastforex-php-client)[ Packagist](https://packagist.org/packages/fastforex/fastforex-php-client)[ Docs](https://www.fastforex.io)[ RSS](/packages/fastforex-fastforex-php-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (7)Used By (0)

fastFOREX Currency Exchange Rate API Client for PHP
===================================================

[](#fastforex-currency-exchange-rate-api-client-for-php)

[![Tests](https://github.com/fastforex/fastforex-php-client/actions/workflows/tests.yaml/badge.svg)](https://github.com/fastforex/fastforex-php-client/actions/workflows/tests.yaml/badge.svg)[![Version](https://camo.githubusercontent.com/166f7e4a5c22be1845d6ae170a6a8a74a8153dd3db6190d2dbff435d72364c74/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66617374666f7265782f66617374666f7265782d7068702d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fastforex/fastforex-php-client)

You'll need an API key to use the API client. [Get a Free Trial API Key](https://console.fastforex.io).

- 160+ Currencies
- 500+ Crypto Currencies
- 2,300+ FX trading pairs
- Up 55 years of historical data

Installation
------------

[](#installation)

With [Composer](https://getcomposer.org):

```
composer require fastforex/fastforex-php-client
```

Quick Start
-----------

[](#quick-start)

Set the API key once in your bootstrap code, or in the constructor:

```
\FastForex\Client::setApiKey('YOUR_API_KEY');
```

```
new \FastForex\Client('YOUR_API_KEY');
```

Fetch all currencies, with `USD` base:

```
$response = (new FastForex\Client())->fetchAll('USD');
print_r($response);
```

```
stdClass Object
(
    [base] => USD
    [results] => stdClass Object
        (
            [AED] => 3.67246
            [AFN] => 77.19882
            [ALL] => 101.68772
            ...
        )

    [updated] => 2021-02-15 22:13:51
    [ms] => 5
)

```

More Examples
-------------

[](#more-examples)

Fetch `GBP`, with `USD` base:

```
$response = (new FastForex\Client())->fetchOne('USD', 'GBP');
echo $response->result->GBP;
```

Fetch several currencies with `USD` base:

```
$response = (new FastForex\Client())->fetchMulti('USD', ['GBP', 'EUR', 'CHF']);
```

Convert 200 `USD` to `GBP`:

```
$response = (new FastForex\Client())->convert('USD', 'GBP', 199.99);
```

Fetch a list of supported currencies

```
$response = (new FastForex\Client())->currencies();
```

Fetch recent API usage

```
$response = (new FastForex\Client())->usage();
```

Get all the historical exchange rates for 1st April 2021, with `USD` base:

```
$response = (new FastForex\Client())->historical(new \DateTime('2021-04-01'), 'USD');
```

Get a subset of historical exchange rates for 1st April 2021, with `USD` base:

```
$response = (new FastForex\Client())->historical(new \DateTime('2021-04-01'), 'USD', ['EUR', 'GBP', 'CHF']);
```

Get a 7-day time-series dataset for `EUR` to `CHF`

```
$response = (new FastForex\Client())->timeSeries(
        new \DateTime('2021-04-01'),
        new \DateTime('2021-04-07'),
        'EUR',
        'CHF'
    );
```

Error Handling
--------------

[](#error-handling)

We throw the following Exceptions:

### `\InvalidArgumentException`

[](#invalidargumentexception)

Usually when input parameters to the client are wrong

### `\FastForex\Exception\APIException`

[](#fastforexexceptionapiexception)

When there is problem making the API call, or when there is an error response from the server.

We include the HTTP response code and error message wherever possible:

```
try {
    $response = (new FastForex\Client('INVALID_API_KEY'))->fetchAll('USD');
} catch (\FastForex\Exception\APIException $exception) {
    echo $exception->getMessage(), PHP_EOL;
}
```

Free Trial
----------

[](#free-trial)

Our 7-day free trial API keys are unrestricted. All features and full API quota.

API Documentation
-----------------

[](#api-documentation)

This client implements our OpenAPI spec. Interactive documentation available:

- **ReadMe** -

### OpenAPI Spec

[](#openapi-spec)

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance78

Regular maintenance activity

Popularity26

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~450 days

Total

5

Last Release

115d ago

Major Versions

v1.3.0 → v2.0.02026-01-24

PHP version history (2 changes)v1.0.0PHP &gt;=5.6.0

v2.0.0PHP &gt;=7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/79095356?v=4)[Tom](/maintainers/wham-tom)[@wham-tom](https://github.com/wham-tom)

---

Top Contributors

[![wham-tom](https://avatars.githubusercontent.com/u/79095356?v=4)](https://github.com/wham-tom "wham-tom (11 commits)")[![tomwalder](https://avatars.githubusercontent.com/u/1258131?v=4)](https://github.com/tomwalder "tomwalder (3 commits)")

---

Tags

currenciescurrencycurrency-convertercurrency-exchangecurrency-exchange-ratesexchange-ratesphpphp-client

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/fastforex-fastforex-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/fastforex-fastforex-php-client/health.svg)](https://phpackages.com/packages/fastforex-fastforex-php-client)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
