Code Monkey home page Code Monkey logo

btcturk-api's Introduction

PHP API client for btcturk.com

tests Latest Stable Version Total Downloads Latest Unstable 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

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

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

Tickers

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

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

currency parameter can be used for all symbol pairs.

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

OrderBook

Get a list of all open orders for a product.

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

Trades

Gets a list the latest trades for a product.

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

OHLC Data

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

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

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']);

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']);

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

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');

Retrieve all orders of any status.

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

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.

btcturk-api's People

Contributors

slvler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.