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 "domain": "brightedge.com",
14 "companyName": "BrightEdge",
15 "industry": "Marketing Agency",
16 "services": [
17 "SEO",
18 "Content Marketing",
19 "Analytics"
20 ],
21 "companySize": "51-200",
22 "emails": [
23 "hello@brightedge.com"
24 ],
25 "contacts": [
26 {
27 "name": "Sarah Chen",
28 "title": "Head of SEO",
29 "email": "s.chen@brightedge.com"
30 }
31 ],
32 "phones": [
33 "+1 415-555-0182"
34 ],
35 "address": "1 Market St, San Francisco, CA",
36 "rating": 4.7,
37 "reviewCount": 143,
38 "hasChatWidget": true,
39 "hasContactForm": true,
40 "techStack": [
41 "HubSpot",
42 "Google Analytics",
43 "Salesforce"
44 ],
45 "foundedYear": 2011,
46 "description": "Enterprise SEO and content performance platform for B2B companies."
47 }
48 ],
49 "goal": "generic",
50 "mode": "auto",
51 "persona": "generic",
52 "outputProfile": "standard",
53 "scorecardTemplate": "custom",
54 "targetIndustries": [
55 "Marketing Agency",
56 "Digital Agency"
57 ],
58 "targetCompanySizes": [
59 "11-50",
60 "51-200"
61 ],
62 "targetServices": [
63 "SEO",
64 "Content Marketing"
65 ],
66 "targetTechStack": [
67 "HubSpot",
68 "Google Analytics"
69 ]
70};
71
72
73const run = await client.actor("ryanclinton/lead-scoring-engine").call(input);
74
75
76console.log('Results from dataset');
77console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
78const { items } = await client.dataset(run.defaultDatasetId).listItems();
79items.forEach((item) => {
80 console.dir(item);
81});
82
83