PHPackages                             shahradelahi/coindesk-ticker - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. shahradelahi/coindesk-ticker

Abandoned → [shahradelahi/coinmarketcap](/?search=shahradelahi%2Fcoinmarketcap)ArchivedLibrary[HTTP &amp; Networking](/categories/http)

shahradelahi/coindesk-ticker
============================

A PHP library to get realtime prices from CoinDesk.

0.1(4y ago)194MITPHPPHP &gt;=8.0

Since Aug 2Pushed 4y ago1 watchersCompare

[ Source](https://github.com/shahradelahi/coindesk-ticker)[ Packagist](https://packagist.org/packages/shahradelahi/coindesk-ticker)[ Docs](https://github.com/shahradelahi/coindesk-ticker)[ RSS](/packages/shahradelahi-coindesk-ticker/feed)WikiDiscussions master Synced 2d ago

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

> **Help wanted:** This library is officially depreciated and will only be actively maintained by the community.
>  ***Pull requests are welcome.***

PHP CoinDesk Price Ticker
=========================

[](#php-coindesk-price-ticker)

This project is for catching realtime cryptocurrency prices form [CoinDesk](https://www.coindesk.com/).

**NOTE:** Not recommended for non PHP-Cli, But anyway it's work well.

#### Requirements

[](#requirements)

```
ext-openssl: *
ext-curl: *
ext-json: *
php: >=8.0

```

#### Installation

[](#installation)

```
composer require shahradelahi/coindesk-ticker

```

 Click for help with installationInstall Composer
----------------

[](#install-composer)

If the above step didn't work, install composer and try again.

#### Debian / Ubuntu

[](#debian--ubuntu)

```
sudo apt-get install curl php-curl
curl -s http://getcomposer.org/installer | php
php composer.phar install

```

Composer not found? Use this command instead:

```
php composer.phar require "shahradelahi/coindesk-ticker"

```

#### Windows:

[](#windows)

[Download installer for Windows](https://github.com/jaggedsoft/php-binance-api/#installing-on-windows)

#### Getting started

[](#getting-started)

`composer require shahradelahi/coindesk-ticker`

```
require 'vendor/autoload.php';
$CDApi = new CoinDesk\Api();
```

=======

#### Price Streaming

[](#price-streaming)

Return ticks of the all supported cryptocurrencies in [CoinDesk](https://www.coindesk.com/), and it has a timer for closing the streamer, make sure you will fill it.

```
$Settings = [
    'close_time' => strtotime('+30 minute', time()) // Required
];

$CDApi->ticker()->setTicker(function (array $Tick) {

    // Print out the ticks
    echo "" . json_encode($Tick, JSON_PRETTY_PRINT) . "";

}, $Settings);
```

 View Response```
[
   {
	  "iso": "BTC",
	  "name": "Bitcoin",
	  "slug": "bitcoin",
	  "change": {
		 "percent": -4.896072815000544,
		 "value": -2041.6934352962
	  },
	  "ohlc": {
		 "o": 41700.6346196656,
		 "h": 41808.4166996006,
		 "l": 39292.9291308613,
		 "c": 39826.5392045181
	  },
	  "circulatingSupply": 18773462.54282542,
	  "marketCap": 747682041966.3883,
	  "ts": 1627900353000
   },
   {
	  "iso": "ETH",
	  "name": "Ethereum",
	  "slug": "ethereum",
	  "change": {
		 "percent": -0.040842089316403665,
		 "value": -1.0614868266
	  },
	  "ohlc": {
		 "o": 2599.0022655374,
		 "h": 2698.4745999226,
		 "l": 2511.0200978405,
		 "c": 2601.7565990196
	  },
	  "circulatingSupply": 116933867.71823,
	  "marketCap": 304233461984.79083,
	  "ts": 1627900353000
   }
]
```

#### One-Tick

[](#one-tick)

Returns a single tick of the streaming method, and the response is exactly the response of the streamer.

```
$OneTick = $CDApi->ticker()->getOneTick();
echo "" . json_encode($OneTick, JSON_PRETTY_PRINT) . "";
```

 View Response```
[
   {
	  "iso": "BTC",
	  "name": "Bitcoin",
	  "slug": "bitcoin",
	  "change": {
		 "percent": -4.896072815000544,
		 "value": -2041.6934352962
	  },
	  "ohlc": {
		 "o": 41700.6346196656,
		 "h": 41808.4166996006,
		 "l": 39292.9291308613,
		 "c": 39826.5392045181
	  },
	  "circulatingSupply": 18773462.54282542,
	  "marketCap": 747682041966.3883,
	  "ts": 1627900353000
   },
   {
	  "iso": "ETH",
	  "name": "Ethereum",
	  "slug": "ethereum",
	  "change": {
		 "percent": -0.040842089316403665,
		 "value": -1.0614868266
	  },
	  "ohlc": {
		 "o": 2599.0022655374,
		 "h": 2698.4745999226,
		 "l": 2511.0200978405,
		 "c": 2601.7565990196
	  },
	  "circulatingSupply": 116933867.71823,
	  "marketCap": 304233461984.79083,
	  "ts": 1627900353000
   }
]
```

#### BPI Current Price

[](#bpi-current-price)

It's just current price of Bitcoin in 3 different pairs.

**Pairs:** USD, EUR, GBP

```
$CurrentPrice = $CDApi->getCurrentPrice();
echo "" . json_encode($CurrentPrice, JSON_PRETTY_PRINT) . "";
```

 View Response```
{
   "time": {
	  "updated": "Aug 2, 2021 11:08:00 UTC",
	  "updatedISO": "2021-08-02T11:08:00+00:00",
	  "updateduk": "Aug 2, 2021 at 12:08 BST"
   },
   "disclaimer": "This data was produced from the CoinDesk Bitcoin Price Index (USD). Non-USD currency data converted using hourly conversion rate from openexchangerates.org",
   "chartName": "Bitcoin",
   "bpi": {
	  "USD": {
		 "code": "USD",
		 "symbol": "&#36;",
		 "rate": "39,517.8017",
		 "description": "United States Dollar",
		 "rate_float": 39517.8017
	  },
	  "GBP": {
		 "code": "GBP",
		 "symbol": "&pound;",
		 "rate": "28,430.0549",
		 "description": "British Pound Sterling",
		 "rate_float": 28430.0549
	  },
	  "EUR": {
		 "code": "EUR",
		 "symbol": "&euro;",
		 "rate": "33,233.9180",
		 "description": "Euro",
		 "rate_float": 33233.918
	  }
   }
}
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

1745d ago

### Community

Maintainers

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

---

Top Contributors

[![shahradelahi](https://avatars.githubusercontent.com/u/17948260?v=4)](https://github.com/shahradelahi "shahradelahi (2 commits)")

---

Tags

coindeskcryptophppricetickerphpcryptopricetickercoindesk

### Embed Badge

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

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

###  Alternatives

[hannesvdvreken/guzzle-debugbar

A Guzzle middleware that logs requests to debugbar's timeline

76410.4k1](/packages/hannesvdvreken-guzzle-debugbar)

PHPackages © 2026

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