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 "claim": "The Constitution's preamble says the people ordained it to form a more perfect Union.",
14 "url": "http://www.archives.gov/founding-docs/constitution-transcript",
15 "quote": "We the People of the United States, in Order to form a more perfect Union"
16 },
17 {
18 "claim": "The preamble still begins with the words We the People.",
19 "url": "https://www.archives.gov/founding-docs/constitution-transcript",
20 "quote": "we the people of the united states, in order to form a more perfect union"
21 },
22 {
23 "claim": "The Constitution's preamble names a colony on Mars.",
24 "url": "https://www.archives.gov/founding-docs/constitution-transcript",
25 "quote": "We the Robots of Mars, in Order to form a more perfect Colony"
26 },
27 {
28 "claim": "The National Archives publishes a transcription of the Declaration of Independence.",
29 "url": "https://www.archives.gov/founding-docs/declaration-transcript",
30 "quote": null
31 },
32 {
33 "claim": "Python is a high-level, general-purpose programming language.",
34 "url": "https://en.wikipedia.org/wiki/Python_(programming_language)",
35 "quote": "Python is a high-level, general-purpose programming language"
36 },
37 {
38 "claim": "Python was invented by Linus Torvalds as a spreadsheet macro language.",
39 "url": "https://en.wikipedia.org/wiki/Python_(programming_language)",
40 "quote": "Python was invented by Linus Torvalds as a spreadsheet macro language"
41 },
42 {
43 "claim": "A National Archives page documents this citation-verifier demo.",
44 "url": "https://www.archives.gov/founding-docs/citation-claim-verifier-missing-page",
45 "quote": "This page documents the citation verifier."
46 },
47 {
48 "claim": "The W3C dummy PDF says Dummy PDF file.",
49 "url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
50 "quote": "Dummy PDF file"
51 }
52 ],
53 "inlineText": "",
54 "maxItems": 50,
55 "maxChargeUsd": 5,
56 "llmProvider": "none",
57 "llmModel": "",
58 "checkWayback": true,
59 "browserFallback": false,
60 "alertOnlyOnChange": false,
61 "dedupe": true,
62 "requestTimeoutSecs": 20,
63 "maxConcurrency": 4,
64 "maxRedirects": 5
65};
66
67
68const run = await client.actor("plusonets/citation-claim-verifier").call(input);
69
70
71console.log('Results from dataset');
72console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
73const { items } = await client.dataset(run.defaultDatasetId).listItems();
74items.forEach((item) => {
75 console.dir(item);
76});
77
78