1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "products": [
12 {
13 "id": "EXAMPLE-FAUCET",
14 "title": "Example brass kitchen faucet",
15 "warnings": "WARNING: Cancer - www.P65Warnings.ca.gov"
16 },
17 {
18 "id": "EXAMPLE-HOSE",
19 "title": "Example 50 ft garden hose",
20 "description": "Flexible PVC hose with lead-based brass fittings. DEHP plasticizer for flexibility."
21 },
22 {
23 "id": "EXAMPLE-BOTTLE",
24 "title": "Example BPA-free water bottle",
25 "description": "Lead-free paint, BPA free. Prop 65 compliant."
26 },
27 {
28 "id": "EXAMPLE-CORD",
29 "title": "Example vinyl extension cord",
30 "warnings": "WARNING: This product can expose you to chemicals including DEHP, which is known to the State of California to cause cancer and birth defects or other reproductive harm. For more information go to www.P65Warnings.ca.gov."
31 }
32 ]
33};
34
35
36const run = await client.actor("ultimatemc/prop65-warning-checker").call(input);
37
38
39console.log('Results from dataset');
40console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
41const { items } = await client.dataset(run.defaultDatasetId).listItems();
42items.forEach((item) => {
43 console.dir(item);
44});
45
46