1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "charts",
12 "countries": [
13 "us",
14 "gb"
15 ],
16 "chartTypes": [
17 "topfree"
18 ],
19 "genres": [
20 "all",
21 "Productivity"
22 ],
23 "maxRank": 10,
24 "keywords": [
25 "habit tracker"
26 ],
27 "trackApps": [
28 "https://apps.apple.com/us/app/habitkit/id6443918070"
29 ],
30 "resultsPerKeyword": 5
31};
32
33
34const run = await client.actor("tidytools/app-store-top-charts").call(input);
35
36
37console.log('Results from dataset');
38console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
39const { items } = await client.dataset(run.defaultDatasetId).listItems();
40items.forEach((item) => {
41 console.dir(item);
42});
43
44