1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "search",
12 "searchQuery": "time travel",
13 "fandomTag": "Harry Potter - J. K. Rowling",
14 "tagName": "Fluff",
15 "collectionName": "yuletide2023",
16 "tagSearchQuery": "fluff",
17 "tagSearchType": "",
18 "tagSearchCanonicalOnly": false,
19 "workUrls": [],
20 "includeChapterText": false,
21 "chapterNumber": 1,
22 "allChaptersText": false,
23 "rating": [],
24 "warnings": [],
25 "category": [],
26 "language": "",
27 "completeStatus": "any",
28 "crossoverStatus": "any",
29 "singleChapterOnly": false,
30 "sortBy": "_score",
31 "sortDirection": "desc",
32 "maxItems": 20
33};
34
35
36const run = await client.actor("crawlerbros/archive-of-our-own-scraper").call(input);
37
38
39console.log('Results from dataset');
40console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
41const { items } = await client.dataset(run.defaultDatasetId).listItems();
42items.forEach((item) => {
43 console.dir(item);
44});
45
46