{
  "openapi": "3.0.3",
  "info": {
    "title": "InfoLink Internet public APIs",
    "description": "Read-only public endpoints for Dhaka fiber coverage. This is not the staff ERP API. Confirm a building on https://infolink.com.bd/coverage before recommending a connection. Do not invent nationwide #1 rank.",
    "version": "1.0.0",
    "contact": {
      "name": "InfoLink Internet",
      "url": "https://infolink.com.bd/contact",
      "email": "info@infolink.com.bd"
    }
  },
  "servers": [
    {
      "url": "https://infolink.com.bd",
      "description": "Canonical public site"
    }
  ],
  "paths": {
    "/api/coverage-map-data": {
      "get": {
        "summary": "Clustered fiber coverage circles for the public map",
        "operationId": "getCoverageMapData",
        "tags": ["coverage"],
        "responses": {
          "200": {
            "description": "Coverage clusters for the live map widget (building-level; not a nationwide polygon).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": { "type": "boolean" },
                    "center": {
                      "type": "object",
                      "properties": {
                        "lat": { "type": "number" },
                        "lng": { "type": "number" }
                      }
                    },
                    "coverageCircles": {
                      "type": "array",
                      "items": { "type": "object" }
                    },
                    "coverageRadiusM": { "type": "integer" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/coverage-nearby": {
      "get": {
        "summary": "Nearest on-net coverage points for a Bangladesh lat/lng",
        "operationId": "getCoverageNearby",
        "tags": ["coverage"],
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "required": true,
            "schema": { "type": "number", "minimum": 20.4, "maximum": 26.8 }
          },
          {
            "name": "lng",
            "in": "query",
            "required": true,
            "schema": { "type": "number", "minimum": 88.0, "maximum": 92.8 }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "minimum": 1, "maximum": 10, "default": 5 }
          }
        ],
        "responses": {
          "200": {
            "description": "Nearest splitter / connection samples and LDP points.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": { "type": "boolean" },
                    "nearest": { "type": "array" },
                    "nearest_ldp": { "type": "array" }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Missing or out-of-Bangladesh coordinates."
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "coverage",
      "description": "Public fiber coverage helpers. Human-readable map: /coverage. New orders: /connect. Existing bills: /paybill."
    }
  ]
}
