1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "leads": [
12 {
13 "name": "Sarah Chen",
14 "email": "sarah.chen@acmecorp.com",
15 "jobTitle": "VP of Engineering",
16 "companyName": "Acme Corp",
17 "industry": "SaaS",
18 "services": "Cloud infrastructure management",
19 "recentNews": "Recently raised $20M Series B",
20 "painPoints": "Scaling engineering team, reducing deployment friction"
21 },
22 {
23 "name": "James Miller",
24 "email": "james@buildco.io",
25 "jobTitle": "Head of Growth",
26 "companyName": "BuildCo",
27 "industry": "Construction Technology",
28 "services": "Project management software for contractors"
29 }
30 ],
31 "openaiApiKey": "",
32 "anthropicApiKey": ""
33};
34
35
36const run = await client.actor("ryanclinton/ai-email-writer").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