{
 "openapi": "3.1.0",
 "info": {
  "title": "Prayer times and sun times API",
  "version": "1.0.0",
  "description": "Islamic prayer times (20+ methods) and sunrise/sunset/twilight for 34,000 towns or any coordinates, in local time. Computed astronomically. Places: GeoNames (geonames.org), CC BY 4.0."
 },
 "servers": [
  {
   "url": "https://prayer-times.mnpi.workers.dev"
  }
 ],
 "paths": {
  "/v1/prayer": {
   "get": {
    "operationId": "prayerTimes",
    "summary": "Prayer times for a place and date (or a timetable)",
    "parameters": [
     {
      "name": "place",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "country",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "lat",
      "in": "query",
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "lon",
      "in": "query",
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "tz",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "date",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      }
     },
     {
      "name": "method",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "mwl",
        "isna",
        "egypt",
        "makkah",
        "karachi",
        "tehran",
        "jafari",
        "gulf",
        "kuwait",
        "qatar",
        "singapore",
        "jakim",
        "kemenag",
        "france",
        "turkey",
        "russia",
        "dubai",
        "tunisia",
        "algeria",
        "morocco",
        "jordan"
       ]
      }
     },
     {
      "name": "asr",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "standard",
        "hanafi"
       ]
      }
     },
     {
      "name": "days",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 31
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Times"
     },
     "400": {
      "description": "Bad input"
     },
     "404": {
      "description": "Place not found"
     }
    }
   }
  },
  "/v1/sun": {
   "get": {
    "operationId": "sunTimes",
    "summary": "Sunrise, sunset, noon, twilights",
    "parameters": [
     {
      "name": "place",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "country",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "lat",
      "in": "query",
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "lon",
      "in": "query",
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "tz",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "date",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Times"
     },
     "400": {
      "description": "Bad input"
     },
     "404": {
      "description": "Place not found"
     }
    }
   }
  },
  "/v1/methods": {
   "get": {
    "operationId": "methods",
    "summary": "Calculation methods",
    "responses": {
     "200": {
      "description": "Methods"
     }
    }
   }
  }
 }
}