1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "directUrls": [
12 "https://www.quora.com/What-is-Python-primarily-used-for"
13 ],
14 "onlyUnanswered": false,
15 "excludePromoted": false,
16 "includePromoted": true,
17 "includePromotionEvidence": true,
18 "maxResults": 10,
19 "minAnswerUpvotes": 0,
20 "filterAiAnswers": "include",
21 "topCommentsOnly": false,
22 "includeAnswers": true,
23 "includeMedia": true,
24 "includeOutboundLinks": true,
25 "includeRelatedQuestions": true,
26 "maxRelatedQuestions": 0,
27 "includeQuestionTopics": true,
28 "includeSpaceSettings": false,
29 "includeQuestionDetails": true,
30 "includeComments": false,
31 "includePostComments": false,
32 "maxCommentsPerPost": 10,
33 "includeEngagementBreakdown": false,
34 "includePostAuthorContext": false,
35 "maxPostAuthorContextItems": 10,
36 "includeProfileActivity": false,
37 "includeEntityGraph": false,
38 "maxGraphEdges": 1000,
39 "profileActivityTypes": [
40 "answer",
41 "question",
42 "post"
43 ],
44 "maxProfileActivityItems": 20,
45 "includeProfileSensitiveFields": true,
46 "includeSocialLinks": true,
47 "maxItemsPerTab": 20,
48 "maxAuthors": 1000,
49 "includeProfileSnapshot": false,
50 "includeRelatedContent": false,
51 "maxRelatedContent": 10,
52 "maxPostsPerSource": 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 "includeAuthorProfiles": false,
63 "includeAccessIssues": false,
64 "maxResultsPerSource": 0
65};
66
67
68const run = await client.actor("crawlerbros/quora-scraper").call(input);
69
70
71console.log('Results from dataset');
72console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
73const { items } = await client.dataset(run.defaultDatasetId).listItems();
74items.forEach((item) => {
75 console.dir(item);
76});
77
78