Bitget APIBitget API
统一账户经典账户
旧文档
  • 概览
  • API 文档
  • WebSocket
  • Agent Hub
  • SDK
  • 更新日志
Copied to clipboard
接口文档
经典账户
    跟单 · 合约跟单 · 跟单员
      新版跟随者跟单设置接口post跟随者查询当前跟单信息get跟随者查询历史跟单信息get跟随者设置仓位止盈止损post跟单员平仓post跟随者查看跟单设置get跟单设置post跟随者取消跟随交易员post获取我的交易员列表get查询最大/最小跟随下单数量get
经典账户 · 合约跟单 · 跟单员 API
经典账户 · 合约跟单 · 跟单员 API

跟单 · 合约跟单 · 跟单员

经典账户 — 跟单 · 合约跟单 · 跟单员


新版跟随者跟单设置接口

POST
https://api.bitget.com
/api/v2/copy/mix-follower/copy-settings

限频规则: 1次/秒/UID

该接口用于新版跟随者进行跟单设置,本期接口仅支持智能比例,暂不支持多元探索

新版跟随者条件 2024-01-26之后注册的用户,或2024-01-26之前注册且手动升级过的用户

新版跟随者跟单设置接口 › Request Parameters

traderId
​string · required

交易员ID

copyAmount
​string · required

跟单金额

正整数,不小于50,单位为USDT

copyAllPostions
​string

是否自动跟随交易员仓位

yes自动跟随 no不自动跟随 如不传,默认值为no,不自动跟随。

一次性行为。如选择yes自动跟随,则会根据交易员已有仓位,以市价开仓进行跟单

autoCopy
​string

是否自动跟随交易员新开的新币对

on自动跟随 off不自动跟随 - 如不传,默认值为on,自动跟随

equityGuardian
​string

净值守护者开关

on开启 off关闭 - 如不传,默认值为off关闭

equityGuardianMode
​string

净值守护者模式

amount数额 percentage百分比 - 当equityGuardian=on时,该字段生效 - 如不传,默认值为amount

equity
​string

守护触发净值

即达到该净值亏损时,跟单关系自动取消。所有订单将会以市价平仓,剩余资产将划转至合约账户

当净值守护者开关开启,即equityGuardian=on时,该字段必填

equityGuardianMode=amount时,该字段表示净值亏损数额

equityGuardianMode=percentage时,该字段表示净值亏损百分比

marginMode
​string

保证金模式

follow_trader跟随交易员

crossed_margin全仓杠杆模式

isolated_margin逐仓杠杆模式

如不传,默认值为follow_trader

leverage
​string

杠杆模式

follow_trader跟随交易员

fixed_leverage固定杠杆

marginMode=follow_trader时,该参数生效,用户可自行选择杠杆模式。如不传,默认值为follow_trader

marginMode=cross_margin或marginMode=isolated_margin时,接口会忽略入参,一律按照fixed_leverage处理

multiple
​string

杠杆倍数

正整,范围为[1, 125]

如不传,默认值为10

当leverage=fixed_leverage时,该参数生效

新版跟随者跟单设置接口 › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
data
​string

success设置成功

failure设置失败

POST/api/v2/copy/mix-follower/copy-settings
curl https://api.bitget.com/api/v2/copy/mix-follower/copy-settings \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "traderId": "traderId", "copyAmount": "copyAmount", "copyAllPostions": "copyAllPostions", "autoCopy": "autoCopy", "equityGuardian": "equityGuardian", "equityGuardianMode": "equityGuardianMode", "equity": "equity", "marginMode": "marginMode", "leverage": "leverage", "multiple": "multiple" }'
Example Request Body
{ "traderId": "traderId", "copyAmount": "copyAmount", "copyAllPostions": "copyAllPostions", "autoCopy": "autoCopy", "equityGuardian": "equityGuardian", "equityGuardianMode": "equityGuardianMode", "equity": "equity", "marginMode": "marginMode", "leverage": "leverage", "multiple": "multiple" }
json
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1695872676719, "data": "success" }
json
application/json

跟随者查询当前跟单信息

GET
https://api.bitget.com
/api/v2/copy/mix-follower/query-current-orders

限频规则:5次/秒/UID

跟随者查询当前跟单信息 › Request Parameters

productType
​string · required

产品类型

USDT-FUTURES U本位合约

COIN-FUTURES 币本位合约

USDC-FUTURES USDC合约

idLessThan
​string

请求此ID之前(更旧的数据)的分页内容,传的值为对应接口的 endId。

