1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "currentItems": [
12 {
13 "id": "w1",
14 "url": "https://example.com/pricing",
15 "title": "Pricing",
16 "description": "Plans for teams",
17 "text": "Starter $19 Pro $49 Enterprise contact sales",
18 "emails": [
19 "sales@example.com"
20 ],
21 "headings": [
22 "Pricing",
23 "Plans"
24 ]
25 },
26 {
27 "id": "w2",
28 "url": "https://example.com/features",
29 "title": "Features",
30 "description": "Automation features",
31 "text": "Workflows integrations agents",
32 "headings": [
33 "Features"
34 ]
35 }
36 ],
37 "previousItems": [
38 {
39 "id": "w1",
40 "url": "https://example.com/pricing",
41 "title": "Pricing",
42 "description": "Plans for teams",
43 "text": "Starter $15 Pro $39 Enterprise contact sales",
44 "emails": [
45 "sales@example.com"
46 ],
47 "headings": [
48 "Pricing",
49 "Plans"
50 ]
51 }
52 ]
53};
54
55
56const run = await client.actor("quanmatrix/universal-web-structured-change-extractor").call(input);
57
58
59console.log('Results from dataset');
60console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
61const { items } = await client.dataset(run.defaultDatasetId).listItems();
62items.forEach((item) => {
63 console.dir(item);
64});
65
66