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