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