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 "qualifyThreshold": 65,
54 "disqualifyThreshold": 35,
55 "scorecardTemplate": "custom",
56 "targetIndustries": [
57 "Marketing Agency",
58 "Digital Agency"
59 ],
60 "targetCompanySizes": [
61 "11-50",
62 "51-200"
63 ],
64 "targetServices": [
65 "SEO",
66 "Content Marketing"
67 ],
68 "targetTechStack": [
69 "HubSpot",
70 "Google Analytics"
71 ],
72 "maxLeads": 10000
73};
74
75
76const run = await client.actor("ryanclinton/lead-scoring-engine").call(input);
77
78
79console.log('Results from dataset');
80console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
81const { items } = await client.dataset(run.defaultDatasetId).listItems();
82items.forEach((item) => {
83 console.dir(item);
84});
85
86