idGreaterThan
​string

请求此ID之后(更新的数据)的分页内容,传的值为对应接口的 endId

startTime
​string

开始时间戳

Unix时间戳的毫秒数格式,如 1597026383085

(时间跨度最大支持三个月,若不传结束时间,则默认结束时间为三个月。)

endTime
​string

结束时间戳

Unix时间戳的毫秒数格式,如 1597026383085

(时间跨度最大支持三个月,若不传开始时间,则默认开始时间为三个月。)

limit
​string

查询条数 默认20,最大100

symbol
​string

交易币对,支持大小写

traderId
​string

交易员id

跟随者查询当前跟单信息 › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
​object[]

当前跟单记录列表

endId
​string

最后一条跟单订单ID

用于 idLessThan/idGreaterThan 分页查询

GET/api/v2/copy/mix-follower/query-current-orders
curl 'https://api.bitget.com/api/v2/copy/mix-follower/query-current-orders?productType=<string>'
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1695807474823, "data": { "trackingList": [ { "trackingNo": "1", "traderId": "**********", "openOrderId": "1", "closeOrderId": "", "symbol": "BTCUSDT", "posSide": "long", "openLeverage": "20", "openPriceAvg": "26248.9", "openTime": "1695801596651", "openSize": "0.2258000000000000", "openFee": "-5.92700162", "openMarginSz": "296.350081", "closePriceAvg": "", "closeSize": "0", "closeTime": "0", "traderName": "XXX" } ], "endId": "1" } }
json
application/json

跟随者查询历史跟单信息

GET
https://api.bitget.com
/api/v2/copy/mix-follower/query-history-orders

限频规则:5次/秒/UID

跟随者查询历史跟单信息 › Request Parameters

productType
​string · required

产品类型

USDT-FUTURES U本位合约

COIN-FUTURES 币本位合约

USDC-FUTURES USDC合约

idLessThan
​string

请求此ID之前(更旧的数据)的分页内容,传的值为对应接口的 endId。

idGreaterThan
​string

请求此ID之后(更新的数据)的分页内容,传的值为对应接口的 endId

startTime
​string

开始时间戳

Unix时间戳的毫秒数格式,如 1597026383085

(时间跨度最大支持三个月,若不传结束时间,则默认结束时间为三个月。)

endTime
​string

结束时间戳

Unix时间戳的毫秒数格式,如 1597026383085

(时间跨度最大支持三个月,若不传开始时间,则默认开始时间为三个月。)

limit
​string

查询条数 默认100,最大100

symbol
​string

交易币对,支持大小写

traderId
​string

交易员id

跟随者查询历史跟单信息 › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
​object[]

跟单记录集合

endId
​string

最后的跟踪订单id。指定idLessThan/idGreaterThan作为范围查询时以此为准。

GET/api/v2/copy/mix-follower/query-history-orders
curl 'https://api.bitget.com/api/v2/copy/mix-follower/query-history-orders?productType=<string>'
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1695808417159, "data": { "trackingList": [ { "trackingNo": "123123123123", "posSide": "long", "openLeverage": "20", "openSize": "0.1852", "closeSize": "0.1852", "openPriceAvg": "32000.5", "closePriceAvg": "28233.0", "achievedPL": "-697.74100000", "openFee": "-5.92649260", "closeFee": "-5.22875160", "symbol": "BTCUSDT", "profitRate": "-235.47", "netProfit": "-697.74100000", "openOrderId": "1", "closeOrderId": "1", "openTime": "1695176941362", "closeTime": "1695353868557", "traderId": "**********", "productType": "usdt-futures" } ], "endId": "" } }
json
application/json

跟随者设置仓位止盈止损

POST
https://api.bitget.com
/api/v2/copy/mix-follower/setting-tpsl

限频规则:5次/秒/UID

跟随者设置仓位止盈止损 › Request Parameters

trackingNo
​string · required

跟单号

productType
​string · required

产品类型

USDT-FUTURES U本位合约

COIN-FUTURES 币本位合约

USDC-FUTURES USDC合约

symbol
​string

交易对

stopSurplusPrice
​string

止盈价

为空时,不管存不存在止盈都忽略或不更新,

为0时,若存在止盈则表示取消原有止盈。

大于等于0时,则表示更新或设置止盈。

stopLossPrice
​string

止损价

为空时,不管存不存在止损都忽略或不更新,

为0时,若存在止损则表示取消原有止损。

大于等于0时,则表示更新或设置止损。

