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": "apify.com",
14 "companyName": "Apify",
15 "emails": [
16 "hello@apify.com"
17 ],
18 "phones": [
19 "+420-234-567-891"
20 ],
21 "contacts": [
22 {
23 "name": "Jan Curn",
24 "title": "CEO",
25 "email": "jan@apify.com"
26 }
27 ],
28 "score": 85,
29 "grade": "A"
30 }
31 ],
32 "dryRun": true
33};
34
35
36const run = await client.actor("ryanclinton/hubspot-lead-pusher").call(input);
37
38
39console.log('Results from dataset');
40console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
41const { items } = await client.dataset(run.defaultDatasetId).listItems();
42items.forEach((item) => {
43 console.dir(item);
44});
45
46