1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "records": [
12 {
13 "productId": "BAT-100",
14 "productName": "Example industrial battery",
15 "manufacturer": "Example Manufacturer",
16 "batteryCategory": "industrial",
17 "model": "BAT-100",
18 "capacityKwh": 4.2,
19 "batteryChemistry": "LFP",
20 "carbonFootprintKgCo2e": 220,
21 "manufacturingLocation": "DE",
22 "evidence": [
23 {
24 "field": "capacityKwh",
25 "value": 4.2,
26 "sourceType": "manufacturer_technical_document",
27 "sourceUrl": "https://example.com/battery-technical-sheet.pdf",
28 "documentHash": "sha256:replace-with-real-hash"
29 }
30 ]
31 }
32 ],
33 "productUrls": [
34 {
35 "url": "https://example.com/battery-product"
36 }
37 ],
38 "evidenceUrls": [
39 {
40 "url": "https://example.com/battery-technical-sheet.pdf"
41 }
42 ],
43 "sourceDatasetId": "",
44 "dppRecords": [],
45 "dppUrls": [
46 {
47 "url": "https://example.com/battery/BAT-001"
48 }
49 ]
50};
51
52
53const run = await client.actor("zentrafoundry/eu-battery-passport-readiness-auditor").call(input);
54
55
56console.log('Results from dataset');
57console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
58const { items } = await client.dataset(run.defaultDatasetId).listItems();
59items.forEach((item) => {
60 console.dir(item);
61});
62
63