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.
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.
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,
]);
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));
}