1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "country": "US",
12 "enableCategorySearch": true,
13 "searchKeywords": [
14 "payroll software",
15 "seo tools",
16 "antivirus"
17 ],
18 "searchMaxResults": 10,
19 "searchFetchFullDetails": false,
20 "enableCategoryDetails": false,
21 "categoryUrls": [],
22 "enableReviews": false,
23 "reviewUrls": [],
24 "enableScrapeByUrl": false,
25 "scrapeUrls": [
26 "https://www.local.com/seo-tools"
27 ],
28 "webhookFormat": "json",
29 "proxyConfiguration": {
30 "useApifyProxy": true,
31 "apifyProxyGroups": [
32 "RESIDENTIAL"
33 ],
34 "apifyProxyCountry": "US"
35 }
36};
37
38
39const run = await client.actor("b2b_leads/local-real-time-data-scraper").call(input);
40
41
42console.log('Results from dataset');
43console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
44const { items } = await client.dataset(run.defaultDatasetId).listItems();
45items.forEach((item) => {
46 console.dir(item);
47});
48
49