{
    "openapi": "3.1.0",
    "info": {
        "title": "Nakordoni Developer API — Border Weather Condition 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/weather"
    },
    "servers": [
        {
            "url": "https://nakordoni.eu",
            "description": "Production"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        },
        {
            "apiKeyHeader": []
        },
        {
            "apiKeyQuery": []
        }
    ],
    "tags": [
        {
            "name": "weather",
            "description": "Border Weather Condition API",
            "externalDocs": {
                "url": "https://nakordoni.eu/en/developers/docs/weather"
            }
        }
    ],
    "paths": {
        "/api/v1/data/weather": {
            "get": {
                "tags": [
                    "weather"
                ],
                "summary": "Border Weather Condition API",
                "description": "The road-hazard condition at a border checkpoint on a single 0..5 scale: 0 clear road, 1 fog, 2 snow, 3 rain, 4 ice, 5 strong wind, named in the requested language and graded by severity. This is our own classification, not a meteorological feed — no temperature, pressure or wind readings are served, and none are needed to decide whether the approach is safe. Two writers feed the same scale: what drivers themselves report from the queue, and our weather models mapped onto it; ?sources= keeps only one of them. Every answer carries observed_at, data_age_minutes and is_fresh, and says no_data outright rather than implying a clear road when nothing was reported inside the window.\n\nExample: `/api/v1/data/weather?ppid=id_13&lang=en`\n\nHuman docs: https://nakordoni.eu/en/developers/docs/weather",
                "operationId": "weatherV1",
                "parameters": [
                    {
                        "name": "ppid",
                        "in": "query",
                        "required": false,
                        "description": "Checkpoint ID, e.g. id_13 (see /api/v1/data/checkpoints)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "lang",
                        "in": "query",
                        "required": false,
                        "description": "Language for condition and severity names (any of the 25 site languages plus hr, nl, pt; default en)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "sources",
                        "in": "query",
                        "required": false,
                        "description": "all (default) | community — only what drivers reported | model — only our weather-model classification",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "max_age_minutes",
                        "in": "query",
                        "required": false,
                        "description": "How far back a marker may be and still count (default 180, min 15, max 1440). Markers are written roughly hourly per checkpoint; driver reports arrive irregularly",
                        "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": {
                                                        "condition": {
                                                            "type": "object",
                                                            "properties": {
                                                                "code": {
                                                                    "description": "The marker, 0..5, with key the stable machine name (good, fog, snow, rain, ice, wind) and name the same thing in the requested language, worded for a driver (\"Slippery!\", not \"freezing precipitation\"). null when nothing was reported inside the window — see data.no_data."
                                                                },
                                                                "severity": {
                                                                    "description": "none | low | moderate | major, the same severity vocabulary road-conditions uses, with severity_name in the requested language."
                                                                },
                                                                "severity_rank": {
                                                                    "description": "Danger order when you sort several checkpoints: 1 ice, 2 fog, 3 snow, 4 rain, 5 wind, 6 clear. Lower is worse — the codes themselves are NOT an order."
                                                                },
                                                                "hazard": {
                                                                    "description": "true for anything but a clear road, so a client can gate an alert on one field."
                                                                }
                                                            }
                                                        },
                                                        "observed_at": {
                                                            "description": "When the marker was written (Europe/Kyiv), with observed_ts as a Unix timestamp."
                                                        },
                                                        "data_age_minutes": {
                                                            "description": "Age of that marker in minutes, with is_fresh true when it is under 3 hours old. Read it before treating the answer as current."
                                                        },
                                                        "source_type": {
                                                            "description": "community when a driver reported it, model when our weather model classified it. null when there is no marker."
                                                        },
                                                        "no_data": {
                                                            "description": "true when no marker exists for this checkpoint inside the window — an honest gap, not a clear road. Widen max_age_minutes or drop the sources filter."
                                                        },
                                                        "scale": {
                                                            "description": "The whole 0..5 vocabulary as an array indexed by code, so you can label a value without hardcoding our wording."
                                                        },
                                                        "sources": {
                                                            "description": "The filters actually applied, with window_minutes — both echoed back after clamping."
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "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"
                        }
                    }
                }
            }
        }
    }
}
