{
  "openapi": "3.1.0",
  "info": {
    "title": "Waqti.nl Gebedstijden API",
    "version": "1.0.0",
    "description": "Gratis REST API voor gebedstijden in Nederland en België, iqama-tijden van moskeeën (via MAWAQIT) en Qibla-richting. Geen token nodig (60 requests/min per IP). Alle tijden in Europe/Amsterdam, HH:MM.",
    "contact": {
      "url": "https://waqti.nl/developers/api"
    }
  },
  "externalDocs": {
    "url": "https://waqti.nl/developers/api"
  },
  "servers": [
    {
      "url": "https://waqti.nl/api/v1"
    }
  ],
  "security": [
    {},
    {
      "bearer": []
    },
    {
      "apiKeyHeader": []
    }
  ],
  "paths": {
    "/salaat": {
      "get": {
        "operationId": "getPrayerTimes",
        "summary": "Gebedstijden voor een locatie of moskee",
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "required": false,
            "description": "Breedtegraad. Verplicht, behalve bij source=mawaqit met mosque.",
            "schema": {
              "type": "number"
            },
            "example": 52.3676
          },
          {
            "name": "lng",
            "in": "query",
            "required": false,
            "description": "Lengtegraad. Verplicht, behalve bij source=mawaqit met mosque.",
            "schema": {
              "type": "number"
            },
            "example": 4.9041
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "Berekeningsbron",
            "schema": {
              "type": "string",
              "enum": [
                "waqti",
                "awqati",
                "diyanet",
                "custom",
                "mawaqit"
              ],
              "default": "waqti"
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "description": "Startdatum YYYY-MM-DD (standaard vandaag)",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "rangeInt",
            "in": "query",
            "required": false,
            "description": "Aantal extra dagen (6 = week)",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 31,
              "default": 0
            }
          },
          {
            "name": "mosque",
            "in": "query",
            "required": false,
            "description": "Moskee-slug, verplicht bij source=mawaqit",
            "schema": {
              "type": "string"
            },
            "example": "taoba-ijsselstein"
          },
          {
            "name": "diyanet_location_id",
            "in": "query",
            "required": false,
            "description": "Diyanet locatie-ID (source=diyanet)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fajr_angle",
            "in": "query",
            "required": false,
            "description": "Fajr-hoek in graden (source=custom)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "isha_angle",
            "in": "query",
            "required": false,
            "description": "Isha-hoek in graden (source=custom)",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Gebedstijden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalaatResponse"
                }
              }
            }
          },
          "400": {
            "description": "Fout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Fout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Fout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/masaajid": {
      "get": {
        "operationId": "listMosques",
        "summary": "Lijst van moskeeën in Nederland",
        "parameters": [
          {
            "name": "city",
            "in": "query",
            "required": false,
            "description": "Filter op stad",
            "schema": {
              "type": "string"
            },
            "example": "amsterdam"
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Zoek op naam, stad of adres",
            "schema": {
              "type": "string"
            },
            "example": "taoba"
          }
        ],
        "responses": {
          "200": {
            "description": "Moskeeën",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MosqueSummary"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Fout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/masaajid/{slug}": {
      "get": {
        "operationId": "getMosque",
        "summary": "Eén moskee met de adhan- en iqama-tijden van vandaag",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "taoba-ijsselstein",
            "description": "MAWAQIT-slug van de moskee"
          }
        ],
        "responses": {
          "200": {
            "description": "Moskee",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "$ref": "#/components/schemas/MosqueDetail"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Fout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Fout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/qibla": {
      "get": {
        "operationId": "getQibla",
        "summary": "Qibla-richting vanaf een locatie",
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "required": true,
            "description": "Breedtegraad",
            "schema": {
              "type": "number"
            },
            "example": 52.3676
          },
          {
            "name": "lng",
            "in": "query",
            "required": true,
            "description": "Lengtegraad",
            "schema": {
              "type": "number"
            },
            "example": 4.9041
          }
        ],
        "responses": {
          "200": {
            "description": "Qibla",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "angle": {
                          "type": "number",
                          "description": "Graden vanaf het noorden"
                        },
                        "direction": {
                          "type": "string",
                          "example": "SE"
                        },
                        "distance_km": {
                          "type": "number"
                        },
                        "from": {
                          "type": "object",
                          "properties": {
                            "lat": {
                              "type": "number"
                            },
                            "lng": {
                              "type": "number"
                            }
                          }
                        },
                        "to": {
                          "type": "object",
                          "properties": {
                            "lat": {
                              "type": "number"
                            },
                            "lng": {
                              "type": "number"
                            },
                            "name": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Fout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Fout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Optioneel: token zonder rate limit"
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-token"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "const": false
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      },
      "PrayerDay": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "fajr": {
            "type": "string",
            "pattern": "^d{2}:d{2}$",
            "example": "13:27"
          },
          "sunrise": {
            "type": "string",
            "pattern": "^d{2}:d{2}$",
            "example": "13:27"
          },
          "dhuhr": {
            "type": "string",
            "pattern": "^d{2}:d{2}$",
            "example": "13:27"
          },
          "asr": {
            "type": "string",
            "pattern": "^d{2}:d{2}$",
            "example": "13:27"
          },
          "maghrib": {
            "type": "string",
            "pattern": "^d{2}:d{2}$",
            "example": "13:27"
          },
          "isha": {
            "type": "string",
            "pattern": "^d{2}:d{2}$",
            "example": "13:27"
          },
          "firstThirdOfTheNight": {
            "type": "string",
            "pattern": "^d{2}:d{2}$",
            "example": "13:27"
          },
          "middleOfTheNight": {
            "type": "string",
            "pattern": "^d{2}:d{2}$",
            "example": "13:27"
          },
          "lastThirdOfTheNight": {
            "type": "string",
            "pattern": "^d{2}:d{2}$",
            "example": "13:27"
          },
          "latitude": {
            "type": "number"
          },
          "longitude": {
            "type": "number"
          }
        }
      },
      "SalaatResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "source": {
            "type": "string"
          },
          "locationName": {
            "type": [
              "string",
              "null"
            ]
          },
          "timezone": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrayerDay"
            }
          }
        }
      },
      "MosqueSummary": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "localisation": {
            "type": "string"
          },
          "latitude": {
            "type": "number"
          },
          "longitude": {
            "type": "number"
          },
          "url": {
            "type": "string"
          },
          "api_url": {
            "type": "string"
          }
        }
      },
      "MosqueDetail": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "latitude": {
            "type": "number"
          },
          "longitude": {
            "type": "number"
          },
          "image": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "string"
          },
          "mawaqit_url": {
            "type": "string"
          },
          "prayer_times": {
            "type": "object",
            "properties": {
              "fajr": {
                "type": "string",
                "pattern": "^d{2}:d{2}$",
                "example": "13:27"
              },
              "sunrise": {
                "type": "string",
                "pattern": "^d{2}:d{2}$",
                "example": "13:27"
              },
              "dhuhr": {
                "type": "string",
                "pattern": "^d{2}:d{2}$",
                "example": "13:27"
              },
              "asr": {
                "type": "string",
                "pattern": "^d{2}:d{2}$",
                "example": "13:27"
              },
              "maghrib": {
                "type": "string",
                "pattern": "^d{2}:d{2}$",
                "example": "13:27"
              },
              "isha": {
                "type": "string",
                "pattern": "^d{2}:d{2}$",
                "example": "13:27"
              }
            }
          },
          "iqama_times": {
            "type": "object",
            "properties": {
              "fajr": {
                "type": "string",
                "pattern": "^d{2}:d{2}$",
                "example": "13:27"
              },
              "dhuhr": {
                "type": "string",
                "pattern": "^d{2}:d{2}$",
                "example": "13:27"
              },
              "asr": {
                "type": "string",
                "pattern": "^d{2}:d{2}$",
                "example": "13:27"
              },
              "maghrib": {
                "type": "string",
                "pattern": "^d{2}:d{2}$",
                "example": "13:27"
              },
              "isha": {
                "type": "string",
                "pattern": "^d{2}:d{2}$",
                "example": "13:27"
              }
            }
          },
          "jumua": {
            "type": "string"
          },
          "jumua2": {
            "type": [
              "string",
              "null"
            ]
          },
          "jumua3": {
            "type": [
              "string",
              "null"
            ]
          },
          "night_times": {
            "type": "object",
            "properties": {
              "first_third": {
                "type": "string",
                "pattern": "^d{2}:d{2}$",
                "example": "13:27"
              },
              "middle": {
                "type": "string",
                "pattern": "^d{2}:d{2}$",
                "example": "13:27"
              },
              "last_third": {
                "type": "string",
                "pattern": "^d{2}:d{2}$",
                "example": "13:27"
              }
            }
          },
          "features": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          }
        }
      }
    }
  }
}
