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 "directUrls": [
13 "https://www.quora.com/What-is-Python-primarily-used-for"
14 ],
15 "onlyUnanswered": false,
16 "excludePromoted": false,
17 "includePromoted": true,
18 "includePromotionEvidence": true,
19 "maxResults": 10,
20 "minAnswerUpvotes": 0,
21 "filterAiAnswers": "include",
22 "topCommentsOnly": false,
23 "includeAnswers": true,
24 "includeMedia": true,
25 "includeOutboundLinks": true,
26 "includeRelatedQuestions": true,
27 "maxRelatedQuestions": 0,
28 "includeQuestionTopics": true,
29 "includeRelatedTopics": true,
30 "maxRelatedTopics": 20,
31 "includeAnswerPreview": false,
32 "maxAnswerPreviews": 3,
33 "minAnswerPreviewUpvotes": 0,
34 "includeSpaceSettings": false,
35 "includeQuestionDetails": true,
36 "maxPostsPerSource": 0,
37 "includeComments": false,
38 "includeRelatedContent": false,
39 "maxRelatedContent": 10,
40 "maxCommentsPerAnswer": 10,
41 "includeProfileActivity": false,
42 "includeProfileSensitiveFields": true,
43 "includeSocialLinks": true,
44 "maxItemsPerTab": 20,
45 "maxAuthors": 1000,
46 "includeProfileSnapshot": false,
47 "includeEntityGraph": false,
48 "maxGraphEdges": 1000,
49 "profileActivityTypes": [
50 "answer",
51 "question",
52 "post"
53 ],
54 "maxProfileActivityItems": 20,
55 "includeAccessIssues": false,
56 "maxResultsPerSource": 0
57};
58
59
60const run = await client.actor("crawlerbros/quora-search-scraper").call(input);
61
62
63console.log('Results from dataset');
64console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
65const { items } = await client.dataset(run.defaultDatasetId).listItems();
66items.forEach((item) => {
67 console.dir(item);
68});
69
70