linwj / bitget
Bitget API Like the official document interface, Support for arbitrary extension.
Installs: 3 992
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 2
Open Issues: 1
Requires
- php: >=7.0
- guzzlehttp/guzzle: *
This package is auto-updated.
Last update: 2024-10-21 07:37:19 UTC
README
It is recommended that you read the official document first
Bitget Document
https://www.bitget.com/zh-CN/api-doc/common/intro
All interface methods are initialized the same as those provided by Bitget. See details src/api
Most of the interface is now complete, and the user can continue to extend it based on my design, working with me to improve it.
Other exchanges API
Exchanges It includes all of the following exchanges and is highly recommended.
If you don't find the exchange SDK you want, you can tell me and I'll join them.
Installation
composer require linwj/bitget
Support for more request Settings
$bitget=new BitgetSpotV2($key,$secret,$passphrase); //or $bitget=new BitgetContractV2()($key,$secret,$passphrase); //You can set special needs $bitget->setOptions([ //Set the request timeout to 60 seconds by default 'timeout'=>10, ]);
Bitget Spot API
Market API More
$bitget=new BitgetSpotV2($key,$secret,$passphrase); try { $result=$bitget->market()->getTickers([ 'symbol'=>'BTCUSDT', ]); print_r($result); }catch (\Exception $e){ print_r(json_decode($e->getMessage(),true)); } try { $result=$bitget->market()->getCandles([ 'symbol'=>'BTCUSDT', 'granularity'=>'5min' ]); print_r($result); }catch (\Exception $e){ print_r(json_decode($e->getMessage(),true)); }
Account API More
$bitget=new BitgetSpotV2($key,$secret,$passphrase); try { $result=$bitget->account()->getAssets(); print_r($result); }catch (\Exception $e){ print_r(json_decode($e->getMessage(),true)); }
Order API More
$bitget=new BitgetSpot($key,$secret); try { $result=$bitget->trade()->postPlaceOrder([ 'symbol'=>'BTCUSDT', 'side'=>'sell', 'orderType'=>'limit', 'force'=>'gtc', 'price'=>'66666', 'size'=>'1', //'clientOid'=>'**************', ]); print_r($result); }catch (\Exception $e){ print_r(json_decode($e->getMessage(),true)); } try { $result=$bitget->trade()->getOrderInfo([ //'orderId'=>'***************', 'clientOid'=>'**************', ]); print_r($result); }catch (\Exception $e){ print_r(json_decode($e->getMessage(),true)); }