1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "schema": "{\n \"openapi\": \"3.1.0\",\n \"info\": {\n \"title\": \"Exchange rates\",\n \"description\": \"Daily reference exchange rates from Frankfurter (frankfurter.dev). No API key.\",\n \"version\": \"1.0.0\"\n },\n \"servers\": [{ \"url\": \"https://api.frankfurter.dev/v1\" }],\n \"paths\": {\n \"/currencies\": {\n \"get\": {\n \"operationId\": \"listCurrencies\",\n \"summary\": \"List the currency codes this API supports, with their names.\",\n \"responses\": { \"200\": { \"description\": \"Currency codes and names.\" } }\n }\n },\n \"/latest\": {\n \"get\": {\n \"operationId\": \"getLatestRates\",\n \"summary\": \"Latest daily exchange rates for one base currency.\",\n \"parameters\": [\n {\n \"name\": \"base\",\n \"in\": \"query\",\n \"description\": \"Three-letter base currency code, like USD. EUR if left out.\",\n \"schema\": { \"type\": \"string\", \"pattern\": \"^[A-Z]{3}$\" }\n },\n {\n \"name\": \"symbols\",\n \"in\": \"query\",\n \"description\": \"Comma-separated codes to return, like EUR,GBP. All if left out.\",\n \"schema\": {\n \"type\": \"string\",\n \"pattern\": \"^[A-Z]{3}(,[A-Z]{3}){0,40}$\"\n }\n },\n {\n \"name\": \"amount\",\n \"in\": \"query\",\n \"description\": \"Amount of the base currency to convert. 1 if left out.\",\n \"schema\": {\n \"type\": \"number\",\n \"exclusiveMinimum\": 0,\n \"maximum\": 1000000000\n }\n }\n ],\n \"responses\": {\n \"200\": { \"description\": \"Rates for the base currency.\" }\n }\n }\n },\n \"/{date}\": {\n \"get\": {\n \"operationId\": \"getHistoricalRates\",\n \"summary\": \"Exchange rates on one past date (working days, back to 1999-01-04).\",\n \"parameters\": [\n {\n \"name\": \"date\",\n \"in\": \"path\",\n \"required\": true,\n \"description\": \"The date as YYYY-MM-DD.\",\n \"schema\": { \"type\": \"string\", \"pattern\": \"^\\\\d{4}-\\\\d{2}-\\\\d{2}$\" }\n },\n {\n \"name\": \"base\",\n \"in\": \"query\",\n \"description\": \"Three-letter base currency code, like USD. EUR if left out.\",\n \"schema\": { \"type\": \"string\", \"pattern\": \"^[A-Z]{3}$\" }\n },\n {\n \"name\": \"symbols\",\n \"in\": \"query\",\n \"description\": \"Comma-separated codes to return, like EUR,GBP. All if left out.\",\n \"schema\": {\n \"type\": \"string\",\n \"pattern\": \"^[A-Z]{3}(,[A-Z]{3}){0,40}$\"\n }\n }\n ],\n \"responses\": { \"200\": { \"description\": \"Rates on that date.\" } }\n }\n }\n }\n}\n"
12};
13
14
15const run = await client.actor("brasspage/gpt-action-to-mcp").call(input);
16
17
18console.log('Results from dataset');
19console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
20const { items } = await client.dataset(run.defaultDatasetId).listItems();
21items.forEach((item) => {
22 console.dir(item);
23});
24
25