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

GET /v5/okx-copy-trading/traders

OKX's USDT perpetual lead traders, best first, with their last 90 days.

Query parameters

NameTypeDescription
sortByenumdefault overviewoverview is OKX's own blend; roi and winRate only rank the traders OKX deems eligibleoverview, pnl, roi, aum, winRate
pageintdefault 1Page number
rowsintdefault 20Rows per page1 to 20

Response fields, in data

FieldTypeDescription
traders[]alwaysarray
traders[].traderIdalwaysstringThe trader's id at the source; other operations take it as traderId
traders[].namealwaysstringDisplay 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[].copiersnumberCurrent copiers
traders[].maxCopiersnumber
traders[].totalCopiersnumberEveryone who ever copied
hasMorealwaysbooleantrue when another page follows

Example

curl -H "X-API-KEY: $KOPYON_KEY" \
  "https://api.kopyon.com/v5/okx-copy-trading/traders"
{
  "data": {
    "traders": [
      {
        "traderId": "762940277354284613",
        "name": "JohnBread49",
        "avatarUrl": "https://static.okx.com/cdn/okex/users/headimages/20261017/3dbbe6b78a4f4b9699bbe6c1a7cbad23",
        "roi": 17.413,
        "pnl": 160806.84084571613,
        "pnlCurrency": "USDT",
        "aum": 167992.84553226767,
        "winRate": 0.6375,
        "copiers": 50,
        "maxCopiers": 50,
        "totalCopiers": 131,
        "sourceDetails": {
          "leadDays": 80,
          "symbols": [
            "ICPUSDT",
            "MINAUSDT",
            "NEIROUSDT"
          ],
          "chart": {
            "metric": "ROI",
            "points": [
              {
                "timestamp": 1785340800000,
                "value": 0
              },
              {
                "timestamp": 1785513600000,
                "value": -0.0478
              },
              {
                "timestamp": 1785686400000,
                "value": 0.109
              }
            ]
          }
        }
      },
      {
        "traderId": "811846999954962957",
        "name": "IS.K",
        "avatarUrl": "https://static.okx.com/cdn/okex/users/headimages/20260820/6e5962ac567047ce8a8e3ab899984d84",
        "roi": 4.6467,
        "pnl": 123549.22921052856,
        "pnlCurrency": "USDT",
        "aum": 48761.70084873206,
        "winRate": 0.5667,
        "copiers": 8,
        "maxCopiers": 301,
        "totalCopiers": 14,
        "sourceDetails": {
          "leadDays": 174,
          "symbols": [
            "ICPUSDT",
            "MINAUSDT",
            "NEIROUSDT"
          ],
          "chart": {
            "metric": "ROI",
            "points": [
              {
                "timestamp": 1784476800000,
                "value": 0
              },
              {
                "timestamp": 1784908800000,
                "value": 0.1335
              },
              {
                "timestamp": 1785340800000,
                "value": 0.0781
              }
            ]
          }
        }
      },
      {
        "traderId": "CA1C48E543EF7A95",
        "name": "01pp",
        "avatarUrl": "https://static.okx.com/cdn/okex/users/headimages/20260909/79744e7a3694435fb6853186389a6f7f",
        "roi": 3.9061,
        "pnl": 207562.70662224127,
        "pnlCurrency": "USDT",
        "aum": 625696.2666851248,
        "winRate": 0.5056,
        "copiers": 510,
        "maxCopiers": 600,
        "totalCopiers": 1399,
        "sourceDetails": {
          "leadDays": 230,
          "symbols": [
            "HYPEUSDT"
          ],
          "chart": {
            "metric": "ROI",
            "points": [
              {
                "timestamp": 1784476800000,
                "value": 0
              },
              {
                "timestamp": 1784908800000,
                "value": 0.0764
              },
              {
                "timestamp": 1785340800000,
                "value": 0.5081
              }
            ]
          }
        }
      }
    ],
    "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

NameTypeDescription
traderIdrequiredstringThe lead trader's unique code, from traders

Response fields, in data

FieldTypeDescription
traderIdalwaysstring
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=762940277354284613"
{
  "data": {
    "traderId": "762940277354284613",
    "name": "JohnBread49",
    "avatarUrl": "https://static.coinall.ltd/cdn/okex/users/headimages/20261017/3dbbe6b78a4f4b9699bbe6c1a7cbad23",
    "bio": "你好,听说过麦门吗?\n这里是桂系金拱門哦~\nBa la ba ba ba~欢迎光临麦当当,请自助点单哦~\n\n十三年 A 股交易经验,具备较丰富盘感与策略体系。\n\n不建议市价复制仓位哦\n仓位结构上,部分多空双开,部分稳健持仓。\n\n跟单若因滑点未成交,不必纠结;我不会一次打满,错过即错过。\n\n风险敞口合理控制,追求账户长期稳健。",
    "aum": 168533.51814838842,
    "copiers": 50,
    "maxCopiers": 50,
    "totalCopiers": 136,
    "profitShare": 0.06,
    "sourceDetails": {
      "translatedBio": "Hello, have you heard of Mai Men?\nThis is the Gui faction's Golden Arches~\nBa la ba ba ba~ Welcome to McDonDon, please order by yourself~\n\nThirteen years of A-share trading experience, with relatively rich market intuition and strategy system.\n\nMarket price copying of positions is not recommended.\nIn terms of position structure, some are long and short dual positions, some are stable holdings.\n\nIf an order is not executed due to slippage when following, don't worry; I won't fill the order all at once, if missed, then missed.\n\nRisk exposure is reasonably controlled, aiming for long-term stable account growth.",
      "level": "Lvl 0",
      "followers": 43,
      "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

NameTypeDescription
traderIdrequiredstringThe lead trader's unique code, from traders
periodrequiredenumDays the figures cover7D, 30D, 90D, 1Y

Response fields, in data

FieldTypeDescription
periodalwaysstring
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=762940277354284613&period=7D"
{
  "data": {
    "period": "7D",
    "winRate": 1,
    "copierPnl": 16512.99713715691,
    "sourceDetails": {
      "profitDays": 7,
      "lossDays": 0,
      "invested": 81671.68272882834,
      "avgPositionNotional": 9161.4102,
      "currency": "USDT",
      "coins": [
        {
          "coin": "SPCX",
          "share": 0.4174
        },
        {
          "coin": "ZEC",
          "share": 0.4041
        },
        {
          "coin": "Other",
          "share": 0.062100000000000044
        }
      ]
    }
  }
}

Chart

GET /v5/okx-copy-trading/traderChart

The trader's cumulative PnL or ROI, one point a day, oldest first.

Query parameters

NameTypeDescription
traderIdrequiredstringThe lead trader's unique code, from traders
periodrequiredenumDays the figures cover7D, 30D, 90D, 1Y
metricenumdefault PNLCumulative PnL or ROI since the period beganPNL, ROI

Response fields, in data

FieldTypeDescription
metricalwaysstringWhat the points measure: ROI, PNL or BALANCE
points[]alwaysarray
points[].timestampalwaysnumberPoint time, in Unix milliseconds
points[].valuealwaysnumber

Example

curl -H "X-API-KEY: $KOPYON_KEY" \
  "https://api.kopyon.com/v5/okx-copy-trading/traderChart?traderId=762940277354284613&period=7D"
{
  "data": {
    "metric": "PNL",
    "points": [
      {
        "timestamp": 1791734400000,
        "value": 0
      },
      {
        "timestamp": 1791820800000,
        "value": 13733.389011877145
      },
      {
        "timestamp": 1791907200000,
        "value": 28217.75592028716
      }
    ]
  }
}

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

NameTypeDescription
traderIdrequiredstringThe lead trader's unique code, from traders

Response fields, in data

FieldTypeDescription
positions[]alwaysarray
positions[].symbolalwaysstring
positions[].sidealwaysLONG | SHORT
positions[].sizenumberPosition size, always positive; side gives the direction
positions[].entryPricealwaysnumber
positions[].markPricenumberThe exchange's mark price
positions[].leveragenumber
positions[].marginModeISOLATED | CROSS
positions[].unrealizedPnlnumberIn pnlCurrency
positions[].pnlCurrencystring
positions[].liquidationPricenumber
positions[].marginnumberMargin the position uses, in pnlCurrency
positions[].roinumberunrealizedPnl 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
hiddenalwaysbooleantrue when OKX hides some or all of them
hiddenPositionsnumberHow 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=CA1C48E543EF7A95"
{
  "data": {
    "positions": [
      {
        "symbol": "XRPUSDT",
        "side": "LONG",
        "size": 77283,
        "entryPrice": 1.3111813374222014,
        "markPrice": 1.2705,
        "leverage": 15,
        "marginMode": "ISOLATED",
        "unrealizedPnl": -3143.9757999999983,
        "pnlCurrency": "USDT",
        "positionId": "4012165130171781120",
        "margin": 6755.468486666667,
        "openedAt": 1792074238682,
        "roi": -0.4653971528703435,
        "sourceDetails": {}
      },
      {
        "symbol": "MSTRUSDT",
        "side": "LONG",
        "size": 1000,
        "entryPrice": 139.8852944,
        "markPrice": 135.51,
        "leverage": 15,
        "marginMode": "ISOLATED",
        "unrealizedPnl": -4375.2944,
        "pnlCurrency": "USDT",
        "positionId": "4012161531895156736",
        "margin": 9325.686293333334,
        "openedAt": 1792074131445,
        "roi": -0.4691659425781635,
        "sourceDetails": {}
      },
      {
        "symbol": "CRCLUSDT",
        "side": "LONG",
        "size": 1000,
        "entryPrice": 79.488673,
        "markPrice": 81.52,
        "leverage": 13,
        "marginMode": "ISOLATED",
        "unrealizedPnl": 2031.327,
        "pnlCurrency": "USDT",
        "positionId": "4012161060858040320",
        "margin": 6114.5133076923075,
        "openedAt": 1792074117407,
        "roi": 0.3322140124291677,
        "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

NameTypeDescription
traderIdrequiredstringThe lead trader's unique code, from traders
cursorstringThe nextCursor of the previous answer; leave it out for the first page
rowsintdefault 20Rows per page1 to 100

Response fields, in data

FieldTypeDescription
positions[]alwaysarray
positions[].positionIdstring
positions[].symbolalwaysstring
positions[].sideLONG | SHORT
positions[].statusstring
positions[].marginModeISOLATED | CROSS
positions[].leveragenumber
positions[].roinumber
positions[].entryPricenumber
positions[].closePricenumber
positions[].openedAtalwaysnumberWhen the position opened, in Unix milliseconds
positions[].closedAtnumberWhen the position closed, in Unix milliseconds
positions[].updatedAtalwaysnumberLast change, in Unix milliseconds
positions[].openedVolumenumber
positions[].closedVolumenumber
positions[].maxOpenInterestnumber
positions[].grossPnlnumber
positions[].fundingPnlnumber
positions[].tradingFeenumber
positions[].liquidationFeenumber
positions[].netPnlnumber
positions[].pnlCurrencystring
positions[].marginnumber
hiddenalwaysbooleantrue when the trader hides their history from non-copiers
nextCursorstringSend 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=762940277354284613"
{
  "data": {
    "positions": [
      {
        "positionId": "4015194688399671296",
        "symbol": "QQQUSDT",
        "side": "SHORT",
        "status": "CLOSED",
        "marginMode": "CROSS",
        "leverage": 40,
        "roi": 0.2373415494600248,
        "entryPrice": 718.55,
        "closePrice": 714,
        "openedAt": 1792164526553,
        "closedAt": 1792171808895,
        "updatedAt": 1792171808895,
        "closedVolume": 32,
        "grossPnl": 136.43341629160068,
        "pnlCurrency": "USDT",
        "margin": 574.84,
        "sourceDetails": {}
      },
      {
        "positionId": "4015190350952464384",
        "symbol": "SPCXUSDT",
        "side": "LONG",
        "status": "CLOSED",
        "marginMode": "CROSS",
        "leverage": 40,
        "roi": 0.3005850103775859,
        "entryPrice": 145.41549550561797,
        "closePrice": 146.59,
        "openedAt": 1792164397287,
        "closedAt": 1792165367141,
        "updatedAt": 1792165367141,
        "closedVolume": 89,
        "grossPnl": 97.254123052,
        "pnlCurrency": "USDT",
        "margin": 323.5494775,
        "sourceDetails": {}
      },
      {
        "positionId": "4014958390606888960",
        "symbol": "SPCXUSDT",
        "side": "LONG",
        "status": "CLOSED",
        "marginMode": "CROSS",
        "leverage": 40,
        "roi": 0.5661935198006092,
        "entryPrice": 144.44,
        "closePrice": 146.54,
        "openedAt": 1792157508787,
        "closedAt": 1792160902138,
        "updatedAt": 1792160902138,
        "closedVolume": 89,
        "grossPnl": 181.9627072,
        "pnlCurrency": "USDT",
        "margin": 321.379,
        "sourceDetails": {}
      }
    ],
    "hidden": false,
    "nextCursor": "OWI3MzAxYTAxMDc4NGQ4ZS40MDEwNzE2MzUzNzQ5NjQ3MzYw"
  }
}

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

NameTypeDescription
traderIdrequiredstringThe lead trader's unique code, from traders
cursorstringThe nextCursor of the previous answer; leave it out for the first page
rowsintdefault 20Rows per page1 to 100

Response fields, in data

FieldTypeDescription
orders[]alwaysarray
orders[].symbolalwaysstring
orders[].sidealwaysstring
orders[].positionSidestringBOTH in one-way mode; LONG or SHORT in hedge mode
orders[].pricenumber
orders[].quantitynumber
orders[].quoteQuantitynumber
orders[].createdAtnumberWhen the order was placed, in Unix milliseconds
orders[].updatedAtalwaysnumberLast change, in Unix milliseconds
orders[].orderTypestringFor example MARKET or LIMIT
orders[].orderIdstring
orders[].leveragenumber
hiddenalwaysbooleantrue when the trader hides their orders from non-copiers
nextCursorstringSend 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=762940277354284613"
{
  "data": {
    "orders": [
      {
        "symbol": "ZECUSDT",
        "side": "BUY",
        "positionSide": "SHORT",
        "price": 1088.3683,
        "quantity": 5,
        "quoteQuantity": 5441.8415,
        "createdAt": 1792333974205,
        "updatedAt": 1792333974206,
        "orderId": "4020880408140697600",
        "orderType": "market",
        "leverage": 40,
        "sourceDetails": {}
      },
      {
        "symbol": "ZECUSDT",
        "side": "BUY",
        "positionSide": "SHORT",
        "price": 1097.31968,
        "quantity": 5,
        "quoteQuantity": 5486.5984,
        "createdAt": 1792333906351,
        "updatedAt": 1792333906353,
        "orderId": "4020878131338268680",
        "orderType": "market",
        "leverage": 40,
        "sourceDetails": {}
      },
      {
        "symbol": "SQQQUSDT",
        "side": "BUY",
        "positionSide": "SHORT",
        "price": 39.68472,
        "quantity": 50,
        "quoteQuantity": 1984.236,
        "createdAt": 1792332270832,
        "updatedAt": 1792332270833,
        "orderId": "4020823252427198464",
        "orderType": "market",
        "leverage": 8,
        "sourceDetails": {}
      }
    ],
    "hidden": false,
    "nextCursor": "ZDU1Mzc5M2NmODU1Mzg4OS4xNzkyMTc5ODkxNTgy"
  }
}

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 change
  • positionEvents: Opened, increased, decreased, closed
  • orderHistory: New and updated orders
  • positionHistory: Newly closed positions

Stream messages and webhook signatures

Try the OKX Copy Trading API for free.

The free tier is 10,000 requests a month. That is enough to build a whole integration and test it against live data before you pay anything.

Usually answered within a day · [email protected]