1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "single",
12 "tool": "fetch_web",
13 "fetchUrl": "https://example.com",
14 "extractSelectors": [
15 {
16 "name": "title",
17 "css": "h1"
18 }
19 ],
20 "extractPatterns": [
21 {
22 "name": "emails",
23 "regex": "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}"
24 }
25 ],
26 "classifyLabels": [
27 "positive",
28 "negative",
29 "neutral"
30 ],
31 "extractStructuredSchema": {
32 "type": "object",
33 "properties": {
34 "title": {
35 "type": "string"
36 },
37 "price": {
38 "type": "number"
39 },
40 "description": {
41 "type": "string"
42 }
43 },
44 "required": [
45 "title"
46 ]
47 },
48 "transformMapping": [
49 {
50 "from": "title",
51 "to": "headline",
52 "op": "copy"
53 }
54 ],
55 "batchCalls": [
56 {
57 "tool": "fetch_web",
58 "params": {
59 "url": "https://example.com"
60 }
61 }
62 ]
63};
64
65
66const run = await client.actor("tuguidragos/mcp-nexus-universal-ai-tool-bridge").call(input);
67
68
69console.log('Results from dataset');
70console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
71const { items } = await client.dataset(run.defaultDatasetId).listItems();
72items.forEach((item) => {
73 console.dir(item);
74});
75
76