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 3w ago

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 47% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

1931d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4500994?v=4)[Kristaps Kaupe](/maintainers/kristapsk)[@kristapsk](https://github.com/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

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k13](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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