API reference · v5 OKX Copy Trading API OKX Copy Trading lead traders: rankings, profiles, performance, open positions, closed positions and executed orders.
Base URL https://api.kopyon.com/v5/okx-copy-trading/ · send your key in the X-API-KEY header · trader id: The code at the end of a lead trader's OKX URL.
Get a free API key · Interactive reference with Try it · Authentication, paging and errors
traders TraderstraderProfile Trader profileperformance PerformancetraderChart ChartopenPositions Open positionspositionHistory Position historyorderHistory Order historyTraders GET /v5/okx-copy-trading/traders
OKX's USDT perpetual lead traders, best first, with their last 90 days.
Query parameters Name Type Description sortByenumdefault overview overview is OKX's own blend; roi and winRate only rank the traders OKX deems eligibleoverview, pnl, roi, aum, winRate pageintdefault 1 Page number rowsintdefault 20 Rows per page1 to 20
Response fields, in data Field Type Description traders[]always array traders[].traderIdalways string The trader's id at the source; other operations take it as traderId traders[].namealways string Display name traders[].avatarUrlstring traders[].roinumber traders[].pnlnumber traders[].pnlCurrencystring traders[].sourceDetails.leadDaysonly OKX traders[].sourceDetails.symbolsonly OKX traders[].sourceDetails.chartonly OKX traders[].aumnumber traders[].winRatenumber traders[].copiersnumber Current copiers traders[].maxCopiersnumber traders[].totalCopiersnumber Everyone who ever copied hasMorealways boolean true when another page follows
Example curl -H "X-API-KEY: $KOPYON_KEY" \
"https://api.kopyon.com/v5/okx-copy-trading/traders" {
"data" : {
"traders" : [
{
"traderId" : "9F25A5FBE6CFF912" ,
"name" : "Disti" ,
"avatarUrl" : "https://static.okx.com/cdn/okex/users/headimages/predefined/0026.png" ,
"roi" : 5.8842 ,
"pnl" : 190203.12437353565 ,
"pnlCurrency" : "USDT" ,
"aum" : 363668.7136055916 ,
"winRate" : 0.6429 ,
"copiers" : 588 ,
"maxCopiers" : 600 ,
"totalCopiers" : 693 ,
"sourceDetails" : {
"leadDays" : 56 ,
"symbols" : [
"ICPUSDT" ,
"MINAUSDT" ,
"NEIROUSDT"
],
"chart" : {
"metric" : "ROI" ,
"points" : [
{
"timestamp" : 1788624000000 ,
"value" : 0.0015
},
{
"timestamp" : 1788796800000 ,
"value" : 0.0299
},
{
"timestamp" : 1788969600000 ,
"value" : 0.0278
}
]
}
}
},
{
"traderId" : "762940277354284613" ,
"name" : "JohnBread49" ,
"avatarUrl" : "https://static.okx.com/cdn/okex/users/headimages/20261017/3dbbe6b78a4f4b9699bbe6c1a7cbad23" ,
"roi" : 20.4807 ,
"pnl" : 189136.79420261495 ,
"pnlCurrency" : "USDT" ,
"aum" : 529206.1028613528 ,
"winRate" : 0.6333 ,
"copiers" : 158 ,
"maxCopiers" : 300 ,
"totalCopiers" : 316 ,
"sourceDetails" : {
"leadDays" : 93 ,
"symbols" : [
"ICPUSDT" ,
"MINAUSDT" ,
"NEIROUSDT"
],
"chart" : {
"metric" : "ROI" ,
"points" : [
{
"timestamp" : 1785686400000 ,
"value" : 0
},
{
"timestamp" : 1786118400000 ,
"value" : 2.6403
},
{
"timestamp" : 1786550400000 ,
"value" : 4.0879
}
]
}
}
},
{
"traderId" : "F40E916BA37C82E2" ,
"name" : "Queenstown-Traders" ,
"avatarUrl" : "https://static.okx.com/cdn/okex/users/headimages/20250723/31ba1f08a5b947ef848e0be505d7d9df" ,
"roi" : 0.5406 ,
"pnl" : 85252.61677356304 ,
"pnlCurrency" : "USDT" ,
"aum" : 18438.666600729568 ,
"winRate" : 0.6923 ,
"copiers" : 110 ,
"maxCopiers" : 300 ,
"totalCopiers" : 364 ,
"sourceDetails" : {
"leadDays" : 137 ,
"symbols" : [
"ICPUSDT" ,
"MINAUSDT" ,
"NEIROUSDT"
],
"chart" : {
"metric" : "ROI" ,
"points" : [
{
"timestamp" : 1785686400000 ,
"value" : 0
},
{
"timestamp" : 1786118400000 ,
"value" : 0
},
{
"timestamp" : 1786550400000 ,
"value" : 0
}
]
}
}
}
],
"hasMore" : true
}
} Trader profile GET /v5/okx-copy-trading/traderProfile
The trader's name, bio, tier, copiers, assets under management and profit share.
Query parameters Name Type Description traderIdrequired string The lead trader's unique code, from traders
Response fields, in data Field Type Description traderIdalways string namestring avatarUrlstring biostring sourceDetails.translatedBioonly OKX sourceDetails.levelonly OKX sourceDetails.followersonly OKX sourceDetails.countryonly OKX sourceDetails.currencyonly OKX copiersnumber maxCopiersnumber totalCopiersnumber aumnumber profitSharenumber
Example curl -H "X-API-KEY: $KOPYON_KEY" \
"https://api.kopyon.com/v5/okx-copy-trading/traderProfile?traderId=9F25A5FBE6CFF912" {
"data" : {
"traderId" : "9F25A5FBE6CFF912" ,
"name" : "Disti" ,
"avatarUrl" : "https://static.coinall.ltd/cdn/okex/users/headimages/predefined/0026.png" ,
"bio" : "几天到一两个月周期。加油吧" ,
"aum" : 363668.7136055916 ,
"copiers" : 588 ,
"maxCopiers" : 600 ,
"totalCopiers" : 839 ,
"profitShare" : 0.07 ,
"sourceDetails" : {
"translatedBio" : "A few days to a month or two. Keep going" ,
"level" : "Lvl 2" ,
"followers" : 87 ,
"country" : "China" ,
"currency" : "USDT"
}
}
} Performance GET /v5/okx-copy-trading/performance
Win rate, profitable and losing days, what was invested and what copiers made over a period.
Query parameters Name Type Description traderIdrequired string The lead trader's unique code, from traders periodrequired enum Days the figures cover7D, 30D, 90D, 1Y
Response fields, in data Field Type Description periodalways string copierPnlnumber winRatenumber sourceDetails.profitDaysonly OKX sourceDetails.lossDaysonly OKX sourceDetails.investedonly OKX sourceDetails.avgPositionNotionalonly OKX sourceDetails.currencyonly OKX sourceDetails.coinsonly OKX
Example curl -H "X-API-KEY: $KOPYON_KEY" \
"https://api.kopyon.com/v5/okx-copy-trading/performance?traderId=9F25A5FBE6CFF912&period=7D" {
"data" : {
"period" : "7D" ,
"winRate" : 0.8571 ,
"copierPnl" : 31479.091591117023 ,
"sourceDetails" : {
"profitDays" : 6 ,
"lossDays" : 1 ,
"invested" : 163213.42189183063 ,
"avgPositionNotional" : 153678.0101 ,
"currency" : "USDT" ,
"coins" : [
{
"coin" : "Other" ,
"share" : 0.4083
},
{
"coin" : "BTC" ,
"share" : 0.2177
},
{
"coin" : "SNDK" ,
"share" : 0.1156
}
]
}
}
} Chart GET /v5/okx-copy-trading/traderChart
The trader's cumulative PnL or ROI, one point a day, oldest first.
Query parameters Name Type Description traderIdrequired string The lead trader's unique code, from traders periodrequired enum Days the figures cover7D, 30D, 90D, 1Y metricenumdefault PNL Cumulative PnL or ROI since the period beganPNL, ROI
Response fields, in data Field Type Description metricalways string What the points measure: ROI, PNL or BALANCE points[]always array points[].timestampalways number Point time, in Unix milliseconds points[].valuealways number
Example curl -H "X-API-KEY: $KOPYON_KEY" \
"https://api.kopyon.com/v5/okx-copy-trading/traderChart?traderId=9F25A5FBE6CFF912&period=7D" {
"data" : {
"metric" : "PNL" ,
"points" : [
{
"timestamp" : 1792857600000 ,
"value" : 0
},
{
"timestamp" : 1792944000000 ,
"value" : 3323.5
},
{
"timestamp" : 1793030400000 ,
"value" : 3813.070318778151
}
]
}
} Open positions GET /v5/okx-copy-trading/openPositions
The trader's open positions, up to 100. OKX hides the instrument, prices and size of some; those are only counted.
Query parameters Name Type Description traderIdrequired string The lead trader's unique code, from traders
Response fields, in data Field Type Description positions[]always array positions[].symbolalways string positions[].sidealways LONG | SHORT positions[].sizenumber Position size, always positive; side gives the direction positions[].entryPricealways number positions[].markPricenumber The exchange's mark price positions[].leveragenumber positions[].marginModeISOLATED | CROSS positions[].unrealizedPnlnumber In pnlCurrency positions[].pnlCurrencystring positions[].liquidationPricenumber positions[].marginnumber Margin the position uses, in pnlCurrency positions[].roinumber unrealizedPnl over margin, as a fraction. Where the exchange sends its own (KuCoin; BingX, over the opening margin), it is passed on and can differ from that ratio positions[].positionIdstring positions[].openedAtnumber hiddenalways boolean true when OKX hides some or all of them hiddenPositionsnumber How many OKX hides; a trader can hide some and show others. Absent when the trader hides all
Example curl -H "X-API-KEY: $KOPYON_KEY" \
"https://api.kopyon.com/v5/okx-copy-trading/openPositions?traderId=9F25A5FBE6CFF912" {
"data" : {
"positions" : [
{
"symbol" : "SNDKUSDT" ,
"side" : "LONG" ,
"size" : 30 ,
"entryPrice" : 1128.6 ,
"markPrice" : 1165.2 ,
"leverage" : 20 ,
"marginMode" : "CROSS" ,
"unrealizedPnl" : 1098 ,
"pnlCurrency" : "USDT" ,
"positionId" : "4055802414141878272" ,
"margin" : 1692.9 ,
"openedAt" : 1793374731087 ,
"roi" : 0.648591174906964 ,
"sourceDetails" : {}
},
{
"symbol" : "SNDKUSDT" ,
"side" : "LONG" ,
"size" : 25 ,
"entryPrice" : 1225.6 ,
"markPrice" : 1165.2 ,
"leverage" : 20 ,
"marginMode" : "CROSS" ,
"unrealizedPnl" : -1510 ,
"pnlCurrency" : "USDT" ,
"positionId" : "4053466904912277504" ,
"margin" : 4902.4 ,
"openedAt" : 1793305127488 ,
"roi" : -0.985639686684074 ,
"sourceDetails" : {}
},
{
"symbol" : "XRPUSDT" ,
"side" : "LONG" ,
"size" : 50000 ,
"entryPrice" : 1.248 ,
"markPrice" : 1.2478 ,
"leverage" : 20 ,
"marginMode" : "ISOLATED" ,
"unrealizedPnl" : -10 ,
"pnlCurrency" : "USDT" ,
"positionId" : "4052150843784900608" ,
"margin" : 3120 ,
"openedAt" : 1793265905810 ,
"roi" : -0.003205128205128 ,
"sourceDetails" : {}
}
],
"hidden" : false ,
"hiddenPositions" : 0
}
} Position history GET /v5/okx-copy-trading/positionHistory
Closed positions, newest first. A trader who hides their data has none to show (hidden).
Query parameters Name Type Description traderIdrequired string The lead trader's unique code, from traders cursorstring The nextCursor of the previous answer; leave it out for the first page rowsintdefault 20 Rows per page1 to 100
Response fields, in data Field Type Description positions[]always array positions[].positionIdstring positions[].symbolalways string positions[].sideLONG | SHORT positions[].statusstring positions[].marginModeISOLATED | CROSS positions[].leveragenumber positions[].roinumber positions[].entryPricenumber positions[].closePricenumber positions[].openedAtalways number When the position opened, in Unix milliseconds positions[].closedAtnumber When the position closed, in Unix milliseconds positions[].updatedAtalways number Last change, in Unix milliseconds positions[].openedVolumenumber positions[].closedVolumenumber positions[].maxOpenInterestnumber positions[].grossPnlnumber positions[].fundingPnlnumber positions[].tradingFeenumber positions[].liquidationFeenumber positions[].netPnlnumber positions[].pnlCurrencystring positions[].marginnumber hiddenalways boolean true when the trader hides their history from non-copiers nextCursorstring Send it back as cursor, with the same query, to read the next page; absent on the last page
Example curl -H "X-API-KEY: $KOPYON_KEY" \
"https://api.kopyon.com/v5/okx-copy-trading/positionHistory?traderId=9F25A5FBE6CFF912" {
"data" : {
"positions" : [
{
"positionId" : "4055816639878868992" ,
"symbol" : "SOXLUSDT" ,
"side" : "LONG" ,
"status" : "CLOSED" ,
"marginMode" : "CROSS" ,
"leverage" : 10 ,
"roi" : 0.7653558333333333 ,
"entryPrice" : 72 ,
"closePrice" : 77.55 ,
"openedAt" : 1793384239080 ,
"closedAt" : 1793440821882 ,
"updatedAt" : 1793440821882 ,
"closedVolume" : 100 ,
"grossPnl" : 551.0562 ,
"pnlCurrency" : "USDT" ,
"margin" : 720 ,
"sourceDetails" : {}
},
{
"positionId" : "4054155947622871040" ,
"symbol" : "SOXLUSDT" ,
"side" : "LONG" ,
"status" : "CLOSED" ,
"marginMode" : "CROSS" ,
"leverage" : 10 ,
"roi" : -0.3467984375 ,
"entryPrice" : 80 ,
"closePrice" : 77.25 ,
"openedAt" : 1793369678343 ,
"closedAt" : 1793470074877 ,
"updatedAt" : 1793470074877 ,
"closedVolume" : 100 ,
"grossPnl" : -277.43875 ,
"pnlCurrency" : "USDT" ,
"margin" : 800 ,
"sourceDetails" : {}
},
{
"positionId" : "4053588710319009792" ,
"symbol" : "ASTERUSDT" ,
"side" : "LONG" ,
"status" : "CLOSED" ,
"marginMode" : "ISOLATED" ,
"leverage" : 10 ,
"roi" : 0.4644049011106096 ,
"entryPrice" : 0.6731 ,
"closePrice" : 0.70487385 ,
"openedAt" : 1793319539761 ,
"closedAt" : 1793476273404 ,
"updatedAt" : 1793476273404 ,
"closedVolume" : 60000 ,
"grossPnl" : 1875.5456336253078 ,
"pnlCurrency" : "USDT" ,
"margin" : 4038.6 ,
"sourceDetails" : {}
}
],
"hidden" : false ,
"nextCursor" : "MDBmM2IwYzJmNzQyZmU2NC40MDMxMzEzMjkwNzYwNjMwMjcy"
}
} Order history GET /v5/okx-copy-trading/orderHistory
Executed perpetual orders, newest first, as OKX's profile lists them under Latest records. An unknown trader answers 404; one who hides their data has none to show (hidden).
Query parameters Name Type Description traderIdrequired string The lead trader's unique code, from traders cursorstring The nextCursor of the previous answer; leave it out for the first page rowsintdefault 20 Rows per page1 to 100
Response fields, in data Field Type Description orders[]always array orders[].symbolalways string orders[].sidealways string orders[].positionSidestring BOTH in one-way mode; LONG or SHORT in hedge mode orders[].pricenumber orders[].quantitynumber orders[].quoteQuantitynumber orders[].createdAtnumber When the order was placed, in Unix milliseconds orders[].updatedAtalways number Last change, in Unix milliseconds orders[].orderTypestring For example MARKET or LIMIT orders[].orderIdstring orders[].leveragenumber hiddenalways boolean true when the trader hides their orders from non-copiers nextCursorstring Send it back as cursor, with the same query, to read the next page; absent on the last page
Example curl -H "X-API-KEY: $KOPYON_KEY" \
"https://api.kopyon.com/v5/okx-copy-trading/orderHistory?traderId=9F25A5FBE6CFF912" {
"data" : {
"orders" : [
{
"symbol" : "ASTERUSDT" ,
"side" : "SELL" ,
"positionSide" : "BOTH" ,
"price" : 0.702 ,
"quantity" : 22515 ,
"quoteQuantity" : 15805.53 ,
"createdAt" : 1793476262532 ,
"updatedAt" : 1793476273395 ,
"orderId" : "4059209244132937728" ,
"orderType" : "limit" ,
"leverage" : 10 ,
"sourceDetails" : {}
},
{
"symbol" : "NEARUSDT" ,
"side" : "SELL" ,
"positionSide" : "BOTH" ,
"price" : 4.442 ,
"quantity" : 5000 ,
"quoteQuantity" : 22210 ,
"createdAt" : 1793476221676 ,
"updatedAt" : 1793476229103 ,
"orderId" : "4059207873233063936" ,
"orderType" : "limit" ,
"leverage" : 30 ,
"sourceDetails" : {}
},
{
"symbol" : "NEARUSDT" ,
"side" : "SELL" ,
"positionSide" : "BOTH" ,
"price" : 4.548 ,
"quantity" : 5000 ,
"quoteQuantity" : 22740 ,
"createdAt" : 1793471310216 ,
"updatedAt" : 1793471320533 ,
"orderId" : "4059043071982473216" ,
"orderType" : "limit" ,
"leverage" : 30 ,
"sourceDetails" : {}
}
],
"hidden" : false ,
"nextCursor" : "YjE2OTkyMDM1NzAxYmNjMS4xNzkzMjg0NTYxODM1"
}
} Stream and webhooks Paid plans can follow a trader in real time over wss://api.kopyon.com/v5/streamor through signed webhooks. Topics for this source:
openPositions: Open positions, whenever they changepositionEvents: Opened, increased, decreased, closedorderHistory: New and updated orderspositionHistory: Newly closed positionsStream messages and webhook signatures