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": 50,
14 "directorySources": [
15 "clutch",
16 "sortlist",
17 "agencyspotter",
18 "designrush"
19 ],
20 "emailTemplate": `Hi {{firstName}},
21
22I came across {{companyName}} and was impressed by your work in {{topService}}.
23
24I'd love to explore whether we might be a fit to work together.
25
26Would you have 15 minutes for a quick call this week?
27
28Best,
29[Your name]
30
31---
32To unsubscribe: {{unsubscribeLink}}`,
33 "emailSubject": "Quick question for {{companyName}}",
34 "finalStep": "none",
35 "proxyConfiguration": {
36 "useApifyProxy": true
37 }
38};
39
40
41const run = await client.actor("ryanclinton/agency-lead-gen-pipeline").call(input);
42
43
44console.log('Results from dataset');
45console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
46const { items } = await client.dataset(run.defaultDatasetId).listItems();
47items.forEach((item) => {
48 console.dir(item);
49});
50
51