PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Hicri   BTCTurk PHP API   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: BTCTurk PHP API
Get currency exchange rates with btcturk.com API
Author: By
Last change:
Date: 1 year ago
Size: 4,969 bytes
 

Contents

Class file image Download

PHP API client for btcturk.com

tests Latest Stable Version License

image info

A simple API client, written with PHP for btcturk.com.

BtcTurk is a cryptocurrency exchange operating in Turkey. Offers crypto trading service. There are various crypto services available.

For additional information about API visit https://docs.btcturk.com/

BtcTurk API Terms of Service

Requirements

  • PHP >= 7.2
  • ext-json

Installation

The preferred way to install this extension is through composer.

Either run

$ composer require slvler/btckturk-api

or add

"slvler/btckturk-api": "^1.0"

Basic usage

Example

use slvler\BtcTurkApi\BtcTurkClient;

$client = new BtcTurkClient();

Available methods

Exchange

exchange-info

You can use exchangeinfo endpoint for all tradable pairs and their quantity or price scales.

$data = $client->exchange()->getList();

Tickers

Pair

Using the pairSymbol parameter, you can send a request for a single pair.

$data = $client->ticker()->getPair('BTCUSDT');

currency

currency parameter can be used for all symbol pairs.

$data = $client->ticker()->getCurrency('usdt');

OrderBook

orderbook

Get a list of all open orders for a product.

$data = $client->orderBook()->getOrderBook('BTCUSDT', ['limit' => 10]);

Trades

trades

Gets a list the latest trades for a product.

$data = $client->trades()->getTrades('BTCUSDT', ['last' => 10]);

OHLC Data

OHLC

open, high, low, close, volume, total and average information can be viewed with OHLC enpoint.

$data = $client->ohlcs()->getOhlcs('BTCUSDT', ['from' => 1638316800, 'to' => 1639526400]);

Account Balance

Balance

For more information you can check our Authentication V1 article. All asset information can be viewed with the Account Balance endpoint.

$data = $client->balance()->getBalances();

Transactions

Transactions

For more information you can check our Authentication V1 article. 6 parameters can be used to access user transactions.

$data = $client->transaction()->getTransaction(['type' => 'buy', 'symbol' => 'btc', 'symbol' => 'usdt']);

Fiat Transactions

For more information you can check our Authentication V1 article. 4 parameters can be used to access user fiat transactions.

$data = $client->transaction()->getFiatTransactions(['symbol' => 'try']);

Crypto Transactions

For more information you can check our Authentication V1 article. 4 parameters can be used to access user fiat transactions.

$data = $client->transaction()->getCryptoTransactions(['symbol' => ['btc','etc']]);

Orders

Open Orders

List your current open orders. Only open or un-settled orders are returned by default. As soon as an order is no longer open and settled, it will no longer appear in the default request.

$data = $client->orders()->getOpenOrders('BTCTRY');

All Orders

Retrieve all orders of any status.

$data = $client->orders()->getAllOrders(['pairSymbol' => 'BTCTRY', 'limit' => "1", 'page' => '10']);

Single Order

Get a single order by orderId. For all transactions related to the private endpoint, you must authorize before sending your request.

$data = $client->orders()->getSingleOrder('61912740');

Testing

    composer test

Credits

License

The MIT License (MIT). Please see License File for more information.