1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "person",
12 "people": [
13 {
14 "fullName": "John Marvin Smith",
15 "city": "San Antonio",
16 "state": "TX",
17 "country": "US"
18 }
19 ],
20 "emails": [
21 "torvalds@linux-foundation.org"
22 ],
23 "linkedinProfiles": [
24 "https://www.linkedin.com/in/williamhgates"
25 ],
26 "facebookProfiles": [
27 "https://www.facebook.com/zuck"
28 ],
29 "socialHandles": [
30 {
31 "platform": "github",
32 "handle": "sindresorhus"
33 }
34 ],
35 "leads": [],
36 "leadsDatasetId": "",
37 "leadsFieldMapping": {},
38 "contactTypes": [
39 "mobile",
40 "anyPhone",
41 "personalEmail",
42 "workEmail"
43 ],
44 "countries": [
45 "US"
46 ],
47 "minMatchConfidence": 40,
48 "websiteCrawl": true,
49 "crawlDepth": 1,
50 "onlyWithEmail": false,
51 "includeNotFound": true,
52 "maxItems": 2,
53 "maxMatchesPerPerson": 2,
54 "suppressionList": []
55};
56
57
58const run = await client.actor("dataspryva/contact-finder").call(input);
59
60
61console.log('Results from dataset');
62console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
63const { items } = await client.dataset(run.defaultDatasetId).listItems();
64items.forEach((item) => {
65 console.dir(item);
66});
67
68