1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "country": "US",
12 "language": "en",
13 "enableAppSearch": true,
14 "searchQueries": [
15 "spotify",
16 "minecraft"
17 ],
18 "searchMaxResults": 10,
19 "searchFetchFullDetails": false,
20 "enableTopCharts": true,
21 "chartCollections": [
22 "top_free"
23 ],
24 "chartCategory": "GAME",
25 "chartsMaxResults": 10,
26 "chartsFetchFullDetails": false,
27 "enableAppDetails": false,
28 "appIds": [],
29 "appUrls": [],
30 "enableDeveloperApps": false,
31 "developerIds": [
32 "Spotify AB"
33 ],
34 "developerUrls": [],
35 "developerMaxApps": 30,
36 "enableSimilarApps": false,
37 "similarAppIds": [],
38 "similarAppUrls": [],
39 "similarMaxResults": 10,
40 "enableReviews": false,
41 "reviewAppIds": [],
42 "reviewUrls": [],
43 "reviewsMaxPerApp": 10,
44 "reviewsSort": "most_helpful",
45 "enableScrapeByUrl": false,
46 "scrapeUrls": [
47 "https://play.google.com/store/apps/details?id=com.spotify.music"
48 ],
49 "webhookFormat": "json",
50 "proxyConfiguration": {
51 "useApifyProxy": true,
52 "apifyProxyGroups": [
53 "RESIDENTIAL"
54 ],
55 "apifyProxyCountry": "US"
56 }
57};
58
59
60const run = await client.actor("b2b_leads/google-play-charts-real-time-data-scraper").call(input);
61
62
63console.log('Results from dataset');
64console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
65const { items } = await client.dataset(run.defaultDatasetId).listItems();
66items.forEach((item) => {
67 console.dir(item);
68});
69
70