1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "liveEvents",
12 "sport": "football",
13 "sports": [],
14 "statusFilter": "all",
15 "tournamentIds": [],
16 "teamIds": [],
17 "countries": [],
18 "playerIds": [],
19 "includeStatistics": true,
20 "includeIncidents": true,
21 "includeLineups": false,
22 "includeOdds": false,
23 "includeHeadToHead": false,
24 "includeVotes": false,
25 "includeBestPlayers": false,
26 "includeShotmap": false,
27 "onlyChanges": true,
28 "watch": [],
29 "includeScorers": false,
30 "maxItems": 25,
31 "proxyConfiguration": {
32 "useApifyProxy": true
33 }
34};
35
36
37const run = await client.actor("getascraper/sofascore-live-events-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