1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "max_results": 5,
12 "activity_filteramount": "1",
13 "proxyConfiguration": {
14 "useApifyProxy": true,
15 "apifyProxyGroups": [
16 "RESIDENTIAL"
17 ]
18 },
19 "select_feature": "leaderboard",
20 "url_markets": "https://polymarket.com/markets/politics",
21 "profile_id": "0x9f47f1fcb1701bf9eaf31236ad39875e5d60af93",
22 "profile_category": "positions",
23 "activity_page": true,
24 "activity_only_recent": false,
25 "activity_refresh_rate": 5,
26 "leaderboard_page": true,
27 "leaderboard_rangedate": "30d",
28 "leaderboard_section": "volume&profit",
29 "event_page": "",
30 "event_feature_type": "price",
31 "holders_only": false,
32 "sorted_by": "createdAt"
33};
34
35
36const run = await client.actor("saswave/polymarket-scraper").call(input);
37
38
39console.log('Results from dataset');
40console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
41const { items } = await client.dataset(run.defaultDatasetId).listItems();
42items.forEach((item) => {
43 console.dir(item);
44});
45
46