1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "brand": "Nike",
12 "brandAliases": [
13 "Nike, Inc."
14 ],
15 "competitors": [
16 {
17 "name": "Adidas",
18 "aliases": [
19 "Adidas AG"
20 ]
21 },
22 {
23 "name": "New Balance",
24 "aliases": []
25 }
26 ],
27 "inlineRows": [
28 {
29 "sourceActorId": "apify/chatgpt-search-scraper",
30 "query": "Which sustainable running shoe brands should a US buyer compare?",
31 "text": "Nike, Adidas and New Balance are common options to compare.",
32 "sources": [
33 {
34 "title": "Running guide",
35 "url": "https://example.com/running-guide"
36 }
37 ]
38 }
39 ],
40 "market": "United States",
41 "language": "English",
42 "maxRows": 100
43};
44
45
46const run = await client.actor("zinin/chinese-ai-visibility-dataset-analyzer").call(input);
47
48
49console.log('Results from dataset');
50console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
51const { items } = await client.dataset(run.defaultDatasetId).listItems();
52items.forEach((item) => {
53 console.dir(item);
54});
55
56