PHPackages                             oasin/cryptocurrencies-laravel - 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. oasin/cryptocurrencies-laravel

ActiveLibrary[API Development](/categories/api)

oasin/cryptocurrencies-laravel
==============================

Laravel package for cryptocurrencies api service

v0.1.2(7y ago)039MITPHPPHP ^7.1.3

Since Jan 2Pushed 4y agoCompare

[ Source](https://github.com/oasin/cryptocurrencies-laravel)[ Packagist](https://packagist.org/packages/oasin/cryptocurrencies-laravel)[ RSS](/packages/oasin-cryptocurrencies-laravel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

Cryptocurrencies API Laravel Manager
====================================

[](#cryptocurrencies-api-laravel-manager)

Laravel wrapper for the main cryptocurrencies APIs, provides an easy way to use the third-part API. Recover a gateway from the cryptocurrencies Manager and start to query the chosen API.

[![Latest Stable Version](https://camo.githubusercontent.com/141b29bdb48a63e0794020a11379a6c34fb9b421e55176c65b642a156ba3425d/68747470733a2f2f706f7365722e707567782e6f72672f696c636c656d652f63727970746f63757272656e636965732d6c61726176656c2f762f737461626c65)](https://packagist.org/packages/ilcleme/cryptocurrencies-laravel)[![Total Downloads](https://camo.githubusercontent.com/87b1a8d6d4d3adac56c51ba0c4246025d9acd1c7b32a41f56e9ca8ed1a616beb/68747470733a2f2f706f7365722e707567782e6f72672f696c636c656d652f63727970746f63757272656e636965732d6c61726176656c2f646f776e6c6f616473)](https://packagist.org/packages/ilcleme/cryptocurrencies-laravel)[![Latest Unstable Version](https://camo.githubusercontent.com/e83e845703c582a87ffa2842e9f10ee5d940ed58c7ca547365bc0402f831ddab/68747470733a2f2f706f7365722e707567782e6f72672f696c636c656d652f63727970746f63757272656e636965732d6c61726176656c2f762f756e737461626c65)](https://packagist.org/packages/ilcleme/cryptocurrencies-laravel)[![License](https://camo.githubusercontent.com/dbf3abcb1344c6b7198eb3bbdfe2f5ba145ef9a936eaef9a8be2dfd5058f27fb/68747470733a2f2f706f7365722e707567782e6f72672f696c636c656d652f63727970746f63757272656e636965732d6c61726176656c2f6c6963656e7365)](https://packagist.org/packages/ilcleme/cryptocurrencies-laravel)

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

[](#requirements)

The minimum requirement by Cryptocurrencies API Laravel Manager is Laravel 5.7 installed and your Web server supports PHP 7.1.

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

[](#installation)

To install Cryptocurrencies API Laravel Manager package you can use a simple composer command.

```
composer require ilcleme/cryptocurrencies-laravel

```

Publish Vendor
--------------

[](#publish-vendor)

This step is fundamental to use every API calls. After install the package you could publish the config package file, use this command:

```
php artisan vendor:publish --provider="Oasin\\Cryptocurrencies\\Providers\\CryptocurrenciesServiceProvider"

```

Now you can override the default configuration and insert you personal **api key for every third-part service**.

Architecture
------------

[](#architecture)

The package contains 3 main objects that have been used to interact with the bees:

- Cryptocurrencies API Manager (`cryptocurrencies.manager` is container alias on Laravel);
- Gateways, that is objects implemented to query third-party APIs, everyone have a name used to retrive it from manager;

Available gateways:

- For Cryptocompare there are 4 gateways available "out-of-box", one per section available on Cryptocompare docs:
    1. Cryptocompare "General Information", for every api calls of "general info" section;
    2. Cryptocompare "Historical data", for every api calls of "Historical data" section;
    3. Cryptocompare "Price Data", for every api calls of "price" section;
    4. Cryptocompare "Top list Data", gateway for every api calls of "top list" section;
- For Coinmarketcap it is only an available gateway, through which it is possible to execute every type of request.

Usage
-----

[](#usage)

To use the package simply get the Cryptocurrencies API Manager instance from the container. Get the choosen Gateway based on type of query you want to do, for example to "get price of BTC in fiat currencies" use the Cryptocompare "Price Data". Use the gateway methods with right parameters to query the api. For example:

```
namespace App\Http\Controllers;

use Oasin\Cryptocurrencies\Gateways\Cryptocompare\CryptocomparePriceGateway;

class CryptoController extends Controller
{
    public function getBTCPrice()
    {
        $manager = app('cryptocurrencies.manager');
        /** @var CryptocomparePriceGateway $priceGateway */
        $priceGateway = $manager->getGateway('price');

        //parameters passed to the method are defined in accordance with the Cryptocompare documentation of endpoint
        $parameters = [
            'fsym' => 'BTC',
            'tsyms' => 'USD,JPY,EUR'
        ];
        $result = $priceGateway->getSingleSymbolPrice($parameters);
        return $result;
    }
}
```

set a route for this controller and expect to receive a similar response:

```
{ "USD": 3887.35, "JPY": 412906.65, "EUR": 3399.46 }
```

To use Coinmarketcap gateway is the same way:

```
namespace App\Http\Controllers;

use Oasin\Cryptocurrencies\Gateways\Coinmarketcap\CoinmarketcapGateway;

class CryptoController extends Controller
{
    public function test()
    {
        $manager = app('cryptocurrencies.manager');
        /** @var CoinmarketcapGateway $coinmarketcapGateway */
        $coinmarketcapGateway = $manager->getGateway('coinmarketcap');

        //parameters passed to the method are defined in accordance with the Coinmarketcap documentation of endpoint
        $parameters = [
            'query' => ['id' => '1,2']
        ];
        $result = $coinmarketcapGateway->send('/v1/cryptocurrency/info', 'GET', $parameters);
        return $result;
    }
}
```

Response expected:

```
{
  "status": {
    "timestamp": "2019-01-03T11:43:39.871Z",
    "error_code": 0,
    "error_message": null,
    "elapsed": 4,
    "credit_count": 1
  },
  "data": {
    "1": {
      "urls": {
        "website": ["https://bitcoin.org/"],
        "twitter": [],
        "reddit": ["https://reddit.com/r/bitcoin"],
        "message_board": ["https://bitcointalk.org"],
        "announcement": [],
        "chat": [],
        "explorer": [
          "https://blockchain.info/",
          "https://live.blockcypher.com/btc/",
          "https://blockchair.com/bitcoin/blocks"
        ],
        "source_code": ["https://github.com/bitcoin/"]
      },
      "logo": "https://s2.coinmarketcap.com/static/img/coins/64x64/1.png",
      "id": 1,
      "name": "Bitcoin",
      "symbol": "BTC",
      "slug": "bitcoin",
      "date_added": "2013-04-28T00:00:00.000Z",
      "tags": ["mineable"],
      "platform": null,
      "category": "coin"
    },
    "2": {
      "urls": {
        "website": ["https://litecoin.com"],
        "twitter": ["https://twitter.com/LitecoinProject"],
        "reddit": ["https://reddit.com/r/litecoin"],
        "message_board": ["https://litecointalk.io/"],
        "announcement": ["https://bitcointalk.org/index.php?topic=47417.0"],
        "chat": ["https://telegram.me/litecoin"],
        "explorer": [
          "http://explorer.litecoin.net/chain/Litecoin",
          "https://chainz.cryptoid.info/ltc/",
          "https://live.blockcypher.com/ltc/"
        ],
        "source_code": ["https://github.com/litecoin-project/litecoin"]
      },
      "logo": "https://s2.coinmarketcap.com/static/img/coins/64x64/2.png",
      "id": 2,
      "name": "Litecoin",
      "symbol": "LTC",
      "slug": "litecoin",
      "date_added": "2013-04-28T00:00:00.000Z",
      "tags": ["mineable"],
      "platform": null,
      "category": "coin"
    }
  }
}
```

Gateway and API Reference
-------------------------

[](#gateway-and-api-reference)

Here there is [full api and gateways reference](docs/API_Cryptocompare.md) for **Cryptocompare API**

Here there is [full api and gateways reference](docs/API_Coinmarketcap.md) for **Coinmarketcap API**

Test
----

[](#test)

To run the package test you need to install the dev requirements (test tools) and run phpunit from the package folder

```
composer install --dev
vendor/bin/phpunit tests

```

if you want a more verbose log use this command

```
vendor/bin/phpunit --testdox tests

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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 ~3 days

Total

3

Last Release

2680d ago

### Community

Maintainers

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

---

Top Contributors

[![mattiaclementi](https://avatars.githubusercontent.com/u/1780500?v=4)](https://github.com/mattiaclementi "mattiaclementi (10 commits)")[![oasin](https://avatars.githubusercontent.com/u/31675779?v=4)](https://github.com/oasin "oasin (10 commits)")

---

Tags

laravelpackagecryptocoinmarketcapcryptocompare

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/oasin-cryptocurrencies-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/oasin-cryptocurrencies-laravel/health.svg)](https://phpackages.com/packages/oasin-cryptocurrencies-laravel)
```

###  Alternatives

[bmatovu/laravel-mtn-momo

Laravel MTN MOMO integration.

14310.9k](/packages/bmatovu-laravel-mtn-momo)

PHPackages © 2026

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