# CNB Czech Exchange Rate Fixings by Date (`thatmike1/ce-cz-cnb-fx-fixings`) Actor

Export official CNB CZK exchange rates for requested dates. Keep actual fixing dates, currency amounts and missing-currency coverage, including weekend carry-forwards.

- **URL**: https://apify.com/thatmike1/ce-cz-cnb-fx-fixings.md
- **Developed by:** [Michal Pšenčík](https://apify.com/thatmike1) (community)
- **Categories:** Business, Automation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.00005 / actor start

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## CNB Czech Exchange Rate Fixings by Date

Export the Czech National Bank's official CZK exchange-rate fixing for the dates you choose: one dataset row per requested date, with the rates for your currencies, the date the fixing is actually valid for, and the CNB's own `amount` denominator. It reads CNB's official keyless API (`api.cnb.cz`), so a bookkeeping export, a monthly reconciliation or a small integration can get dated CZK rates on a schedule without maintaining the parsing.

This is CNB fixing data, not bank buy/sell rates, conversions, trading signals or accounting advice. The actor does not compute per-unit rates, cross rates or averages, and it does not watch for changes between runs. It is independent of the CNB and not endorsed by it.

### Input

```json
{
    "dates": ["2026-10-22"],
    "currencies": ["EUR", "USD", "GBP"],
    "maxItems": 31
}
```

- `dates`: 1 to 31 calendar dates (`YYYY-MM-DD`) from 2020-01-01 through today in Europe/Prague. Duplicates are merged and dates sorted. Leave it out for yesterday (Prague time), which always has a fixing to return.
- `currencies`: 1 to 30 distinct three-letter codes; spaces are trimmed and letters uppercased. Default `EUR`, `GBP`, `USD`. A code the CNB does not publish that day is listed in `missingCurrencies`, never substituted.
- `maxItems`: stop after this many date bundles are stored, 1 to 31 (default 31). Every date is still checked and reported in the free summary.

Unknown fields, wrong types, impossible or future dates fail the run before any request, with the reason in `SUMMARY`.

### Output

One row per requested date that has at least one of your currencies:

```json
{
    "schemaVersion": 1,
    "id": "cnb-fx:2026-10-22:EUR,GBP,USD",
    "requestedDate": "2026-10-22",
    "validFor": "2026-10-22",
    "sourceOrder": 204,
    "baseCurrency": "CZK",
    "quotes": [
        { "currencyCode": "EUR", "country": "EMU", "currencyName": "euro", "amount": 1, "rateCzk": "24.265" },
        {
            "currencyCode": "GBP",
            "country": "United Kingdom",
            "currencyName": "pound",
            "amount": 1,
            "rateCzk": "28.961"
        },
        { "currencyCode": "USD", "country": "USA", "currencyName": "dollar", "amount": 1, "rateCzk": "21.651" }
    ],
    "missingCurrencies": [],
    "observedAt": "2026-10-22T22:24:53.293Z",
    "sourceUrl": "https://api.cnb.cz/cnbapi/exrates/daily?date=2026-10-22&lang=EN",
    "sourceResponseSha256": "a1d51f47cb083832ffb408c57d3bf8d4c5290d2ab9d3654970b0fa62f333fdf0"
}
```

- `rateCzk` is CZK per `amount` units of the currency, as an exact decimal string. HUF and JPY are quoted per 100 (`"amount": 100`); the actor never divides that out.
- `validFor` is the CNB fixing date. A weekend or holiday request returns the last earlier fixing: requesting Sunday 2026-10-18 gives `validFor` 2026-10-16. It is never relabelled as the requested date.
- `sourceOrder` is the CNB's sequence number of that fixing in its year.
- `id` is stable for the same requested date and currency list, so a later run's row for the same date can be compared with an earlier one. Rows are appended in requested-date order within a run; sort by `requestedDate` if a resumed run appended an earlier date late.
- `observedAt` is when the actor received the response, not a CNB publication time. `sourceResponseSha256` is the SHA-256 of the raw response.

Dates with no table (an empty response), failed dates and missing currencies get no row and no charge; they are listed in `SUMMARY`.

### Run summary (free)

Every run writes `SUMMARY` to its key-value store: `status` (`complete`, `partial`, `empty` or `error`), counts of requests and rows, `sourceCoverage` (successful, no-data and failed dates, `validForByDate`, `missingCurrenciesByDate`), `errors`, `stopReason` and `nextAction` (which dates to retry, or that a larger `maxItems` or spending limit would deliver more). A `RECOVERY` record lets a migrated run continue without storing a row twice.

### Pricing

Pay per event, using only Apify's two built-in events:

- Actor start: $0.00005 per run (one start unit at the 256 MB default).
- Dataset item: $0.001 per stored date bundle. Unchanged values and weekend carry-forwards are billed like any other stored bundle, because each is a separate requested-date check. Three currencies on 31 dates cost $0.031 plus the start event.

Errors, missing currencies, empty dates and the summary are free. When your spending limit is reached the actor stops before storing the next row and says so in `SUMMARY`.

### Limits and source behaviour

- Requests are sequential with at least 1.2 s between them, at most 93 per run including retries, within 180 seconds. A 403, 429 or challenge page stops requests for the rest of the run and is reported; it is never worked around.
- Coverage is what the CNB API returns for each date: about 30 currencies today, 33 on 2020-01-01. No historic revision or completeness guarantee is made.
- Separate runs are independent and bill separately.

# Actor input Schema

## `dates` (type: `array`):

1 to 31 calendar dates from 2020-01-01 through today in Europe/Prague. Each date returns the CNB fixing valid for it: a weekend or holiday gets the last earlier fixing, with its actual date in validFor. Duplicates are merged and dates sorted. Leave empty for yesterday (Prague time).

## `currencies` (type: `array`):

1 to 30 distinct three-letter codes (spaces trimmed, letters uppercased). Each rate is CZK per the source amount of the currency (100 for HUF, JPY and a few others). A code CNB does not publish that day is listed in missingCurrencies, never substituted.

## `maxItems` (type: `integer`):

Stop after this many requested-date bundles are stored (each one is a billed dataset item). Every date is still checked and reported in the free SUMMARY.

## Actor input object example

```json
{
  "currencies": [
    "EUR",
    "GBP",
    "USD"
  ],
  "maxItems": 31
}
```

# Actor output Schema

## `bundles` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "currencies": [
        "EUR",
        "GBP",
        "USD"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("thatmike1/ce-cz-cnb-fx-fixings").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "currencies": [
        "EUR",
        "GBP",
        "USD",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("thatmike1/ce-cz-cnb-fx-fixings").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "currencies": [
    "EUR",
    "GBP",
    "USD"
  ]
}' |
apify call thatmike1/ce-cz-cnb-fx-fixings --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,thatmike1/ce-cz-cnb-fx-fixings"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/eFXlvNgJOyjt1xVyc/builds/V0XXbAGx9d15KGK8c/openapi.json
