1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "serviceCategory": "digital-marketing",
12 "location": "United States",
13 "maxAgencies": 3,
14 "directorySources": [
15 "google-maps"
16 ],
17 "emailTemplate": `Hi {{firstName}},
18
19I came across {{companyName}} and was impressed by your work in {{topService}}.
20
21I'd love to explore whether we might be a fit to work together.
22
23Would you have 15 minutes for a quick call this week?
24
25Best,
26[Your name]
27
28---
29To unsubscribe: {{unsubscribeLink}}`,
30 "emailSubject": "Quick question for {{companyName}}",
31 "finalStep": "none",
32 "proxyConfiguration": {
33 "useApifyProxy": true
34 }
35};
36
37
38const run = await client.actor("ryanclinton/agency-lead-gen-pipeline").call(input);
39
40
41console.log('Results from dataset');
42console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
43const { items } = await client.dataset(run.defaultDatasetId).listItems();
44items.forEach((item) => {
45 console.dir(item);
46});
47
48