跟随者设置仓位止盈止损 › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
data
​string

结果

success 成功;fail 失败

POST/api/v2/copy/mix-follower/setting-tpsl
curl https://api.bitget.com/api/v2/copy/mix-follower/setting-tpsl \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "trackingNo": "trackingNo", "symbol": "symbol", "productType": "productType", "stopSurplusPrice": "stopSurplusPrice", "stopLossPrice": "stopLossPrice" }'
Example Request Body
{ "trackingNo": "trackingNo", "symbol": "symbol", "productType": "productType", "stopSurplusPrice": "stopSurplusPrice", "stopLossPrice": "stopLossPrice" }
json
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1695812312921, "data": "success" }
json
application/json

跟单员平仓

POST
https://api.bitget.com
/api/v2/copy/mix-follower/close-positions

限频规则: 5次/秒/UID

跟单员平仓接口。可根据单号、币对、方向、仓位模式、保证金平仓

跟单员平仓 › Request Parameters

productType
​string · required

产品类型

USDT-FUTURES U本位合约

COIN-FUTURES 币本位合约

USDC-FUTURES USDC合约

trackingNo
​string

跟单号

(如若传递单号,且保证交易对、保证金币种、仓位模式、持仓方向四者其中不为空时,需保证单号和其相呼应。)

symbol
​string

交易对

marginCoin
​string

保证金币种

marginMode
​string

仓位模式

isolated 逐仓

cross 全仓

holdSide
​string

持仓方向

1.买卖(单向持仓)模式下:可不填,若填则忽略。

2.开平仓模式(双向持仓)下: 必须填写此参数。

long:多仓

short:空仓

跟单员平仓 › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
orderIdList
​string[]

订单Id

POST/api/v2/copy/mix-follower/close-positions
curl https://api.bitget.com/api/v2/copy/mix-follower/close-positions \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "productType": "productType", "trackingNo": "trackingNo", "symbol": "symbol", "marginCoin": "marginCoin", "marginMode": "marginMode", "holdSide": "holdSide" }'
Example Request Body
{ "productType": "productType", "trackingNo": "trackingNo", "symbol": "symbol", "marginCoin": "marginCoin", "marginMode": "marginMode", "holdSide": "holdSide" }
json
Example Responses
{ "code": "00000", "data": { "orderIdList": [ "123", "321" ] }, "msg": "success", "requestTime": 1627293504612 }
json
application/json

跟随者查看跟单设置

GET
https://api.bitget.com
/api/v2/copy/mix-follower/query-settings

限频规则: 5次/秒/UID

跟随者查看跟单设置 › Request Parameters

traderId
​string · required

跟单的交易员ID

跟随者查看跟单设置 › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
followerEnable
​string

我是否在跟随

YES 是

NO 否

​object[]

跟单详情

GET/api/v2/copy/mix-follower/query-settings
curl 'https://api.bitget.com/api/v2/copy/mix-follower/query-settings?traderId=<string>'
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1679465100798, "data": { "followerEnable": "Yes", "detailList": [ { "symbol": "ETHUSDT", "productType": "USDT-FUTURES", "marginType": "specify", "marginCoin": "USDT", "leverType": "trader", "longLeverage": "20", "shortLeverage": "20", "traceType": "percent", "traceValue": "1", "maxHoldSize": "50000", "stopSurplusRatio": "200", "stopLossRatio": "" } ] } }
json
application/json

跟单设置

POST
https://api.bitget.com
/api/v2/copy/mix-follower/settings

限频规则: 5次/秒/UID

跟单设置 › Request Parameters

traderId
​string · required

跟单的交易员ID

​object[] · required

跟单的设置(按照交易对)

最大为10

autoCopy
​string

是否自动跟随交易员新开的新币对(只在普通模式生效)

on:自动跟随

off:不自动跟随

mode
​string

跟单模式

basic:普通模式

advanced(默认值):高级模式

跟单设置 › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
data
​string

结果

success 成功

fail 失败

