1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "sports": [
12 "football"
13 ],
14 "maxItems": 50,
15 "matchSections": [
16 "details",
17 "statistics",
18 "lineups",
19 "incidents",
20 "shotmap",
21 "odds",
22 "headToHead",
23 "votes",
24 "pregameForm",
25 "managers",
26 "bestPlayers",
27 "momentum",
28 "teamStreaks",
29 "highlights",
30 "averagePositions",
31 "postMatchInsights",
32 "pointByPoint",
33 "tennisPower",
34 "innings",
35 "esportsGames",
36 "series"
37 ],
38 "teamSections": [
39 "squad",
40 "transfers",
41 "achievements",
42 "rankings",
43 "performance",
44 "nearEvents",
45 "competitions",
46 "standings",
47 "seasonStatistics",
48 "featuredPlayers",
49 "lastMatches",
50 "nextMatches",
51 "grandSlamResults"
52 ],
53 "playerSections": [
54 "attributes",
55 "characteristics",
56 "transfers",
57 "nationalTeam",
58 "competitions",
59 "careerStatistics",
60 "seasonStatistics",
61 "seasonRatings",
62 "lastYearSummary",
63 "penaltyHistory",
64 "lastMatches"
65 ],
66 "tournamentSections": [
67 "seasons",
68 "seasonInfo",
69 "standings",
70 "rounds",
71 "cupTrees",
72 "groups",
73 "topPlayers",
74 "topTeams",
75 "topMatchPerformances",
76 "teamOfTheWeek",
77 "awards",
78 "topFollowedPlayers",
79 "winners",
80 "venues",
81 "teams",
82 "featuredMatches",
83 "media",
84 "lastMatches",
85 "nextMatches"
86 ]
87};
88
89
90const run = await client.actor("zen-studio/sofascore-scraper").call(input);
91
92
93console.log('Results from dataset');
94console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
95const { items } = await client.dataset(run.defaultDatasetId).listItems();
96items.forEach((item) => {
97 console.dir(item);
98});
99
100