PHPackages                             dandelionmood/openexchangerates - 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. dandelionmood/openexchangerates

AbandonedArchivedLibrary[API Development](/categories/api)

dandelionmood/openexchangerates
===============================

Wrapper for OpenExchangeRates API

v1.1-beta(12y ago)1123.3k↓100%1MITPHPPHP &gt;=5.3.0

Since Mar 24Pushed 12y ago3 watchersCompare

[ Source](https://github.com/dandelionmood/php-openexchangerates)[ Packagist](https://packagist.org/packages/dandelionmood/openexchangerates)[ Docs](https://github.com/dandelionmood/php-openexchangerates)[ RSS](/packages/dandelionmood-openexchangerates/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (3)Used By (0)

OpenExchangeRates API PHP Wrapper
=================================

[](#openexchangerates-api-php-wrapper)

Provides a wrapper for the [OpenExchangeRates API](http://openexchangerates.org).

This JSON API allows you to get rates for various currencies, this projet will give you a simple class to work seamlessly (hopefully ;)) with it.

*Disclaimer* : This tool is not endorsed by OpenExchangeRates, this is a completely independant work.

Get an APP ID
-------------

[](#get-an-app-id)

First of all, you'll need an app id to make it work, you can get one here :

If you want to test it, you can register for a free plan here :

Please note that a free plan will not allow you to work in HTTPS, amongst other things. See at the bottom to know how to use the API in plain HTTP.

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

[](#installation)

You can easily install it through Composer and Packagist, see here for more instructions :

-
-

Get supported currencies
------------------------

[](#get-supported-currencies)

You can see this data here :

```
// You'll need to get an app id.
define('OPENEXCHANGERATE_APP_ID', '123-123-123');

$oer = new OpenExchangeRates( OPENEXCHANGERATE_APP_ID );

// You'll get an object with all supported currencies
$currencies = $oer->currencies();
```

Get latest rates
----------------

[](#get-latest-rates)

See here to see what you'll get :

```
$oer = new OpenExchangeRates( OPENEXCHANGERATE_APP_ID );
$latest_rates = $eor->latest();

// With a paying plan, you can change base currency like this :
$latest_rates_in_euros = $eor->latest(array('base'=>'EUR'));
```

Get historical rates (for paying customers only)
------------------------------------------------

[](#get-historical-rates-for-paying-customers-only)

See here to see what you'll get :

```
$one_month_ago = strftime('%Y-%m-%d', strtotime('- 1 month'));
$rates_last_month = $eor->historical($one_month_ago);

// You can list only certain currencies using additionnal parameters
$rates_last_month = $eor->historical(
	$one_month_ago,
	array('currencies'=>array('EUR','USD'))
);
```

Work in HTTP (for free plan)
----------------------------

[](#work-in-http-for-free-plan)

You can work in HTTP, though this is not the default behaviour (mainly because you should favour HTTPS to be sure there's no «man in the middle» for instance).

```
$oer = new OpenExchangeRates(
	OPENEXCHANGERATE_APP_ID,
	OpenExchangeRates::PROTOCOL_HTTP
);
```

Change HTTP Client
------------------

[](#change-http-client)

The default setting is to use `file_get_contents` to work with the API. As this method is not available everywhere, you have the option to use `curl` instead, here's how :

```
$oer = new OpenExchangeRates(
	OPENEXCHANGERATE_APP_ID,
	OpenExchangeRates::PROTOCOL_HTTP,
	OpenExchangeRates::HTTP_CLIENT_CURL
);
```

###  Health Score

30

—

LowBetter than 67% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.7% 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 ~13 days

Total

2

Last Release

4733d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e0226d48672e9b63997b511cf7448ce9cf670ecbc6499f9c602d99d70f8de6ea?d=identicon)[dandelionmood](/maintainers/dandelionmood)

---

Top Contributors

[![dandelionmood](https://avatars.githubusercontent.com/u/182812?v=4)](https://github.com/dandelionmood "dandelionmood (6 commits)")[![umpirsky](https://avatars.githubusercontent.com/u/208957?v=4)](https://github.com/umpirsky "umpirsky (1 commits)")

---

Tags

apimoneycurrencywrapperopenratesopenexchangeratescurrenciesopenexchange

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dandelionmood-openexchangerates/health.svg)

```
[![Health](https://phpackages.com/badges/dandelionmood-openexchangerates/health.svg)](https://phpackages.com/packages/dandelionmood-openexchangerates)
```

###  Alternatives

[gabrielbull/ups-api

PHP UPS API

4562.3M10](/packages/gabrielbull-ups-api)[maciej-sz/nbp-php

API for accessing Polish National Bank (NBP - Narodowy Bank Polski) currency and commodities exchange rates

1342.4k1](/packages/maciej-sz-nbp-php)[walle89/swedbank-json

Unofficial API client for the Swedbank's and Sparbanken's mobile apps in Sweden.

752.5k](/packages/walle89-swedbank-json)

PHPackages © 2026

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