1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "rows": [
12 {
13 "company": "Stripe",
14 "website": "stripe.com",
15 "description": "Online payment processing platform for internet businesses.",
16 "address": "354 Oyster Point Blvd, South San Francisco, CA 94080, USA"
17 },
18 {
19 "company": "Bimbo",
20 "website": "grupobimbo.com",
21 "description": "Multinational bakery products manufacturer with brands like Bimbo, Marinela and Sara Lee.",
22 "address": "Prolongación Paseo de la Reforma 1000, Santa Fe, 01210 Ciudad de México, CDMX"
23 },
24 {
25 "company": "Shopify",
26 "website": "shopify.com",
27 "description": "Commerce platform that lets anyone start, manage and grow an online store.",
28 "address": "151 O'Connor St, Ottawa, ON K2P 2L8, Canada"
29 },
30 {
31 "company": "Mayo Clinic",
32 "website": "mayoclinic.org",
33 "description": "Nonprofit academic medical center focused on patient care, research and education.",
34 "address": "200 First St SW, Rochester, MN 55905, USA"
35 },
36 {
37 "company": "Siemens",
38 "website": "siemens.com",
39 "description": "Technology company focused on industry, infrastructure, mobility and healthcare.",
40 "address": "Werner-von-Siemens-Straße 1, 80333 München, Germany"
41 },
42 {
43 "company": "Cemex",
44 "website": "cemex.com",
45 "description": "Global building materials company producing cement, ready-mix concrete and aggregates.",
46 "address": "Av. Ricardo Margáin Zozaya 325, San Pedro Garza García, N.L., Mexico"
47 },
48 {
49 "company": "Duolingo",
50 "website": "duolingo.com",
51 "description": "Language-learning app with gamified lessons in 40+ languages.",
52 "address": "5900 Penn Ave, Pittsburgh, PA 15206, USA"
53 },
54 {
55 "company": "Zara (Inditex)",
56 "website": "inditex.com",
57 "description": "Fashion retailer operating Zara, Pull&Bear, Massimo Dutti and other apparel brands.",
58 "address": "Avenida de la Diputación, 15143 Arteixo, A Coruña, Spain"
59 },
60 {
61 "company": "Airbnb",
62 "website": "airbnb.com",
63 "description": "Online marketplace for short-term homestays and experiences.",
64 "address": "888 Brannan St, San Francisco, CA 94103, USA"
65 },
66 {
67 "company": "Tesla",
68 "website": "tesla.com",
69 "description": "Designs and manufactures electric vehicles, battery storage and solar products.",
70 "address": "1 Tesla Road, Austin, TX 78725, USA"
71 },
72 {
73 "company": "Rappi",
74 "website": "rappi.com",
75 "description": "Latin American on-demand delivery app for food, groceries and pharmacy.",
76 "address": "Calle 93 #19-58, Bogotá, Colombia"
77 },
78 {
79 "company": "Deloitte",
80 "website": "deloitte.com",
81 "description": "Professional services network providing audit, consulting, tax and advisory services.",
82 "address": "1 New Street Square, London EC4A 3HQ, United Kingdom"
83 }
84 ],
85 "columns": [
86 {
87 "name": "industry",
88 "instruction": "Classify the company's industry.",
89 "type": "enum",
90 "options": [
91 "Software & Internet",
92 "Fintech",
93 "Retail & E-commerce",
94 "Food & Beverage",
95 "Healthcare",
96 "Manufacturing & Industrial",
97 "Construction & Materials",
98 "Automotive",
99 "Travel & Hospitality",
100 "Education",
101 "Professional Services",
102 "Other"
103 ]
104 },
105 {
106 "name": "city",
107 "instruction": "Extract the city from the address. Return only the city name.",
108 "type": "text"
109 },
110 {
111 "name": "is_b2b",
112 "instruction": "True if the company mainly sells to other businesses (B2B). False if it mainly sells to consumers (B2C). Decide from the description; do not return null unless the description is missing.",
113 "type": "boolean"
114 },
115 {
116 "name": "lead_score",
117 "instruction": "Score from 1 to 10 how well this company fits as a potential customer for a B2B SaaS product (data, operations or automation software). 10 is an excellent fit (mid-market or enterprise software buyer). 1 is a poor fit (pure consumer brand with no likely software-buying team).",
118 "type": "number"
119 },
120 {
121 "name": "fit_reason",
122 "instruction": "One sentence in English (max 20 words) explaining the lead_score.",
123 "type": "text"
124 }
125 ]
126};
127
128
129const run = await client.actor("datatools-ai/ai-table-enricher").call(input);
130
131
132console.log('Results from dataset');
133console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
134const { items } = await client.dataset(run.defaultDatasetId).listItems();
135items.forEach((item) => {
136 console.dir(item);
137});
138
139