{
  "openapi": "3.1.0",
  "info": {
    "title": "Awwab Qibla API",
    "version": "1.0.0",
    "description": "Free, keyless Qibla direction. True bearing from north and distance to the Kaaba (21.422487, 39.826206), by great circle. Coordinates are never logged or stored. Please credit \"Qibla direction by Awwab · https://awwab.app/qibla\".",
    "termsOfService": "https://awwab.app/terms",
    "contact": {
      "name": "Awwab",
      "url": "https://awwab.app/contact"
    }
  },
  "servers": [
    {
      "url": "https://awwab.app"
    }
  ],
  "externalDocs": {
    "description": "Developers page (API, MCP server, widget)",
    "url": "https://awwab.app/qibla/developers"
  },
  "paths": {
    "/api/qibla": {
      "get": {
        "operationId": "findQibla",
        "summary": "Qibla direction for a place",
        "description": "Give lat and lon, or a city name (optionally with an ISO country code). Rate limit: about one request per second per IP.",
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            },
            "description": "Latitude in degrees"
          },
          {
            "name": "lon",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            },
            "description": "Longitude in degrees"
          },
          {
            "name": "city",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "City name, e.g. Karachi"
          },
          {
            "name": "country",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "ISO 3166-1 alpha-2 code to narrow a city name, e.g. IN"
          },
          {
            "name": "lang",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "ar",
                "id",
                "tr",
                "ur",
                "fr",
                "ms",
                "ru",
                "zh",
                "es",
                "pt",
                "uz",
                "az",
                "ha"
              ]
            },
            "description": "Language of place names and the sentence"
          }
        ],
        "responses": {
          "200": {
            "description": "bearing_true, bearing_magnetic, magnetic_declination, cardinal, distance_km, distance_mi, sentence, attribution, live_compass_url",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "City not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcp",
        "summary": "MCP server (Streamable HTTP, JSON-RPC), tools find_qibla, start_quiz and check_answer, read-only, no auth",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}