1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "items",
12 "items": [
13 {
14 "name": "Acme AI",
15 "domain": "https://acme.ai",
16 "email": "hello@acme.ai",
17 "employeeCount": 42,
18 "sourceUrl": "https://example.com/acme"
19 },
20 {
21 "name": "Acme AI Inc.",
22 "domain": "acme.ai",
23 "email": "",
24 "employeeCount": "42",
25 "sourceUrl": "not a url"
26 },
27 {
28 "name": "Beta Tools",
29 "domain": "beta.tools",
30 "email": "sales@beta.tools",
31 "employeeCount": 12,
32 "sourceUrl": "https://example.com/beta"
33 },
34 {
35 "name": "",
36 "domain": "gamma.example",
37 "email": "bad-email",
38 "employeeCount": null,
39 "sourceUrl": "https://example.com/gamma"
40 },
41 {
42 "domain": "delta.example",
43 "email": "contact@delta.example",
44 "employeeCount": 8,
45 "sourceUrl": "https://example.com/delta"
46 }
47 ],
48 "requiredFields": [
49 "name",
50 "domain"
51 ],
52 "uniqueKeys": [
53 "domain"
54 ],
55 "urlFields": [
56 "domain",
57 "sourceUrl"
58 ],
59 "emailFields": [
60 "email"
61 ]
62};
63
64
65const run = await client.actor("rotvuvo/apify-dataset-release-qa-gate").call(input);
66
67
68console.log('Results from dataset');
69console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
70const { items } = await client.dataset(run.defaultDatasetId).listItems();
71items.forEach((item) => {
72 console.dir(item);
73});
74
75