1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "fights",
12 "fighterNames": [
13 "Jon Jones",
14 "Islam Makhachev",
15 "Alex Pereira",
16 "Ilia Topuria",
17 "Khabib Nurmagomedov",
18 "Israel Adesanya",
19 "Conor McGregor",
20 "Amanda Nunes",
21 "Alexander Volkanovski",
22 "Sean O'Malley"
23 ],
24 "fighterUrls": [],
25 "letters": [],
26 "stance": "",
27 "eventStatus": "completed",
28 "maxItems": 10,
29 "maxFightsPerFighter": 1,
30 "includeFightHistory": true,
31 "flattenHistory": false,
32 "includeRoundByRound": true
33};
34
35
36const run = await client.actor("normdata/ufc-stats-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