POST/api/v2/copy/mix-follower/settings
curl https://api.bitget.com/api/v2/copy/mix-follower/settings \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "traderId": "traderId", "autoCopy": "autoCopy", "mode": "mode", "settings": [ { "symbol": "symbol", "productType": "productType", "marginType": "marginType", "marginCoin": "marginCoin", "leverType": "leverType", "longLeverage": "longLeverage", "shortLeverage": "shortLeverage", "traceType": "traceType", "traceValue": "traceValue", "maxHoldSize": "maxHoldSize", "stopSurplusRatio": "stopSurplusRatio", "stopLossRatio": "stopLossRatio" } ] }'
Example Request Body
{ "traderId": "traderId", "autoCopy": "autoCopy", "mode": "mode", "settings": [ { "symbol": "symbol", "productType": "productType", "marginType": "marginType", "marginCoin": "marginCoin", "leverType": "leverType", "longLeverage": "longLeverage", "shortLeverage": "shortLeverage", "traceType": "traceType", "traceValue": "traceValue", "maxHoldSize": "maxHoldSize", "stopSurplusRatio": "stopSurplusRatio", "stopLossRatio": "stopLossRatio" } ] }
json
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1695809764463, "data": "success" }
json
application/json

跟随者取消跟随交易员

POST
https://api.bitget.com
/api/v2/copy/mix-follower/cancel-trader

限频规则: 5次/秒/UID

跟随者取消跟随交易员 › Request Parameters

traderId
​string · required

交易员uid

跟随者取消跟随交易员 › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
data
​string

结果

success 成功

fail 失败

POST/api/v2/copy/mix-follower/cancel-trader
curl https://api.bitget.com/api/v2/copy/mix-follower/cancel-trader \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "traderId": "traderId" }'
Example Request Body
{ "traderId": "traderId" }
json
Example Responses
{ "code": "00000", "data": "success", "msg": "success", "requestTime": 1627354109502 }
json
application/json

获取我的交易员列表

GET
https://api.bitget.com
/api/v2/copy/mix-follower/query-traders

限频规则: 5次/秒/UID

获取我的交易员列表 › Request Parameters

startTime
​string

开始时间戳

Unix时间戳的毫秒数格式,如 1597026383085

(时间跨度最大支持三个月,若不传结束时间,则默认结束时间为三个月。)

endTime
​string

结束时间戳

Unix时间戳的毫秒数格式,如 1597026383085

(时间跨度最大支持三个月,若不传开始时间,则默认开始时间为三个月。)

pageNo
​string

当前页号

默认为1.

pageSize
​string

查询数量

默认为20条,最大支持50条。

获取我的交易员列表 › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object[]
certificationType
​string

认证类型

uncertified 未认证

certified 已认证

traderId
​string

交易员ID

traderName
​string

昵称

maxFollowLimit
​string

最大可跟人数

bgbMaxFollowLimit
​string

bgb特殊跟随最大可跟人数

followCount
​string

当前已跟人数

bgbFollowCount
​string

bgb特殊跟随当前已跟人数

traceTotalMarginAmount
​string

累计开仓保证金

traceTotalNetProfit
​string

累计净收益

traceTotalProfit
​string

累计总收益

currentTradingPairs
​string[]

当前带单 交易对

followerTime
​string

跟随日期(以初次跟随日期为准)

Unix时间戳的毫秒数格式,如 1597026383085

GET/api/v2/copy/mix-follower/query-traders
curl https://api.bitget.com/api/v2/copy/mix-follower/query-traders
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1695812788826, "data": [ { "certificationType": "Uncertified", "traderId": "**********", "traderName": "x-1111111", "maxFollowLimit": "1000", "followCount": "0", "traceTotalMarginAmount": "1185.3286", "traceTotalNetProfit": "-744.7362", "traceTotalProfit": "-698.0210", "currentTradingPairs": [ "BTCUSDT", "BTCUSD", "EOSUSDT", "ETHUSDT", "ETHUSD" ], "followerTime": "1693381832000", "bgbMaxFollowLimit": "100", "bgbFollowCount": "0" } ] }
json
application/json

查询最大/最小跟随下单数量

GET
https://api.bitget.com
/api/v2/copy/mix-follower/query-quantity-limit

限速规则: 10次/1s (ip)

查询最大/最小跟随下单数量 › Request Parameters

productType
​string · required

产品类型

USDT-FUTURES U本位合约

COIN-FUTURES 币本位合约

USDC-FUTURES USDC合约

symbol
​string

交易对

查询最大/最小跟随下单数量 › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object[]
maxFollowSize
​string

最大下单量(交易币)

minFollowSize
​string

最小下单量(交易币)

symbol
​string

交易对名称

GET/api/v2/copy/mix-follower/query-quantity-limit
curl 'https://api.bitget.com/api/v2/copy/mix-follower/query-quantity-limit?productType=<string>'
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1695812926981, "data": [ { "maxFollowSize": "20000", "minFollowSize": "0.005", "symbol": "BTCUSDT" } ] }
json
application/json