{
    "openapi": "3.1.0",
    "info": {
        "title": "Maps API",
        "version": "v1",
        "description": "Adresssuche, Geokodierung und Routenberechnung über eine Schnittstelle."
    },
    "servers": [
        {
            "url": "https://api.flowdata.one/v1",
            "description": "FlowData API"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        }
    ],
    "tags": [
        {
            "name": "search",
            "description": "Standort-Suche"
        },
        {
            "name": "geocoding",
            "description": "Geokodierung"
        },
        {
            "name": "routing",
            "description": "Routen"
        }
    ],
    "paths": {
        "/maps/search": {
            "get": {
                "operationId": "maps-search",
                "summary": "Adressen und Orte suchen",
                "description": "Sucht nach Adressen und Orten. Ein bereits vorhandenes Ergebnis wird aus der eigenen Datenbank geliefert, ohne einen Kartendienst zu fragen. Eine Suche ohne Treffer wird nicht berechnet.",
                "tags": [
                    "search"
                ],
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": true,
                        "description": "Suchbegriff, höchstens 256 Zeichen",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Anzahl der Treffer, 1 bis 10, Standard 10",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "Länderfilter, ISO 3166-1 alpha-2, zum Beispiel DE",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "language",
                        "in": "query",
                        "required": false,
                        "description": "Sprache der Ergebnisse, Standard de",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "proximity",
                        "in": "query",
                        "required": false,
                        "description": "Bevorzugter Standort als lng,lat",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "types",
                        "in": "query",
                        "required": false,
                        "description": "Ergebnistypen; die Anfrage geht dann direkt an Mapbox",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "addresses": [
                                        {
                                            "full_address": "Berlin, Deutschland",
                                            "lat": 52.5200066,
                                            "lng": 13.404954,
                                            "place_name": "Berlin",
                                            "postcode_name": "10115",
                                            "country_name": "Deutschland",
                                            "country_code": "DE"
                                        }
                                    ],
                                    "attribution": "NOTICE: © 2026 FlowSuite and its suppliers. All rights reserved. Use of this data is subject to the Terms of Service (https://creativeskyline.de/agb). This response and the information it contains may not be retained."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/maps/geocode": {
            "get": {
                "operationId": "maps-geocode",
                "summary": "Adresse oder Koordinaten auflösen",
                "description": "Wandelt eine Adresse in Koordinaten und vollständige Adressdaten um oder Koordinaten zurück in eine Adresse. Berechnet wird nur eine erfolgreiche Antwort; 404 ohne Treffer ist kostenlos.",
                "tags": [
                    "geocoding"
                ],
                "parameters": [
                    {
                        "name": "address",
                        "in": "query",
                        "required": false,
                        "description": "Adresse für die Vorwärtssuche",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "lng",
                        "in": "query",
                        "required": false,
                        "description": "Längengrad für die Rückwärtssuche, zusammen mit lat",
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "lat",
                        "in": "query",
                        "required": false,
                        "description": "Breitengrad für die Rückwärtssuche, zusammen mit lng",
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "Länderfilter, ISO 3166-1 alpha-2",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "language",
                        "in": "query",
                        "required": false,
                        "description": "Sprache der Ergebnisse, Standard de",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "address": {
                                        "full_address": "Friedrichstraße 43, 10117 Berlin, Deutschland",
                                        "lat": 52.5094,
                                        "lng": 13.3889,
                                        "place_name": "Berlin",
                                        "postcode_name": "10117",
                                        "country_name": "Deutschland",
                                        "country_code": "DE"
                                    },
                                    "attribution": "NOTICE: © 2026 FlowSuite and its suppliers. All rights reserved. Use of this data is subject to the Terms of Service (https://creativeskyline.de/agb). This response and the information it contains may not be retained."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/maps/directions": {
            "get": {
                "operationId": "maps-directions",
                "summary": "Route berechnen",
                "description": "Berechnet eine Route zwischen zwei oder mehr Punkten, mit Entfernung, Dauer und Geometrie. Berechnet wird nur eine erfolgreiche Antwort; 404 ohne Route ist kostenlos.",
                "tags": [
                    "routing"
                ],
                "parameters": [
                    {
                        "name": "origin",
                        "in": "query",
                        "required": true,
                        "description": "Startpunkt als lng,lat, zum Beispiel 13.4050,52.5200",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "destination",
                        "in": "query",
                        "required": true,
                        "description": "Zielpunkt als lng,lat",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "profile",
                        "in": "query",
                        "required": false,
                        "description": "driving, driving-traffic, walking oder cycling, Standard driving-traffic",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "waypoints",
                        "in": "query",
                        "required": false,
                        "description": "Zwischenstopps als lng,lat, getrennt durch |",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "language",
                        "in": "query",
                        "required": false,
                        "description": "Sprache der Wegbeschreibung, Standard de",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "routes": [
                                        {
                                            "distance": 3120.4,
                                            "duration": 540.2,
                                            "legs": [
                                                {
                                                    "distance": 3120.4,
                                                    "duration": 540.2
                                                }
                                            ]
                                        }
                                    ],
                                    "attribution": "NOTICE: © 2026 FlowSuite and its suppliers. All rights reserved. Use of this data is subject to the Terms of Service (https://creativeskyline.de/agb). This response and the information it contains may not be retained."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "description": "FlowData-Schlüssel als Authorization: Bearer fd_…"
            }
        },
        "schemas": {
            "Error": {
                "type": "object",
                "required": [
                    "error"
                ],
                "properties": {
                    "error": {
                        "type": "object",
                        "properties": {
                            "code": {
                                "type": "string"
                            },
                            "message": {
                                "type": "string"
                            },
                            "type": {
                                "type": "string"
                            },
                            "details": {
                                "type": "object"
                            }
                        }
                    }
                }
            }
        }
    }
}