An open API service indexing awesome lists of open source software.

https://github.com/coinpaprika/coinpaprika-api-php-client

This library provides convenient way to use Coinpaprika.com API in PHP.
https://github.com/coinpaprika/coinpaprika-api-php-client

bitcoin blockchain coinpaprika crypto cryptocurrency market-capitalization php

Last synced: 10 months ago
JSON representation

This library provides convenient way to use Coinpaprika.com API in PHP.

Awesome Lists containing this project

README

          

# Coinpaprika API PHP Client
[![Coins](https://img.shields.io/badge/dynamic/json.svg?url=https://api.coinpaprika.com/v1/global&label=coins&query=$.cryptocurrencies_number&colorB=lightgrey&maxAge=3600)](https://coinpaprika.com)
[![Bitcoin Price USD](https://img.shields.io/badge/dynamic/json.svg?url=https://api.coinpaprika.com/v1/ticker/btc-bitcoin&label=Bitcoin&query=$.price_usd&colorB=brightgreen&prefix=$%20&maxAge=3600)](https://coinpaprika.com)

[![Logo](https://coinpaprika.com/static/files/d6d3c6e3.svg#greywizard/rock-coin-web/assets/coin/img/cp-logo-beta.svg)](https://api.coinpaprika.com/)

[![Latest Stable Version](https://poser.pugx.org/coinpaprika/coinpaprika-api-php-client/v/stable)](https://packagist.org/packages/coinpaprika/coinpaprika-api-php-client)
[![Build Status](https://scrutinizer-ci.com/g/coinpaprika/coinpaprika-api-php-client/badges/build.png?b=master)](https://scrutinizer-ci.com/g/coinpaprika/coinpaprika-api-php-client/build-status/master)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Quality Score](https://img.shields.io/scrutinizer/g/coinpaprika/coinpaprika-api-php-client.svg?style=flat-square)](https://scrutinizer-ci.com/g/coinpaprika/coinpaprika-api-php-client)
[![Code Coverage](https://scrutinizer-ci.com/g/coinpaprika/coinpaprika-api-php-client/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/coinpaprika/coinpaprika-api-php-client/?branch=master)
[![Total Downloads](https://poser.pugx.org/coinpaprika/coinpaprika-api-php-client/downloads)](https://packagist.org/packages/coinpaprika/coinpaprika-api-php-client)

## Usage

This library provides convenient way to use [coinpaprika.com API](https://api.coinpaprika.com/) in PHP.

[Coinpaprika](https://coinpaprika.com) delivers full market data to the world of crypto: coin prices, volumes, market caps, ATHs, return rates and more.

## Requirements

* PHP >= 7.1
* (optional) PHPUnit to run tests.

## Install

Via Composer:

```bash
$ composer require coinpaprika/coinpaprika-api-php-client
```

## Getting started

```php
getCoins();
```
From `$client` object, you can access all the endpoints.

## Cache usage
For deserialization process it is advised to initiate the `$client` with `$cacheDir` argument.
```php
getTickers();
```

## Paid API
To use paid version set the api key
```php
setApiKey('PROVIDED_API_KEY');
$coins = $client->getCoins();
```

## Examples

Check out the [`./examples`](./examples) directory.

## License

CoinpaprikaAPI is available under the MIT license. See the [LICENSE file](./LICENSE.md) for more info.