1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "operation": "discover-players",
12 "search": "Sinner",
13 "playerIds": [
14 "S0AG"
15 ],
16 "matchRequests": [
17 {
18 "matchId": "2026#540#MS001",
19 "requestedPlayerIds": [
20 "S0AG"
21 ]
22 }
23 ],
24 "maxMatchesPerPlayer": 5,
25 "maxTotalMatches": 20,
26 "matchFormat": "all",
27 "includeStats": true,
28 "proxy": {
29 "useApifyProxy": true,
30 "apifyProxyGroups": [
31 "RESIDENTIAL"
32 ]
33 }
34};
35
36
37const run = await client.actor("parsebird/atp-match-stats-scraper").call(input);
38
39
40console.log('Results from dataset');
41console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
42const { items } = await client.dataset(run.defaultDatasetId).listItems();
43items.forEach((item) => {
44 console.dir(item);
45});
46
47