1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = { "schema": """{
9 \"openapi\": \"3.1.0\",
10 \"info\": {
11 \"title\": \"Exchange rates\",
12 \"description\": \"Daily reference exchange rates from Frankfurter (frankfurter.dev). No API key.\",
13 \"version\": \"1.0.0\"
14 },
15 \"servers\": [{ \"url\": \"https://api.frankfurter.dev/v1\" }],
16 \"paths\": {
17 \"/currencies\": {
18 \"get\": {
19 \"operationId\": \"listCurrencies\",
20 \"summary\": \"List the currency codes this API supports, with their names.\",
21 \"responses\": { \"200\": { \"description\": \"Currency codes and names.\" } }
22 }
23 },
24 \"/latest\": {
25 \"get\": {
26 \"operationId\": \"getLatestRates\",
27 \"summary\": \"Latest daily exchange rates for one base currency.\",
28 \"parameters\": [
29 {
30 \"name\": \"base\",
31 \"in\": \"query\",
32 \"description\": \"Three-letter base currency code, like USD. EUR if left out.\",
33 \"schema\": { \"type\": \"string\", \"pattern\": \"^[A-Z]{3}$\" }
34 },
35 {
36 \"name\": \"symbols\",
37 \"in\": \"query\",
38 \"description\": \"Comma-separated codes to return, like EUR,GBP. All if left out.\",
39 \"schema\": {
40 \"type\": \"string\",
41 \"pattern\": \"^[A-Z]{3}(,[A-Z]{3}){0,40}$\"
42 }
43 },
44 {
45 \"name\": \"amount\",
46 \"in\": \"query\",
47 \"description\": \"Amount of the base currency to convert. 1 if left out.\",
48 \"schema\": {
49 \"type\": \"number\",
50 \"exclusiveMinimum\": 0,
51 \"maximum\": 1000000000
52 }
53 }
54 ],
55 \"responses\": {
56 \"200\": { \"description\": \"Rates for the base currency.\" }
57 }
58 }
59 },
60 \"/{date}\": {
61 \"get\": {
62 \"operationId\": \"getHistoricalRates\",
63 \"summary\": \"Exchange rates on one past date (working days, back to 1999-01-04).\",
64 \"parameters\": [
65 {
66 \"name\": \"date\",
67 \"in\": \"path\",
68 \"required\": true,
69 \"description\": \"The date as YYYY-MM-DD.\",
70 \"schema\": { \"type\": \"string\", \"pattern\": \"^\\\\d{4}-\\\\d{2}-\\\\d{2}$\" }
71 },
72 {
73 \"name\": \"base\",
74 \"in\": \"query\",
75 \"description\": \"Three-letter base currency code, like USD. EUR if left out.\",
76 \"schema\": { \"type\": \"string\", \"pattern\": \"^[A-Z]{3}$\" }
77 },
78 {
79 \"name\": \"symbols\",
80 \"in\": \"query\",
81 \"description\": \"Comma-separated codes to return, like EUR,GBP. All if left out.\",
82 \"schema\": {
83 \"type\": \"string\",
84 \"pattern\": \"^[A-Z]{3}(,[A-Z]{3}){0,40}$\"
85 }
86 }
87 ],
88 \"responses\": { \"200\": { \"description\": \"Rates on that date.\" } }
89 }
90 }
91 }
92}
93""" }
94
95
96run = client.actor("brasspage/gpt-action-to-mcp").call(run_input=run_input)
97
98
99print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
100for item in client.dataset(run.default_dataset_id).iterate_items():
101 print(item)
102
103