PHPackages                             kuromoka/cyger - 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. kuromoka/cyger

ActiveLibrary[API Development](/categories/api)

kuromoka/cyger
==============

A PHP library to get cryptocurrency price from various exchange APIs.

v2.0.0(8y ago)3161[1 PRs](https://github.com/kuromoka/cyger/pulls)MITPHP

Since Dec 19Pushed 4y agoCompare

[ Source](https://github.com/kuromoka/cyger)[ Packagist](https://packagist.org/packages/kuromoka/cyger)[ RSS](/packages/kuromoka-cyger/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (6)Versions (4)Used By (0)

Cyger
=====

[](#cyger)

[![Build Status](https://camo.githubusercontent.com/1b65dbd939e7fd905e6661135445104ad94b62eae17cf54e66d3e32944b0a191/68747470733a2f2f7472617669732d63692e6f72672f6b75726f6d6f6b612f63796765722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/kuromoka/cyger)[![Coverage Status](https://camo.githubusercontent.com/c5830aef982b2eab2125efc98ad154d454dc90fb507670f75e7a37494a0e5bbf/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6b75726f6d6f6b612f63796765722f62616467652e737667)](https://coveralls.io/github/kuromoka/cyger)

Cyger is a PHP library to get cryptocurrency price from various exchange APIs.

- It is possible to resolve different specifications for each api as soon as possible.
- It can get last price, bid price, ask price and volume.
- [Supporting exchanges](#supporting_exchanges)

Install
-------

[](#install)

```
$ composer require kuromoka/cyger

```

Requirement
-----------

[](#requirement)

- PHP &gt;= 5.5
- [Composer](https://getcomposer.org/)

Usage
-----

[](#usage)

The first example code below shows getting last price of BTC\_ETH from Poloniex.

```
require 'vendor/autoload.php';

use Cyger\Client;

$client = new Client();
$result = $client->setExchange('Poloniex')->setPair('BTC_ETH')->getLastPrice();
echo $result['Poloniex']['BTC_ETH'];    // 0.04549105
```

The secound example code below shows getting last price of BTC\_ETH from all [supporting exchanges](#supporting_exchanges). It is possible not to set exchange, but it is necessary to set pairs.
if exchanges don't support pairs, returning NULL.

```
$client = new Client();
$result = $client->setPair('BTC_ETH')->getLastPrice();
echo $result['Poloniex']['BTC_ETH'];     // 0.04549105
echo $result['Bittrex']['BTC_ETH'];      // 0.04577
echo $result['Coincheck']['BTC_ETH'];    // NULL (Coincheck doesn't support BTC_ETH pair.)
```

Also, you can use various style of exchange name and pair name. You don't have to think each api specifications basically.
The example below shows OK and NG name.

```
$client->setExchange('poloniex')    // OK
$client->setExchange('POLONIEX')    // OK
$client->setExchange('POLONIE')     // NG

$client->setPair('BTC_ETH');        // OK
$client->setPair('btc-eth');        // OK
$client->setPair('ETH/BTC');        // OK
$client->setPair('BTC:ETH');        // NG
```

Key name of results array is setting from your style.

```
$client = new Client();
$result = $client->setExchange('POLONIEX')->setPair('ETH/BTC')->getLastPrice();
echo $result['POLONIEX']['ETH/BTC'];    // 0.04549105

```

When you want to get other than last price, please replace getLastPrice() to methods below.

- getBidPrice()
- getAskPrice()
- getVolume()

Supporting exchanges
--------------------------------------------------------------------

[](#supporting-exchanges)

I am going to add more exchanges in the future.

- [Binance](https://www.binance.com/)
- [bitFlyer](https://bitflyer.jp/)
- [Bittrex](https://bittrex.com/)
- [Coincheck](https://coincheck.com/)
- [Poloniex](https://poloniex.com/)
- [Zaif](https://zaif.jp/)

Author
------

[](#author)

- Twitter
    - [@kuromoka16](https://twitter.com/kuromoka16)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

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 ~135 days

Total

2

Last Release

2931d ago

Major Versions

v1.0.0 → v2.0.02018-05-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/849b9bd9ba0657225274113886b8a5767eb5643da4bbb4510f0ef44417f7f6f1?d=identicon)[kuromoka](/maintainers/kuromoka)

---

Top Contributors

[![kuromoka](https://avatars.githubusercontent.com/u/22453562?v=4)](https://github.com/kuromoka "kuromoka (40 commits)")

---

Tags

bitcoincomposercryptocurrency

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/kuromoka-cyger/health.svg)

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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