1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "analysisMode": "form_matchup",
12 "format": "t20i",
13 "statType": "batting",
14 "view": "innings",
15 "team": "India",
16 "opposition": "Australia",
17 "groundId": "",
18 "groundUrl": "",
19 "playerId": "",
20 "playerUrl": "",
21 "playerIds": [],
22 "playerUrls": [],
23 "dateFrom": "",
24 "dateTo": "",
25 "homeOrAway": "",
26 "result": "",
27 "maxItems": 50,
28 "formWindow": 5,
29 "orderBy": "runs",
30 "orderDirection": "desc",
31 "minQualification": 0,
32 "proxyConfiguration": {
33 "useApifyProxy": false
34 }
35};
36
37
38const run = await client.actor("getascraper/espncricinfo-statsguru-scraper").call(input);
39
40
41console.log('Results from dataset');
42console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
43const { items } = await client.dataset(run.defaultDatasetId).listItems();
44items.forEach((item) => {
45 console.dir(item);
46});
47
48