OKX Copytrading Scraper avatar

OKX Copytrading Scraper

Try for free

3 days trial then $25.00/month - No credit card required now

Go to Store
OKX Copytrading Scraper

OKX Copytrading Scraper

epctex/okx-copytrading-scraper
Try for free

3 days trial then $25.00/month - No credit card required now

Unleash the power of OKX Copy Trading Scraper! Gather and analyze top user positions on the largest copy trading platform. Optimize your coin trading with advanced filtering and sorting features. Gain valuable insights for informed decisions.

Actor - OKX Copy Trading Scraper

OKX Copy Trading, is a popular copy trading platform of OKX cryptocurrency exchange, lacks a robust and freely accessible API. To bridge this gap, we present the OKX Copy Trading Scraper, designed to facilitate seamless data extraction and analysis from this popular copy trading platform.

  • Filter Traders with Advanced Search: Advanced search in the futures tab, not only by search type but also by filtering traders by their assets, AUM, win rate and many other parameters.

  • Account Information Scraping with Performance Statistics: In addition to traders' account information, get detailed statistics on both futures and personal performance.

  • Ongoing Orders Scraping: Get detailed information about traders' active ongoing orders, including which coins they are trading, how many assets they are trading, how many X leverage they are using and more.

  • Ongoing Orders History Scraping: If you want to scrape the history of traders' ongoing orders, you can also get all the trades they have made in the past, down to the date and time they opened and closed the position, again in detail and effortlessly.

Bugs, fixes, updates, and changelog

This scraper is under active development. If you have any feature requests you can create an issue from here.

Input Parameters

