1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "services": "marketing agency",
12 "location": "New York",
13 "sources": [
14 "google-maps",
15 "superbcompanies"
16 ],
17 "maxAgenciesPerSource": 50,
18 "preset": "none",
19 "mode": "list-builder",
20 "strategy": "balanced",
21 "outputMode": "raw",
22 "targetProfile": {
23 "services": [
24 "SEO",
25 "PPC"
26 ],
27 "minEmployees": 10,
28 "maxEmployees": 100,
29 "minRating": 4
30 },
31 "includeEmails": false,
32 "previousDatasetId": "",
33 "proxyConfiguration": {
34 "useApifyProxy": true
35 }
36};
37
38
39const run = await client.actor("ryanclinton/agency-directory-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