1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = { "spec": {
9 "openapi": "3.0.0",
10 "info": {
11 "title": "Pet API",
12 "version": "1",
13 },
14 "servers": [{ "url": "https://api.example.com" }],
15 "paths": {
16 "/pets/{id}": { "get": {
17 "operationId": "getPet",
18 "summary": "Get a pet",
19 "parameters": [{
20 "name": "id",
21 "in": "path",
22 "required": True,
23 "schema": { "type": "integer" },
24 "description": "Pet id",
25 }],
26 } },
27 "/pets": { "post": {
28 "operationId": "addPet",
29 "summary": "Add a pet",
30 "requestBody": {
31 "required": True,
32 "content": { "application/json": { "schema": {
33 "type": "object",
34 "required": ["name"],
35 "properties": { "name": { "type": "string" } },
36 } } },
37 },
38 } },
39 },
40 } }
41
42
43run = client.actor("colt2822/openapi-to-mcp-converter").call(run_input=run_input)
44
45
46print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
47for item in client.dataset(run.default_dataset_id).iterate_items():
48 print(item)
49
50