The input of this scraper should be JSON containing the list of pages on OKX Copy Trading that should be visited. Required fields are:

  • startUrls: (Optional) (Array) List of OKX Trading Influencers URLs.

  • endPage: (Optional) (Number) Final number of page that you want to scrape. The default is Infinite. This applies to all search requests and startUrls individually.

  • maxItems: (Optional) (Number) You can limit scraped items. This should be useful when you search through the big lists or search results.

  • searchType: (Optional) (String) Keyword by which type you want to filter and search users in the futures section of OKX Copy Trading.

    • overview: Search by Overview
    • yieldRatio: Search by PnL%
    • pnl: Search by PnL
    • winRatio: Search by Win rate
    • aum: Search by AUM
    • traderFollowerLimit: Search by No. of copy traders
    • followTotalPnl: Search by Copy trader PnL
  • leaderHasVacancies: (Optional) (Boolean) If you want to search users with vacancies, you can set true. Default setting is false.

  • allowApiTraders: (Optional) (Boolean) If you want to search API traders, you can set true. Default setting is false.

  • timeAsLeader: (Optional) (Number) Search by filtering by how long a leader has been a leader.

    • 7: Leading for more than 7 days
    • 30: Leading for more than 30 days
    • 90: Leading for more than 90 days
    • 180: Leading for more than 180 days
  • winRate: (Optional) (Number) Search by filtering by a leader's win rate.

    • 0.5: Traders with a win rate of more than 50%
    • 0.6: Traders with a win rate of more than 60%
    • 0.7: Traders with a win rate of more than 70%
    • 0.8: Traders with a win rate of more than 80%
    • 0.9: Traders with a win rate of more than 90%
  • minLeaderAssets: (Optional) (Number) Search by filtering by a leader's minimum asset. (The value can only be integers between 0 and 50000)

  • maxLeaderAssets: (Optional) (Number) Search by filtering by a leader's maximum asset. (The value can only be integers between 0 and 50000)

  • minLeaderAum: (Optional) (Number) Search by filtering by a leader's minimum AUM. (The value can only be integers between 0 and 500000)

  • maxLeaderAum: (Optional) (Number) Search by filtering by a leader's minimum AUM. (The value can only be integers between 0 and 500000)

  • includeHistoricalPositions: (Optional) (Boolean) If you want the history of the user's open positions to be scraped as well, you can set true. Default setting is false.

  • onlyUserInformation: (Optional) (Boolean) If you want only user information to be scraped with relevant performance stats(futures or personal), you can set true. Default setting is false. (If the value is true, data from ongoing orders and the history of ongoing orders are ignored and only the trader account information and the trader's performance statistics are scraped.)

  • proxy: (Required) (Proxy Object) Proxy configuration.

  • extendOutputFunction: (Optional) (String) Function that takes a JQuery handle ($) as an argument and returns an object with data.

  • customMapFunction: (Optional) (String) Function that takes each object's handle as an argument and returns the object with executing the function.

This solution requires the use of Proxy servers, either your own proxy servers or you can use Apify Proxy.

Tip

When you want to scrape over a specific list URL, just copy and paste the link as one of the startUrl.

If you would like to scrape only the first page of a list then put the link for the page and have the endPage as 1.

Compute Unit Consumption

The actor is optimized to run blazing fast and scrape as many items as possible. Therefore, it forefronts all the detailed requests. If the actor doesn't block very often it'll scrape 200 listings in 1 minutes with ~0.03-0.05 compute units.

OKX Copy Trading Scraper Input example

1{
2    "startUrls": [
3		"https://www.okx.com/copy-trading/account/305B2C62DA40873F?tab=trade"
4    ],
5    "searchType": "pnl",
6    "leaderHasVacancies": true,
7    "allowApiTraders": false,
8    "timeAsLeader": 180,
9    "winRate": 0.5,
10    "minLeaderAssets": 10000,
11    "maxLeaderAssets": 49999,
12    "minLeaderAum": 100000,
13    "maxLeaderAum": 499999,
14    "includeHistoricalPositions": false,
15    "onlyUserInformation": true,
16    "maxItems": 100,
17    "endPage": 3,
18    "proxy": {
19        "useApifyProxy": true
20    }
21}

During the Run

During the run, the actor will output messages letting you know what is going on. Each message always contains a short label specifying which page from the provided list is currently specified.

When items are loaded from the page, you should see a message about this event with a loaded item count and total item count for each page.

If you provide incorrect input to the actor, it will immediately stop with a failure state and output an explanation of what is wrong.

OKX Copy Trading Export

During the run, the actor stores results into a dataset. Each item is a separate item in the dataset.

You can manage the results in any language (Python, PHP, Node JS/NPM). See the FAQ or our API reference to learn more about getting results from this OKX Copy Trading actor.

Scraped OKX Copy Trading Properties

The structure of each item in OKX Copy Trading looks like this:

Account Information with Performance Stats in Detail

1{
2	"url": "https://www.okx.com/copy-trading/account/BA1A719B8225DD83?tab=swap",
3	"type": "user",
4	"uniqueName": "BA1A719B8225DD83",
5	"apiTrader": "0",
6	"portrait": "",
7	"nickName": "Linen_bitmex",
8	"enNickName": "",
9	"sign": "Linen-Horse-Flasher\nBitmex Leader board rank 20th +1261 BTC",
10	"translatedBio": "",
11	"enSign": "",
12	"day": "164",
13	"count": "718",
14	"followeeNum": "0",
15	"targetId": "4",
16	"roleType": "1",
17	"spotRoleType": "0",
18	"publicStatus": "2",
19	"isStrategyLead": true,
20	"isSignalTrader": false,
21	"isChinese": false,
22	"isFollowed": false,
23	"maxRetreat": "0",
24	"profitDays": "61",
25	"lossDays": "68",
26	"winRatio": "0.4729",
27	"pnlProfitLossRatio": "1.96:1",
28	"avgPositionValue": "3048.5069",
29	"tradeInfo": [
30		{
31			"aum": "3764.289879127359881",
32			"copierFollowPnl": "",
33			"copyRelId": "",
34			"emptyMinderState": "0",
35			"followPnl": "0",
36			"followerLimit": "100",
37			"followerNum": "33",
38			"followerStatus": "",
39			"followerTime": "",
40			"instruments": [
41				{
42					"instId": "BTC-USDT-SWAP",
43					"name": "BTC",
44					"selected": "1"
45				}
46			],
47			"leadMode": "1",
48			"pnl": "",
49			"roleType": "1",
50			"shareRatio": "0.08",
51			"signalProtect": "0",
52			"symbol": "USDT",
53			"totalFollowerNum": "599"
54		}
55	],
56	"weekPnl": [
57		{
58			"pnl": "279374.2487426150408692",
59			"ratio": "0.1941",
60			"statTime": "1714320000000"
61		}
62	],
63	"yieldPnl": [
64		{
65			"pnl": "0",
66			"ratio": "0.0",
67			"statTime": "1707580800000"
68		}
69	],
70	"tradeData": [
71		{
72			"nonPeriodicPart": [
73				{
74					"desc": "Number of days this trader has been a lead trader for.",
75					"functionId": "initialDay",
76					"learnMoreUrl": "",
77					"order": 1,
78					"title": "Days leading trades",
79					"type": "2",
80					"value": "158"
81				}
82			],
83			"periodicPart": [
84				{
85					"desc": "",
86					"functionId": "profitDays",
87					"learnMoreUrl": "",
88					"order": 1,
89					"title": "Days w/ profit",
90					"type": "2",
91					"value": "61"
92				}
93			]
94		}
95	],
96	"followerList": [
97		{
98			"followers": [
99				{
100					"aum": "600108.5815629774006084",
101					"coinSymbol": "USDT",
102					"followDays": "113",
103					"followTime": "1711634478000",
104					"nickName": "jolupacc",
105					"pnl": "6452.3200830850595381",
106					"portrait": "",
107					"targetId": "6",
108					"uniqueName": "D0DE8C8F985B0B83"
109				}
110			],
111			"pnlCoinSymbol": "USDT",
112			"sevenDaysFollowerFlag": "1",
113			"sevenDaysFollowerNum": "1",
114			"sevenDaysFollowerRatio": "0.0017",
115			"sevenDaysFollowerRatioFlag": "1",
116			"statTime": "1721318399000",
117			"totalFollowerNum": "599",
118			"totalFollowerPnl": "-15063.2883850446245517"
119		}
120	],
121	"preferenceCoin": [
122		{
123			"currency": "BTC",
124			"percent": "0.507"
125		}
126	],
127	"positionHistoryScatter": [
128		{
129			"itemScatterList": [
130				{
131					"closePnl": "-9.5936",
132					"holdTimeMS": "84769024"
133				}
134			],
135			"symbol": "USDT"
136		}
137	],
138	"totalPnl": [
139		{
140			"ratio": "0.0961",
141			"statTime": "1707148800000"
142		}
143	],
144	"monthlyPnl": [
145		{
146			"ratio": "",
147			"statTime": "1690819200000"
148		}
149	],
150	"riskLevel": [
151		{
152			"highRisk": "8",
153			"isDisplayLastRiskRevel": "1",
154			"lastRiskLevel": "middle",
155			"middleRisk": "4",
156			"risks": [
157				[
158					"1690819200000",
159					""
160				]
161			]
162		}
163	],
164	"maxDrawdown": [
165		{
166			"dayMaxDrawdown": "-0.2962",
167			"historyMaxDrawdown": "-0.7241",
168			"weekMaxDrawdown": "-0.3025"
169		}
170	]
171}

Ongoing Orders in Detail

1{
2    "availSubPos": "120",
3    "ccy": "USDT",
4    "closePnl": "0",
5    "dealVolume": "",
6    "fee": "-14.13312",
7    "fundingFee": "6.1597664188335026",
8    "imr": "6973.668",
9    "instId": "BTC-USDT-SWAP",
10    "instType": "SWAP",
11    "last": "58113.7",
12    "lever": "10",
13    "liquidationFee": "",
14    "margin": "7066.56",
15    "markPx": "58113.9",
16    "maxSellableAmount": "",
17    "mgnMode": "cross",
18    "notionalUsd": "69746.4431352",
19    "openAvgPx": "58888",
20    "openTime": "1720514981796",
21    "pnl": "928.92",
22    "pnlRatio": "0.13145292759136",
23    "posSide": "short",
24    "posType": "3",
25    "side": "sell",
26    "slOrdPx": "",
27    "slTriggerPx": "",
28    "slTriggerType": "last",
29    "subPos": "120",
30    "tpOrdPx": "",
31    "tpTriggerPx": "",
32    "tpTriggerType": "last",
33    "tradeItemId": "1611034911019958274",
34    "uTime": "1720656000048",
35    "uniqueName": "94736C533515E1FC"
36}

History of Ongoing Orders in Detail

1{
2    "ccy": "USDT",
3    "closeAvgPx": "57553.5",
4    "closePnl": "200.7",
5    "contractVal": "0.01",
6    "dealVolume": "",
7    "fee": "-24.21261",
8    "fundingFee": "9.4025595349621039",
9    "id": "1603333729782661120",
10    "instId": "BTC-USDT-SWAP",
11    "instType": "SWAP",
12    "lever": "10",
13    "liquidationFee": "0",
14    "margin": "3473.28",
15    "mgnMode": "cross",
16    "multiplier": "1",
17    "openAvgPx": "57888",
18    "openTime": "1720286183640",
19    "pnl": "185.8899495349621039",
20    "pnlRatio": "0.053520001132924",
21    "posSide": "short",
22    "posType": "3",
23    "side": "sell",
24    "subPos": "60",
25    "tradeItemId": "1603333729782661120",
26    "type": "2",
27    "uTime": "1720642621960",
28    "uniqueName": "94736C533515E1FC"
29}

Contact

Please visit us through epctex.com to see all the products that are available for you. If you are looking for any custom integration or so, please reach out to us through the chat box in epctex.com. In need of support? devops@epctex.com is at your service.

Developer
Maintained by Community

Actor Metrics

  • 1 monthly user

  • 0 No stars yet

  • >99% runs succeeded

  • Created in Jul 2024

  • Modified 17 hours ago

Categories