1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "startUrls": [
12 {
13 "url": "https://www.example.com"
14 },
15 {
16 "url": "https://www.example.com/some-path"
17 }
18 ],
19 "outputSchema": {
20 "business_name": "The name of the business",
21 "business_owner_name": "The owner or founder's name (look for titles like owner, founder, director, president)",
22 "business_address": "The full business address as it appears on the website",
23 "business_size": "Business size: 'small' (under 50 employees), 'medium' (50-250), or 'large' (250+)",
24 "contact_email": "Primary contact email address for the business",
25 "phone_number": "Primary business phone number",
26 "business_summary": "One sentence describing what the business does or offers"
27 }
28};
29
30
31const run = await client.actor("ashar_malik/bizsleuth").call(input);
32
33
34console.log('Results from dataset');
35console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
36const { items } = await client.dataset(run.defaultDatasetId).listItems();
37items.forEach((item) => {
38 console.dir(item);
39});
40
41