1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "searchQueries": [
12 "python programming"
13 ],
14 "resultTypes": [
15 "question",
16 "answer",
17 "profile",
18 "profile_activity",
19 "topic",
20 "space",
21 "post",
22 "search_result"
23 ],
24 "onlyUnanswered": false,
25 "excludePromoted": false,
26 "includePromoted": true,
27 "includePromotionEvidence": true,
28 "includeUncertain": true,
29 "maxResults": 10,
30 "maxResultsPerQuery": 10,
31 "includeFieldEvidence": true,
32 "maxItems": 0,
33 "maxItemsPerSource": 0,
34 "maxItemsPerQuery": 0,
35 "requestDelay": 2,
36 "maxNavigationRetries": 1,
37 "maxAnswersPerQuestion": 10,
38 "minAnswerUpvotes": 0,
39 "minUpvotes": 0,
40 "filterAiAnswers": "include",
41 "topCommentsOnly": false,
42 "maxScrollAttempts": 8,
43 "scrapeDepth": "detail",
44 "includeAnswers": true,
45 "includeMedia": true,
46 "includeOutboundLinks": true,
47 "includeAnswerHtml": true,
48 "includeHtmlContent": true,
49 "includeRelatedQuestions": true,
50 "maxRelatedQuestions": 0,
51 "includeQuestionTopics": true,
52 "maxQuestionTopics": 0,
53 "includeSpaceSettings": false,
54 "includeQuestionDetails": true,
55 "includeQuestionHtml": false,
56 "maxQuestionHtmlBytes": 0,
57 "maxAnswerHtmlBytes": 0,
58 "maxPostHtmlBytes": 0,
59 "includeComments": false,
60 "includePostComments": false,
61 "maxCommentsPerPost": 10,
62 "includeEngagementBreakdown": false,
63 "includePostAuthorContext": false,
64 "maxPostAuthorContextItems": 10,
65 "maxCommentsPerAnswer": 10,
66 "maxReplyExpandAttempts": 0,
67 "includeProfileActivity": false,
68 "includeEntityGraph": false,
69 "maxGraphEdges": 1000,
70 "profileActivityTypes": [
71 "answer",
72 "question",
73 "post"
74 ],
75 "maxProfileActivityItems": 20,
76 "onlyNewItems": false,
77 "includeProfileSensitiveFields": true,
78 "includeSensitiveProfileFields": true,
79 "includeSocialLinks": true,
80 "activityTab": "all",
81 "includeActivityText": true,
82 "includeActivityHtml": false,
83 "maxItemsPerTab": 0,
84 "maxDetailItems": 0,
85 "includeUnchanged": true,
86 "maxAuthors": 1000,
87 "maxSourcePages": 100,
88 "maxEvidencePerAuthor": 10,
89 "includeProfileSnapshot": false,
90 "includeRelatedContent": false,
91 "maxRelatedContent": 10,
92 "includePostHtml": false,
93 "includeReactionBreakdown": false,
94 "maxPostsPerSource": 0,
95 "includeGraphEdges": false,
96 "includeTopicQuestions": true,
97 "maxTopicQuestions": 20,
98 "includeTopicPosts": false,
99 "maxTopicPosts": 20,
100 "includeRelatedTopics": true,
101 "maxRelatedTopics": 20,
102 "includeAnswerPreview": false,
103 "maxAnswerPreviews": 3,
104 "minAnswerPreviewUpvotes": 0,
105 "cookies": [],
106 "proxyConfiguration": {
107 "useApifyProxy": true,
108 "apifyProxyGroups": [
109 "RESIDENTIAL"
110 ]
111 }
112};
113
114
115const run = await client.actor("crawlerbros/quora-scraper").call(input);
116
117
118console.log('Results from dataset');
119console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
120const { items } = await client.dataset(run.defaultDatasetId).listItems();
121items.forEach((item) => {
122 console.dir(item);
123});
124
125