Download the PHP package bitvavo/php-bitvavo-api without Composer

On this page you can find all versions of the php package bitvavo/php-bitvavo-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-bitvavo-api


PHP Bitvavo API

This is the PHP wrapper for the Bitvavo API. This project can be used to build your own projects which interact with the Bitvavo platform. Every function available on the API can be called through a REST request or over websockets. For info on the specifics of every parameter consult the Bitvavo API documentation

Installation

Get the package and it's dependencies:

composer require bitvavo/php-bitvavo-api:dev-master

Run the example:

cd vendor/bitvavo/php-bitvavo-api/example

php example.php

REST requests

The general convention used in all functions (both REST and websockets), is that all optional parameters are passed as an associative array, while required parameters are passed as separate values. Only when placing orders some of the optional parameters are required, since a limit order requires more information than a market order. The returned responses are all converted to associative arrays as well, such that $response['<key>'] = '<value>'.

Getting started

The API key and secret are required for private calls and optional for public calls. The access window and debugging parameter are optional for all calls. The access window is used to determine whether the request arrived within time, the value is specified in milliseconds. You can use the time function to synchronize your time to our server time if errors arise. REST url and WS url can be used to set a different endpoint (for testing purposes). Debugging should be set to true when you want to log additional information and full responses. Any parameter can be omitted, private functions will return an error when the api key and secret have not been set.

For demonstration purposes we encode back to json when printing. This is because PHP does not allow pretty printing of arrays. Normally you would access the required values in the following manner:

General

Get time

View Response

Get markets

View Response

Get assets

View Response

Market Data

Get book per market

View Response

Get trades per market

View Response

Get candles per market

View Response

Get price ticker

View Response

Get book ticker

View Response

Get 24 hour ticker

View Response

Private

Place order

When placing an order, make sure that the correct optional parameters are set. For a limit order it is required to set both the amount and price. A market order is valid if either the amount or the amountQuote has been set.

View Response

Update order

When updating an order make sure that at least one of the optional parameters has been set. Otherwise nothing can be updated.

View Response

Get order

View Response

Cancel order

View Response

Get orders

Returns the same as get order, but can be used to return multiple orders at once.

View Response

Cancel orders

Cancels all orders in a market. If no market is specified, all orders of an account will be canceled.

View Response

Get orders open

Returns all orders which are not filled or canceled.

View Response

Get trades

Returns all trades within a market for this account.

View Response

Get account

Returns the fee tier for this account.

View Response

Get balance

Returns the balance for this account.

View Response

Deposit assets

Returns the address which can be used to deposit funds.

View Response

Withdraw assets

Can be used to withdraw funds from Bitvavo.

View Response

Get deposit history

Returns the deposit history of your account.

View Response

Get withdrawal history

Returns the withdrawal history of an account.

View Response

Websockets

All requests which can be done through REST requests can also be performed over websockets. Bitvavo also provides six subscriptions. If subscribed to these, updates specific for that type/market are pushed immediately. Our experience with php is that it performs slightly worse than our other SDK's, therefore we recommend to implement programs, which require constant synchronisation with the exchange, in another language. For simple operations or any functions integrated into a website php suffices.

Getting started

The websocket object should be intialised through the $websock = $bitvavo->newWebSocket(); function. After which a callback for the errors should be set through the setErrorCallback() function. After this any desired function can be called. Finally the websocket should be started through the startSocket() function. This call is blocking, this means that any code after the startSocket() call will not be executed. When it is required to use the response of one function as input for another function, the second function should be called in the callback of the first function.

The api key and secret are copied from the bitvavo object. Therefore if you want to use the private portion of the websockets API, you should set both the key and secret as specified in REST requests.

Public

Get time

View Response

Get markets

View Response

Get assets

View Response

Get book per market

View Response

Get trades per market

View Response

Get candles per market

View Response

Get price ticker

View Response

Get book ticker

View Response

Get 24 hour ticker

View Response

Private

Place order

When placing an order, make sure that the correct optional parameters are set. For a limit order it is required to set both the amount and price. A market order is valid if either the amount or the amountQuote has been set.

View Response

Update order

When updating an order make sure that at least one of the optional parameters has been set. Otherwise nothing can be updated.

View Response

Get order

View Response

Cancel order

View Response

Get orders

Returns the same as get order, but can be used to return multiple orders at once.

View Response

Cancel orders

Cancels all orders in a market. If no market is specified, all orders of an account will be canceled.

View Response

Get orders open

Returns all orders which are not filled or canceled.

View Response

Get trades

Returns all trades within a market for this account.

View Response

Get account

Returns the fee tier for this account.

View Response

Get balance

Returns the balance for this account.

View Response

Deposit assets

Returns the address which can be used to deposit funds.

View Response

Withdraw assets

Can be used to withdraw funds from Bitvavo.

View Response

Get deposit history

Returns the deposit history of your account.

View Response

Get withdrawal history

Returns the withdrawal history of an account.

View Response

Subscriptions

Ticker subscription

Sends an update every time the best bid, best ask or last price changed.

View Response

Ticker 24 hour subscription

Updated ticker24h objects are sent on this channel once per second. A ticker24h object is considered updated if one of the values besides timestamp has changed.

View Response

Account subscription

Sends an update whenever an event happens which is related to the account. These are ‘order’ events (create, update, cancel) or ‘fill’ events (a trade occurred).

View Response

Candles subscription

Sends an updated candle after each trade for the specified interval and market.

View Response

Trades subscription

Sends an update whenever a trade has happened on this market. For your own trades, please subscribe to account.

View Response

Book subscription

Sends an update whenever the order book for this specific market has changed. A list of tuples ([price, amount]) are returned, where amount ‘0’ means that there are no more orders at this price. If you wish to maintain your own copy of the order book, consider using the next function. Although all updates will be received, there might be a slight delay compared to other languages. When using this function for automated trading please consider coding in an alternative language.

View Response

Book subscription with local copy

This is a combination of get book per market and the book subscription which maintains a local copy. On every update to the order book, the entire order book is returned to the callback, while the book subscription will only return updates to the book. Although all updates will be received, there might be a slight delay compared to other languages. When using this function for automated trading please consider coding in an alternative language.

View Response

All versions of php-bitvavo-api with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
ext-curl Version *
ratchet/pawl Version ^0.3.0
react/socket Version ^1.0 || ^0.8 || ^0.7
ratchet/rfc6455 Version ^0.2.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bitvavo/php-bitvavo-api contains the following files

Loading the files please wait ....