1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "targetUrl": "https://example.com/product",
12 "competitorUrl": "https://competitor.example/product",
13 "query": "Does Acme export CSV?",
14 "evidence": {
15 "answer": "The competitor offers CSV exports.",
16 "citedUrls": [
17 "https://competitor.example/product"
18 ]
19 },
20 "targetHtml": "<!doctype html><html><body><h1>Acme</h1><p>Acme exports reports in CSV format.</p></body></html>",
21 "competitorHtml": "<html><body><h1>CSV exports</h1></body></html>",
22 "facts": [
23 {
24 "text": "Acme exports reports in CSV format.",
25 "sourceUrl": "https://example.com/product"
26 }
27 ]
28};
29
30
31const run = await client.actor("bono718/citation-remediation-payload-generator").call(input);
32
33
34console.log('Results from dataset');
35console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
36const { items } = await client.dataset(run.defaultDatasetId).listItems();
37items.forEach((item) => {
38 console.dir(item);
39});
40
41