1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "productProfile": "We build n8n automation workflows for small businesses.",
12 "keywords": [
13 "n8n",
14 "automation"
15 ],
16 "posts": [
17 {
18 "id": "demo-buyer-1",
19 "title": "Looking for n8n automation help",
20 "text": "Our manual spreadsheets are too expensive to maintain. We have a budget and need a workflow provider.",
21 "url": "https://example.com/demo/buyer-1"
22 },
23 {
24 "id": "demo-buyer-2",
25 "text": "Looking for an alternative to our n8n automation setup. Comparing providers, willing to pay for help with manual work.",
26 "url": "https://example.com/demo/buyer-2"
27 },
28 {
29 "id": "demo-promotion",
30 "text": "Looking for n8n automation? Try our new app and use a discount code.",
31 "url": "https://example.com/demo/promotion"
32 },
33 {
34 "id": "demo-unrelated",
35 "text": "Looking for hiking shoes. Budget available. Which software compares boots?",
36 "url": "https://example.com/demo/unrelated"
37 },
38 {
39 "id": "demo-noise",
40 "text": "A useful guide to n8n automation for hobby projects.",
41 "url": "https://example.com/demo/noise"
42 },
43 {
44 "id": "demo-buyer-pl",
45 "text": "Szukam n8n automation dla malej firmy. Robimy to recznie, budzet jest ustalony. Potrzebuje pomocy.",
46 "url": "https://example.com/demo/buyer-pl"
47 }
48 ]
49};
50
51
52const run = await client.actor("danielmichalek/buying-intent-lead-scorer").call(input);
53
54
55console.log('Results from dataset');
56console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
57const { items } = await client.dataset(run.defaultDatasetId).listItems();
58items.forEach((item) => {
59 console.dir(item);
60});
61
62