PHPackages                             loonpwn/blockfolio-php - 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. loonpwn/blockfolio-php

ActiveLibrary[API Development](/categories/api)

loonpwn/blockfolio-php
======================

Blockfolio SDK for PHP - Use Blockfolios API in your PHP project

v1.3(8y ago)122Apache-2.0PHPPHP ^7.0

Since Mar 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/loonpwn/blockfolio-php)[ Packagist](https://packagist.org/packages/loonpwn/blockfolio-php)[ RSS](/packages/loonpwn-blockfolio-php/feed)WikiDiscussions master Synced 3d ago

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

Blockfolio SDK for PHP - Unofficial
===================================

[](#blockfolio-sdk-for-php---unofficial)

[![Total Downloads](https://camo.githubusercontent.com/02a576db75764d6c93408506f67625fc3d6a28c37055fc1cd44810ec729a116d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6f6f6e70776e2f626c6f636b666f6c696f2d7068702e7376673f7374796c653d666c6174)](https://packagist.org/packages/loonpwn/php-blockfolio)[![Apache 2 License](https://camo.githubusercontent.com/545fe3e67fee27b2047668aeeb7fa4b58480ba4c937e0d5fac0b22a6eedaacf8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c6f6f6e70776e2f626c6f636b666f6c696f2d7068702e7376673f7374796c653d666c6174)](http://aws.amazon.com/apache-2-0/)

The **Blockfolio SDK for PHP** is an interface for interacting with the Blockfolio endpoints.

Example
-------

[](#example)

\[\]

Features
--------

[](#features)

- Majority of Blockfolio endpoints mapped out
- Built on Guzzle, middleware for handling the required headers
- Full behat automated testing to ensure endpoints are working as expected
- Docker workspace for easy development

Getting Started
---------------

[](#getting-started)

1. **Find Your Magic** - You will need to use Packet Capture Android App and scan Blockfolio outgoing requests. The request looks like this

```
GET /rest/system_status?platform=android_rn HTTP/1.1
magic: edtopjhgn2345piuty89whqejfiobh89-2q453
build-number: 225
version: 1.1.10.225
Host: api-v0.blockfolio.com
Connection: Keep-Alive
Accept-Encoding: gzip
User-Agent: okhttp/3.6.0

```

1. **Get your API Key** – This can be found within the app under Settings -&gt; Token
2. **Minimum requirements** – To run the SDK, your system will need to meet the minimum requirements, including having **PHP &gt;= 7.1**.
3. **Install the SDK** – Using Composer run `composer require loonpwn/blockfolio-php`
4. **Using the SDK** – Follow the examples below or look at the functions available

Endpoints
---------

[](#endpoints)

The base URL is `https://api-v0.blockfolio.com/rest/`.

- `version` - Gets the API version
- `system_status` - Gets the API's system status
- `coinlist_v6` - Gets a list of all coins available
- `currency` - Gets a list of currencies available
- `get_all_positions` - Gets a list of all your positions
- `get_positions_v2/{ticker}` - Gets all of your positions for a ticker
- `get_combined_position/{ticker}` - Similar to the above
- `marketdetails_v2/{exchange}/{ticker}` - See what an exchange is trading a ticker for. *Binance used by default*
- `candlestick/{exchange}/{ticker}` - Get all data points for a ticker on an exchange. *Binance used by default*
- `orderbook/{exchange}/{ticker}` - Get the order book for a ticker on an exchange. *Binance used by default*

Quick Examples
--------------

[](#quick-examples)

### Create the client

[](#create-the-client)

The ideal setup is to create an environment variable. Alternatively you can pass in the options the api key.

```
BLOCKFOLIO_API_KEY=
BLOCKFOLIO_MAGIC=

```

```
