1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "items": [
12 {
13 "url": "https://example.com/help/returns",
14 "title": "Returns and refunds",
15 "markdown": "# Returns and refunds\n\n## How long do I have to return an item?\n\nYou can return unused items within 30 days of delivery. Start a return from the Orders page in your account and print the prepaid label.\n\n## When will I get my refund?\n\nRefunds are sent to the original payment method within 5 business days after the warehouse receives the item. Shipping fees are refunded only if the item arrived damaged.\n\n## Can I exchange an item instead?\n\nYes. Choose Exchange instead of Refund when you start the return and pick the new size or colour. Exchanges ship free of charge."
16 },
17 {
18 "url": "https://example.com/help/shipping",
19 "title": "Shipping",
20 "markdown": "# Shipping\n\n## Where do you ship?\n\nWe ship to the EU, the UK and the United States. Orders over 50 EUR ship free; smaller orders cost 4.90 EUR.\n\n## How fast is delivery?\n\nStandard delivery takes 2 to 4 business days in the EU and 5 to 8 business days to the UK and the US. Express delivery arrives the next business day in Germany and Austria when ordered before 2 pm.\n\n## How do I track my order?\n\nYou get a tracking link by email as soon as the parcel leaves the warehouse. The same link is shown on the Orders page."
21 }
22 ]
23};
24
25
26const run = await client.actor("seasons-ai/site-to-knowledge-pack").call(input);
27
28
29console.log('Results from dataset');
30console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
31const { items } = await client.dataset(run.defaultDatasetId).listItems();
32items.forEach((item) => {
33 console.dir(item);
34});
35
36