{
  "openapi": "3.1.0",
  "info": {
    "title": "The Kosher public API",
    "version": "1.0.0",
    "summary": "Find kosher restaurants, cafés, bakeries and shops worldwide, each with the certifier that lists it.",
    "description": "Read-only answers from The Kosher's directory of certified kosher places.\n\nEvery place is shown as its certifier lists it, with the date that listing was last checked. Kashrus can change: tell people to check with the place before going.\n\nTerms: show the attribution field (\"Data from The Kosher, https://www.thekosher.app\") with any answer that uses this data, and link each place's url. The API answers questions; it is not for copying the directory. Full terms: https://www.thekosher.app/developers#terms",
    "termsOfService": "https://www.thekosher.app/developers#terms",
    "contact": {
      "name": "The Kosher",
      "url": "https://www.thekosher.app/contact"
    }
  },
  "servers": [
    {
      "url": "https://www.thekosher.app/api/public/v1"
    }
  ],
  "security": [
    {},
    {
      "apiKey": []
    }
  ],
  "paths": {
    "/search": {
      "get": {
        "operationId": "searchKosherPlaces",
        "summary": "Search for kosher places",
        "description": "Plain-language search, read the same way as the search box on https://www.thekosher.app. Give q (what and where, e.g. \"dairy pizza in Paris\"), near (a place name), or lat and lng. At most 10 results.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "What to find, in any language, optionally with a place: \"sushi in Manhattan\", \"meat restaurant Jerusalem\".",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "near",
            "in": "query",
            "description": "A city, neighbourhood, address or landmark to search around.",
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          },
          {
            "name": "lat",
            "in": "query",
            "description": "Latitude to search around (with lng).",
            "schema": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            }
          },
          {
            "name": "lng",
            "in": "query",
            "description": "Longitude to search around (with lat).",
            "schema": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Results to return, 1 to 10.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10,
              "default": 5
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching places",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or daily quota reached; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/places/{slug}": {
      "get": {
        "operationId": "getKosherPlace",
        "summary": "One place by slug",
        "description": "Full listing for one place: certifier, last verified date, recorded standards, hours and contact details.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "The place slug, the last part of its url.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]{0,199}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The place, or its status when it is not currently listed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such place",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or daily quota reached; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/certifiers/{slug}": {
      "get": {
        "operationId": "getKosherCertifier",
        "summary": "One certifier (hechsher) by slug",
        "description": "The certifier, how many listed places it certifies on The Kosher, and up to 10 of them with links.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "The certifier slug, e.g. ou, ok, star-k.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]{0,199}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The certifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CertifierResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such certifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit or daily quota reached; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Optional. Without a key, requests are limited per IP address. Keys are issued by The Kosher."
      }
    },
    "schemas": {
      "Certifier": {
        "type": "object",
        "required": [
          "name",
          "shortName",
          "url"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The certifier's name as it records it."
          },
          "shortName": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "The certifier's page on The Kosher."
          }
        }
      },
      "Place": {
        "type": "object",
        "required": [
          "name",
          "certifier",
          "lastVerified",
          "verification",
          "url"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The name exactly as its source records it. Never translate it."
          },
          "transliterations": {
            "type": [
              "object",
              "null"
            ],
            "description": "Phonetic spellings in other scripts (latin, hebrew, cyrillic). Not translations.",
            "additionalProperties": {
              "type": "string"
            }
          },
          "address": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "region": {
            "type": [
              "string",
              "null"
            ]
          },
          "postalCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "country": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 3166-1 alpha-2"
          },
          "lat": {
            "type": [
              "number",
              "null"
            ]
          },
          "lng": {
            "type": [
              "number",
              "null"
            ]
          },
          "foodTypes": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string",
              "enum": [
                "MEAT",
                "DAIRY",
                "PAREVE"
              ]
            }
          },
          "foodTypesRecorded": {
            "type": "boolean",
            "description": "False when the meat/dairy reading is the directory's inference, not the certifier's record."
          },
          "venueType": {
            "type": [
              "string",
              "null"
            ]
          },
          "cuisine": {
            "type": [
              "string",
              "null"
            ]
          },
          "certifier": {
            "$ref": "#/components/schemas/Certifier"
          },
          "lastVerified": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the certifier's listing was last checked."
          },
          "verification": {
            "type": "string",
            "enum": [
              "current",
              "check_before_going"
            ]
          },
          "openNow": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "From recorded hours; null when unknown."
          },
          "distanceMeters": {
            "type": [
              "integer",
              "null"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Link this page when citing the place."
          }
        }
      },
      "SearchResponse": {
        "type": "object",
        "required": [
          "apiVersion",
          "results",
          "attribution"
        ],
        "properties": {
          "apiVersion": {
            "const": "v1"
          },
          "query": {
            "type": "object"
          },
          "readAs": {
            "type": "object"
          },
          "total": {
            "type": "integer"
          },
          "results": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/Place"
            }
          },
          "seeAllUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "note": {
            "type": "string"
          },
          "attribution": {
            "type": "string",
            "const": "Data from The Kosher, https://www.thekosher.app"
          },
          "terms": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "PlaceResponse": {
        "type": "object",
        "required": [
          "apiVersion",
          "status",
          "attribution"
        ],
        "properties": {
          "apiVersion": {
            "const": "v1"
          },
          "status": {
            "type": "string",
            "enum": [
              "listed",
              "under_review",
              "no_current_certification"
            ]
          },
          "place": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Place"
              }
            ],
            "description": "Present when status is listed; adds phone, website, hours, recordedStandards."
          },
          "name": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "attribution": {
            "type": "string",
            "const": "Data from The Kosher, https://www.thekosher.app"
          },
          "terms": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "CertifierResponse": {
        "type": "object",
        "required": [
          "apiVersion",
          "certifier",
          "attribution"
        ],
        "properties": {
          "apiVersion": {
            "const": "v1"
          },
          "certifier": {
            "type": "object"
          },
          "listedPlaces": {
            "type": "integer"
          },
          "lastVerified": {
            "type": [
              "string",
              "null"
            ]
          },
          "sample": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "object"
            }
          },
          "seeAllUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": "string"
          },
          "attribution": {
            "type": "string",
            "const": "Data from The Kosher, https://www.thekosher.app"
          },
          "terms": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "apiVersion": {
            "const": "v1"
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          },
          "attribution": {
            "type": "string"
          }
        }
      }
    }
  }
}