PHPackages                             kristapsk/php-coindesk-api - 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. kristapsk/php-coindesk-api

AbandonedArchivedLibrary[API Development](/categories/api)

kristapsk/php-coindesk-api
==========================

Composer package for the CoinDesk Bitcoin Price Index API

v1.0(5y ago)129MITPHP

Since Mar 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/kristapsk/php-coindesk-api)[ Packagist](https://packagist.org/packages/kristapsk/php-coindesk-api)[ RSS](/packages/kristapsk-php-coindesk-api/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (2)Used By (0)

CoinDesk Bitcoin Price Index API for PHP
========================================

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

This is a simple composer package that implements [CoinDesk Bitcoin Price Index API](https://www.coindesk.com/coindesk-api) for PHP.

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

[](#requirements)

- PHP 7 with curl and json extensions enabled

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

[](#installation)

```
composer require kristapsk/php-coindesk-api

```

Or just copy `src/BPI.php` to your project, it has no other dependencies.

Usage
-----

[](#usage)

In all examples last parameter of methods called specifies currency. Supported currencies are `EUR`, `GBP` and `USD`. It can be ommited, will default to `USD`.

### Get current Bitcoin price

[](#get-current-bitcoin-price)

```
use kristapsk\CoinDesk\BPI;

// returns float or null on failure
var_dump(BPI::currentPrice('EUR'));
```

### Get historical Bitcoin prices

[](#get-historical-bitcoin-prices)

```
use kristapsk\CoinDesk\BPI;

// returns array with Y-m-d format date string as key and float price as value
// or null on failure
var_dump(BPI::historical(strtotime('2021-03-01'), strtotime('2021-03-16'), 'EUR'));
```

License
-------

[](#license)

This package is released under the MIT License. See the bundled [LICENSE](LICENSE) file for details.

Disclaimer
----------

[](#disclaimer)

This project is not in any way affiliated with CoinDesk.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1877d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/247c92f74f4ad85efe57eae436d99dd5e88600db9af5fb5df3f7671e3150aeff?d=identicon)[kristapsk](/maintainers/kristapsk)

---

Top Contributors

[![kristapsk](https://avatars.githubusercontent.com/u/4500994?v=4)](https://github.com/kristapsk "kristapsk (8 commits)")

---

Tags

bitcoincoindeskcoindesk-apiphp

### Embed Badge

![Health badge](/badges/kristapsk-php-coindesk-api/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

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

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

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

PHP wrapper for the Meilisearch API

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

Google API Core for PHP

263103.1M452](/packages/google-gax)

PHPackages © 2026

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