1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "target": "searchByKeyword",
12 "keywords": [
13 "fantasy"
14 ],
15 "tags": [
16 "werewolf"
17 ],
18 "genresOrCategories": [
19 "Romance"
20 ],
21 "storyIdsOrUrls": [
22 "https://www.wattpad.com/story/82040526-a-different-virus-heartfire"
23 ],
24 "usernames": [
25 "CrystalScherer"
26 ],
27 "chapterIdsOrUrls": [
28 "https://www.wattpad.com/300363744-a-different-virus-heartfire-chapter-1"
29 ],
30 "maxItems": 25,
31 "proxyConfiguration": {
32 "useApifyProxy": false
33 }
34};
35
36
37const run = await client.actor("parsebird/wattpad-scraper").call(input);
38
39
40console.log('Results from dataset');
41console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
42const { items } = await client.dataset(run.defaultDatasetId).listItems();
43items.forEach((item) => {
44 console.dir(item);
45});
46
47