1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "apiSpec": "https://petstore3.swagger.io/api/v3/openapi.json",
12 "manualEndpoints": [
13 {
14 "name": "getUser",
15 "method": "GET",
16 "path": "/users/{id}",
17 "description": "Get a user by ID",
18 "parameters": [
19 {
20 "name": "id",
21 "type": "string",
22 "in": "path",
23 "required": true,
24 "description": "User ID"
25 }
26 ]
27 }
28 ],
29 "baseUrl": "https://api.example.com/v1"
30};
31
32
33const run = await client.actor("maximus242/mcp-gateway").call(input);
34
35
36console.log('Results from dataset');
37console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
38const { items } = await client.dataset(run.defaultDatasetId).listItems();
39items.forEach((item) => {
40 console.dir(item);
41});
42
43