{
  "openapi": "3.0.1",
  "info": {
    "title": "Exchange Rates Scraper — ECB & National Bank of Kazakhstan FX",
    "description": "Fiat exchange rates for AI agents: ECB reference rates for 30 currencies plus official National Bank of Kazakhstan rates for KZT, RUB, UZS, KGS, AED and 40+ more. Latest, historical date, daily time series since 1999, conversion, 1d/7d/30d/YTD changes, wide/long output. No API key.",
    "version": "0.1",
    "x-build-id": "Mn18wTayFYNbVpGFT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/yadroo~fx-rates/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-yadroo-fx-rates",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/yadroo~fx-rates/runs": {
      "post": {
        "operationId": "runs-sync-yadroo-fx-rates",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/yadroo~fx-rates/run-sync": {
      "post": {
        "operationId": "run-sync-yadroo-fx-rates",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "latest",
              "date",
              "history",
              "convert",
              "currencies"
            ],
            "type": "string",
            "description": "What to fetch. `latest`: newest rate per currency (ECB = last business day, NBK = today's official rate). `date`: rates as of `date` (ECB returns the last business day on or before it). `history`: one row per day per currency between `startDate` and `endDate`, oldest date first. `convert`: like latest/date but adds `amount` and `converted`. `currencies`: dictionary of codes with which source quotes them — no rates. Only these five values are accepted: Apify refuses any other value before the run starts.",
            "default": "latest"
          },
          "base": {
            "title": "Base currency",
            "pattern": "^[A-Za-z]{3}$",
            "type": "string",
            "description": "3-letter ISO 4217 code the rates are quoted against (1 base = `rate` units of `currency`); upper or lower case. Default USD. ECB set: USD, EUR, GBP, JPY, CNY, CHF and 24 more; NBK set adds KZT, RUB, UZS, KGS, AED, SAR, TRY… Ignored when `pairs` is set."
          },
          "symbols": {
            "title": "Target currencies",
            "type": "array",
            "description": "ISO codes to quote. Empty = every currency of the chosen source (30 for ECB, 48 for NBK). Codes not covered by the source are reported in a warning (and in the `SUMMARY` key-value record) instead of being silently dropped; with `source: auto` codes missing from the ECB set (e.g. KZT, RUB, UZS) are served by the National Bank of Kazakhstan.",
            "items": {
              "type": "string"
            }
          },
          "pairs": {
            "title": "Currency pairs (alternative to base+symbols)",
            "type": "array",
            "description": "Explicit pairs like `USD/KZT`, `EUR/USD`, `KZT/RUB` (also `USDKZT`, `USD-KZT`). Lets one run mix several bases. When set, `base` and `symbols` are ignored.",
            "items": {
              "type": "string"
            }
          },
          "source": {
            "title": "Rate source",
            "enum": [
              "auto",
              "ecb",
              "nbk"
            ],
            "type": "string",
            "description": "`ecb`: ECB euro reference rates (30 currencies, business days, ~16:00 CET, history since 1999). `nbk`: official daily rates of the National Bank of Kazakhstan (48 currencies against KZT; other pairs are computed as KZT cross rates). `auto` picks ECB whenever both sides are in the ECB set and NBK otherwise, and tags every row with `source`.",
            "default": "auto"
          },
          "date": {
            "title": "Date (mode date / convert)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "YYYY-MM-DD (a real calendar date). Used by modes `date` and `convert` (and `latest`); default = latest available. ECB data starts 1999-01-04, NBK history goes back to the 1990s."
          },
          "startDate": {
            "title": "Start date (history)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "YYYY-MM-DD (a real calendar date), first day of the time series. Default: 30 days before `endDate`."
          },
          "endDate": {
            "title": "End date (history)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "YYYY-MM-DD, last day of the time series. Default: today. ECB history is one request for any range; NBK history costs one request per calendar day, is capped at the last 366 days of the range per run and ends at tomorrow's NBK rate at the latest."
          },
          "amount": {
            "title": "Amount (convert)",
            "type": "string",
            "description": "Amount of `base` to convert in mode `convert` (default 1). Adds `amount` and `converted` to each row (format long). A positive number written as a string: \"2500\", \"2 500.75\" or \"1,000,000\" (commas in groups of three are thousands separators; a single decimal comma like \"2,5\" means 2.5). Anything else stops the run before any request, with nothing charged beyond the start."
          },
          "includeChanges": {
            "title": "Include % changes (1d / 7d / 30d / YTD)",
            "type": "boolean",
            "description": "Modes latest/date/convert, format long: add `change1dPct`, `change7dPct`, `change30dPct`, `changeYtdPct` computed from the rates 1, 7 and 30 days earlier and from the last rate of the previous year (4 extra requests per source; a change that cannot be computed is null). Useful for alerts (\"notify me when USD/KZT moves >1% in a day\"). Not used by mode history or format wide (a warning says so).",
            "default": false
          },
          "includeInverse": {
            "title": "Include inverse rate",
            "type": "boolean",
            "description": "Format long: add `inverseRate` (= 1 / rate), i.e. how many `base` units one `currency` unit buys.",
            "default": false
          },
          "format": {
            "title": "Output format",
            "enum": [
              "long",
              "wide"
            ],
            "type": "string",
            "description": "`long` is the default and works for every mode. `wide` pivots rates into one row per date/base/source with a column per currency code — handy for history exports to spreadsheets. Wide rows carry rates only: `inverseRate`, `amount`/`converted` and the change columns exist in long format only. In wide format each dataset row (= one date) is one billed item and counts once against maxItems.",
            "default": "long"
          },
          "fields": {
            "title": "Output fields",
            "type": "array",
            "description": "Keep only these columns, in this order (`id` is always kept and comes first unless you list it elsewhere). Empty = every column. Columns: format long `date, base, currency, currencyName, rate, inverseRate, amount, converted, change1dPct, change7dPct, change30dPct, changeYtdPct, source, sourceUrl, fetchedAt` (the optional ones need their switch); format wide `date, base, source, sourceUrl, fetchedAt` + currency codes; mode currencies `code, name, ecb, nbk, sources, fetchedAt`. Case, spaces, '_' and '-' do not matter. A name that is not a column of this run is skipped and named in SUMMARY.warnings with the reason (or a \"did you mean\"); when none of the names is a column, the run stops before any request with the list of columns.",
            "items": {
              "type": "string"
            }
          },
          "decimals": {
            "title": "Round rates to N decimals",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Optional rounding of `rate` (and `inverseRate`). Default: raw source precision."
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap on dataset rows — what you are billed for: rate rows in format long, one row per date in format wide, codes in mode currencies. The cut falls on a whole date: a history never ends with a date that has only some of its currencies (unless the first date alone is larger than maxItems, then it keeps its first maxItems rates). History rows come oldest date first, so the cut keeps the earliest dates. The status and SUMMARY.maxItemsReached say where the cut fell. A year of ECB history for all 30 currencies is ~7,400 long rows or ~255 wide rows; ECB history since 1999 for one pair is ~7,000 rows.",
            "default": 5000
          },
          "strict": {
            "title": "Strict mode (fail on unsupported currency)",
            "type": "boolean",
            "description": "When true the run fails if any requested currency is not quoted by the chosen source. Default: log a warning, list them in the `SUMMARY` record and return the rest.",
            "default": false
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}