1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "search",
12 "searchType": "profiles",
13 "usernames": [
14 "duolingo"
15 ],
16 "urls": [
17 "https://www.duolingo.com/profile/duolingo"
18 ],
19 "courseMinLearners": 0,
20 "courseSort": "learners",
21 "hasPlusOnly": false,
22 "minTotalXp": 0,
23 "minStreak": 0,
24 "fetchAchievements": true,
25 "maxItems": 20,
26 "incrementalMode": false,
27 "emitUnchanged": false,
28 "emitExpired": false,
29 "maxNotifyListings": 50,
30 "proxyConfiguration": {
31 "useApifyProxy": true
32 }
33};
34
35
36const run = await client.actor("abotapi/duolingo-learner-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