1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "businessName": "Harborline Realty",
12 "website": "https://example.com/",
13 "city": "Kent",
14 "region": "WA",
15 "personAliases": [
16 "Jane Doe"
17 ],
18 "answers": [
19 {
20 "promptText": "Which firm should I hire to sell a luxury home in Kent WA?",
21 "surface": "chatgpt",
22 "answer": "A few firms come up in national results. See https://example.com/ for a local overview.",
23 "citations": [
24 "https://example.com/"
25 ],
26 "namedBusiness": false
27 },
28 {
29 "promptText": "Which firm should I hire to sell a luxury home in Kent WA?",
30 "surface": "claude",
31 "answer": "Here is a directory of options: https://example.com/. Harborline Realty is not named here.",
32 "citations": [
33 "https://example.com/"
34 ],
35 "namedBusiness": false
36 },
37 {
38 "promptText": "Which firm should I hire to sell a luxury home in Kent WA?",
39 "surface": "perplexity",
40 "answer": "Buyers often compare several teams. https://example.com/ is cited.",
41 "citations": [
42 "https://example.com/"
43 ],
44 "namedBusiness": false
45 },
46 {
47 "promptText": "Who are the best real estate agents in Kent WA?",
48 "surface": "chatgpt",
49 "answer": "This national-level answer lists several names and cites https://example.com/.",
50 "citations": [
51 "https://example.com/"
52 ],
53 "namedBusiness": false
54 },
55 {
56 "promptText": "Who are the best real estate agents in Kent WA?",
57 "surface": "gemini",
58 "answer": "https://example.com/ appears in the sources. Harborline Realty is not named.",
59 "citations": [
60 "https://example.com/"
61 ],
62 "namedBusiness": false
63 },
64 {
65 "promptText": "Who are the best real estate agents in Kent WA?",
66 "surface": "perplexity",
67 "answer": "A short list of firms is discussed, citing https://example.com/.",
68 "citations": [
69 "https://example.com/"
70 ],
71 "namedBusiness": false
72 }
73 ]
74};
75
76
77const run = await client.actor("steady-scrape/geo-page-changes").call(input);
78
79
80console.log('Results from dataset');
81console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
82const { items } = await client.dataset(run.defaultDatasetId).listItems();
83items.forEach((item) => {
84 console.dir(item);
85});
86
87