PHPackages                             gabrielandy/coindesk - 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. gabrielandy/coindesk

ActiveLibrary[API Development](/categories/api)

gabrielandy/coindesk
====================

CoinDesk Bitcoin Price Index API for Laravel

v1.2.0(4y ago)142894MITPHPPHP ^7.3 || ^8.0

Since Nov 19Pushed 4y ago2 watchersCompare

[ Source](https://github.com/gabrielAndy/coindesk)[ Packagist](https://packagist.org/packages/gabrielandy/coindesk)[ RSS](/packages/gabrielandy-coindesk/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (5)Dependencies (4)Versions (9)Used By (0)

CoinDesk Bitcoin Price Index API for Laravel
============================================

[](#coindesk-bitcoin-price-index-api-for-laravel)

> Implement CoinDesk Bitcoin Price Index (BPI) on Laravel apps

This package allows you to query for the Bitcoin exchange rates in supported [CoinDesk's](https://www.coindesk.com) fiat [currencies](https://api.coindesk.com/v1/bpi/supported-currencies.json) in [Laravel](https://laravel.com) applications.

Requirements
------------

[](#requirements)

- PHP &gt;= 7.4
- Laravel &gt;= 7.0
- Guzzle 7.0

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

[](#installation)

You can install the package via composer:

```
composer require gabrielandy/coindesk
```

Usage
-----

[](#usage)

### To get the price of a Bitcoin value in any supported fiat currency

[](#to-get-the-price-of-a-bitcoin-value-in-any-supported-fiat-currency)

```
use Coindesk;

/**
 * Convert from Bitcoin to Coindesk's supported fiat currency (USD, GBP, EUR, NGN, GHC).
 *
 * @example Coindesk::toFiatCurrency('USD', 1)
 *
 * @param  string  $currency_code  - The ISO 4217 fiat currency you wish to convert Bitcoin to
 * @param  int  $bitcoin_amount    - The value of Bitcoin in float/numeric
 * @return float
 */
Coindesk::toFiatCurrency($currency_code, $bitcoin_amount);

Coindesk::toFiatCurrency('USD', 1); // This will return 36579.71 stating that ₿1 = $36,579.71
Coindesk::toFiatCurrency('EUR', 1); // This will return 29951.01 stating that ₿1 = €29,951.01
Coindesk::toFiatCurrency('NGN', 1); // This will return 15028918.04 stating that ₿1 = ₦15,028,918.04
```

### To convert any Coindesk's supported fiat currency value to Bitcoin

[](#to-convert-any-coindesks-supported-fiat-currency-value-to-bitcoin)

```
use Coindesk;

/**
 * Convert any supported Coindesk's fiat currency to Bitcoin.
 *
 * @example Coindesk::toBtc(1, 'USD')
 *
 * @param  int  $amount             - The amount of the currency in integer/numeric
 * @param  string  $currency = USD  - The currency you wish to convert to Bitcoin
 * @return string
 */
Coindesk::toBtc($amount, $currency_code);

Coindesk::toBtc(1, 'USD'); // This will return 0.000027 stating that $1 = ₿0.000027
Coindesk::toBtc(1, 'EUR'); // This will return 0.000034 stating that €1 = ₿0.000034
Coindesk::toBtc(1, 'NGN'); // This will return 0.000000067 stating that ₦1 = ₿0.000000067
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please visit the [Contributing](CONTRIBUTING.md) page for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

The MIT License. Please see [License](LICENSE.md) file for details.

Disclaimer
----------

[](#disclaimer)

This project is not affiliated in any way with CoinDesk. It is intended to provide a useful service and comes with no warranty or any kind. The author is not responsible for any damages or problems incurred during usage of the API.

You are free to use this package to consume Coindesk's API as you see fit, as long as each page or app that uses it includes the text "Powered by [CoinDesk](https://www.coindesk.com/price/bitcoin)", linking to Coindesk's [pricing page](https://www.coindesk.com/price/bitcoin).

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~81 days

Recently: every ~7 days

Total

8

Last Release

1798d ago

Major Versions

v0.1.0 → v1.0.02021-05-10

PHP version history (3 changes)0.1.x-devPHP ^7.2

v1.0.0PHP ^7.4 || ^8.0

v1.0.2PHP ^7.3 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/4bc885bbc448b483df34697f8b87be71424a755206dfd71862f02f0f60f78b72?d=identicon)[andikangabriel](/maintainers/andikangabriel)

---

Top Contributors

[![AndikanGabriel](https://avatars.githubusercontent.com/u/54823365?v=4)](https://github.com/AndikanGabriel "AndikanGabriel (35 commits)")

---

Tags

bitcoinbitcoin-converterbpicoindeskcoindesk-apicryptocurrencylaravelphpphplaravelcryptoconverterbitcoincoindeskbpi

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gabrielandy-coindesk/health.svg)

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

###  Alternatives

[dariusiii/tmdb-laravel

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the wtfzdotnet/php-tmdb-api library.

1821.1k](/packages/dariusiii-tmdb-laravel)[madeitbelgium/wordpress-php-sdk

WordPress Laravel PHP SDK

4422.9k1](/packages/madeitbelgium-wordpress-php-sdk)[gufy/whmcs

WHMCS API for Laravel 5

201.7k](/packages/gufy-whmcs)

PHPackages © 2026

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