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": "Figma",
14 "website": "figma.com",
15 "city": "San Francisco"
16 },
17 {
18 "company": "Brex",
19 "website": "brex.com",
20 "city": "San Francisco"
21 },
22 {
23 "company": "Kith",
24 "website": "kithnyc.com",
25 "city": "New York"
26 },
27 {
28 "company": "Austin Dental Works",
29 "website": "austindentalworks.com",
30 "city": "Austin"
31 },
32 {
33 "company": "Ogilvy",
34 "website": "ogilvy.com",
35 "city": "New York"
36 },
37 {
38 "company": "Warby Parker",
39 "website": "warbyparker.com",
40 "city": "New York"
41 }
42 ],
43 "instruction": "Which industry is {company} ({website}, based in {city}) in?",
44 "mode": "classify",
45 "labels": [
46 "SaaS",
47 "Fintech",
48 "E-commerce",
49 "Local services",
50 "Agency",
51 "Other"
52 ],
53 "outputColumn": "industry"
54};
55
56
57const run = await client.actor("bulkleads/ai-for-every-row-csv").call(input);
58
59
60console.log('Results from dataset');
61console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
62const { items } = await client.dataset(run.defaultDatasetId).listItems();
63items.forEach((item) => {
64 console.dir(item);
65});
66
67