1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "tags": [
12 "machine-learning"
13 ],
14 "authors": [],
15 "publications": [],
16 "articleUrls": [],
17 "startUrls": [],
18 "minClaps": 0,
19 "minResponses": 0,
20 "minReadingTimeMinutes": 0,
21 "maxReadingTimeMinutes": 0,
22 "minWordCount": 0,
23 "paywall": "all",
24 "languages": [],
25 "includeKeywords": [],
26 "excludeKeywords": [],
27 "requiredTags": [],
28 "onlyPublications": [],
29 "onlyAuthors": [],
30 "excludeResponses": true,
31 "includeContent": false,
32 "contentFormat": "markdown",
33 "includeLinksAndImages": false,
34 "includeAuthorDetails": false,
35 "onlyNewArticles": false,
36 "monitorScope": "default",
37 "maxItems": 10,
38 "sortBy": "newest",
39 "maxDaysToScan": 14,
40 "maxConcurrency": 3,
41 "proxyConfiguration": {
42 "useApifyProxy": true
43 }
44};
45
46
47const run = await client.actor("getascraper/medium-articles-scraper").call(input);
48
49
50console.log('Results from dataset');
51console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
52const { items } = await client.dataset(run.defaultDatasetId).listItems();
53items.forEach((item) => {
54 console.dir(item);
55});
56
57