1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "searchTerms": [
12 "python"
13 ],
14 "maxItems": 3,
15 "freeOnly": false,
16 "sortOrder": "RELEVANCE",
17 "languages": [],
18 "levels": [],
19 "minRating": 0,
20 "videoLengths": [],
21 "closedCaptionLanguages": [],
22 "mustHaveClosedCaptions": false,
23 "mustHaveQuizzes": false,
24 "mustHaveCodingExercises": false,
25 "mustHavePracticeTests": false,
26 "mustHaveWorkspaces": false,
27 "mustHaveRoleplays": false,
28 "practiceTestCoursesOnly": false,
29 "certificationPrepOnly": false,
30 "includeCourseDetails": false,
31 "includeCurriculum": false,
32 "maxCurriculumItems": 2,
33 "includeReviews": false,
34 "maxReviews": 1
35};
36
37
38const run = await client.actor("datascraperes/udemy-course-catalog-scraper").call(input);
39
40
41console.log('Results from dataset');
42console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
43const { items } = await client.dataset(run.defaultDatasetId).listItems();
44items.forEach((item) => {
45 console.dir(item);
46});
47
48