{
    "openapi": "3.1.0",
    "info": {
        "title": "Nakordoni Developer API — Exchange Office Cities API",
        "version": "2026-12-04",
        "summary": "REST + JSON over HTTPS. One base URL, one key, predictable envelopes.",
        "description": "Generated from the Nakordoni Developer API endpoint registry (the same source as https://nakordoni.eu/api/v1/docs.md). Path-versioned per endpoint: /api/v1/… is stable; /api/v2/… and newer serve the newer behaviour only for the endpoints listed. Free key: https://nakordoni.eu/en/developers/signup",
        "termsOfService": "https://nakordoni.eu/en/p/developer_api_terms",
        "contact": {
            "name": "Nakordoni Developer Portal",
            "url": "https://nakordoni.eu/en/developers"
        },
        "license": {
            "name": "Nakordoni Developer API Terms",
            "url": "https://nakordoni.eu/en/p/developer_api_terms"
        }
    },
    "externalDocs": {
        "description": "API documentation",
        "url": "https://nakordoni.eu/en/developers/docs/exchange-cities"
    },
    "servers": [
        {
            "url": "https://nakordoni.eu",
            "description": "Production"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        },
        {
            "apiKeyHeader": []
        },
        {
            "apiKeyQuery": []
        }
    ],
    "tags": [
        {
            "name": "exchange-cities",
            "description": "Exchange Office Cities API",
            "externalDocs": {
                "url": "https://nakordoni.eu/en/developers/docs/exchange-cities"
            }
        }
    ],
    "paths": {
        "/api/v2/data/exchange-cities": {
            "get": {
                "tags": [
                    "exchange-cities"
                ],
                "summary": "Exchange Office Cities API",
                "description": "Polish cities where we list currency exchange offices (kantors), with how many offices each has and how many currently publish rates. Use the city id with the other exchange products.\n\nExample: `/api/v2/data/exchange-cities?lang=en`\n\nHuman docs: https://nakordoni.eu/en/developers/docs/exchange-cities",
                "operationId": "exchangeCitiesV2",
                "parameters": [
                    {
                        "name": "lang",
                        "in": "query",
                        "required": false,
                        "description": "Language for city names (default en)",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response (shared envelope; `data` as documented).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/ApiEnvelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "cities": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "description": "City id — the value the city parameter of the other exchange products takes."
                                                                    },
                                                                    "name": {
                                                                        "description": "City name in the requested language, with country (always PL), lat and lon."
                                                                    },
                                                                    "type": {
                                                                        "description": "border = a border town, hub = a large city."
                                                                    },
                                                                    "offices": {
                                                                        "description": "Listed exchange offices in the city."
                                                                    },
                                                                    "offices_with_current_rates": {
                                                                        "description": "Offices whose rates were updated in the last 72 hours."
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "quote_currency": {
                                                            "description": "Currency every rate is quoted in (PLN)."
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/E400"
                    },
                    "401": {
                        "$ref": "#/components/responses/E401"
                    },
                    "403": {
                        "$ref": "#/components/responses/E403"
                    },
                    "404": {
                        "$ref": "#/components/responses/E404"
                    },
                    "410": {
                        "$ref": "#/components/responses/E410"
                    },
                    "429": {
                        "$ref": "#/components/responses/E429"
                    },
                    "500": {
                        "$ref": "#/components/responses/E500"
                    },
                    "503": {
                        "$ref": "#/components/responses/E503"
                    },
                    "504": {
                        "$ref": "#/components/responses/E504"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "bearerFormat": "NKD-DEV-XXXX-XXXX-XXXX",
                "description": "API key from https://nakordoni.eu/en/developers, sent as `Authorization: Bearer NKD-DEV-…` (preferred)."
            },
            "apiKeyHeader": {
                "type": "apiKey",
                "in": "header",
                "name": "X-API-Key",
                "description": "Same API key in the X-API-Key header."
            },
            "apiKeyQuery": {
                "type": "apiKey",
                "in": "query",
                "name": "key",
                "description": "Same API key as ?key= (fallback; keys in URLs end up in logs)."
            }
        },
        "schemas": {
            "ApiEnvelope": {
                "type": "object",
                "required": [
                    "ok"
                ],
                "properties": {
                    "ok": {
                        "type": "boolean",
                        "const": true
                    },
                    "api_version": {
                        "type": "string",
                        "description": "Version that served the call, e.g. \"1\", \"v2\"."
                    },
                    "product": {
                        "type": "string"
                    },
                    "attribution": {
                        "type": "string",
                        "description": "Show this attribution with the data."
                    },
                    "data": {
                        "description": "Product payload — shape per product, see the operation."
                    },
                    "snapshot": {
                        "type": "object"
                    },
                    "usage": {
                        "type": "object",
                        "properties": {
                            "requests_today": {
                                "type": "integer"
                            },
                            "limit_today": {
                                "type": "integer"
                            },
                            "remaining": {
                                "type": "integer"
                            }
                        }
                    }
                }
            },
            "ApiError": {
                "type": "object",
                "required": [
                    "ok",
                    "error"
                ],
                "properties": {
                    "ok": {
                        "type": "boolean",
                        "const": false
                    },
                    "api_version": {
                        "type": "string"
                    },
                    "error": {
                        "type": "object",
                        "required": [
                            "code",
                            "message"
                        ],
                        "properties": {
                            "code": {
                                "type": "string",
                                "examples": [
                                    "bad_request",
                                    "missing_api_key",
                                    "invalid_api_key",
                                    "product_unavailable",
                                    "unknown_product",
                                    "version_sunset",
                                    "qps_exceeded",
                                    "quota_exceeded",
                                    "internal_error",
                                    "busy",
                                    "timeout"
                                ]
                            },
                            "message": {
                                "type": "string"
                            },
                            "docs": {
                                "type": "string",
                                "format": "uri"
                            },
                            "developer_portal": {
                                "type": "string",
                                "format": "uri"
                            }
                        },
                        "additionalProperties": true
                    }
                }
            }
        },
        "responses": {
            "E400": {
                "description": "Bad request (bad_request, invalid_country, unsupported_version, geocode_failed, scope_required, …).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E401": {
                "description": "Missing API key (missing_api_key).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E403": {
                "description": "Key invalid, blocked or not allowed for this product (invalid_api_key, product_unavailable, not_approved, …).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E404": {
                "description": "Unknown product (unknown_product).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E410": {
                "description": "Version retired (version_sunset, version_closed_to_new_accounts).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E429": {
                "description": "Rate or quota limit (qps_exceeded, quota_exceeded, duplicate_request, ip_temporarily_blocked). See Retry-After.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E500": {
                "description": "Internal error (internal_error).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E503": {
                "description": "Temporarily unavailable (busy).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E504": {
                "description": "Upstream timeout (timeout).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            }
        }
    }
}
