{
  "openapi": "3.1.0",
  "info": {
    "title": "Deals Database API",
    "version": "1.0.0",
    "description": "Search current deals, coupons and offers from businesses worldwide. No authentication."
  },
  "servers": [
    {
      "url": "https://thedealsdatabase.com"
    }
  ],
  "paths": {
    "/api/v1/deals": {
      "get": {
        "operationId": "searchDeals",
        "summary": "Search current deals",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "What the person wants, in plain words. Example: \"oil change\", \"family dentist new patient\", \"project management software\".",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Optional category id.",
            "schema": {
              "type": "string",
              "enum": [
                "food-dining",
                "groceries",
                "retail-fashion",
                "electronics",
                "home-garden",
                "home-services",
                "automotive",
                "health-wellness",
                "beauty-personal-care",
                "fitness-sports",
                "travel-lodging",
                "entertainment-events",
                "education-training",
                "professional-services",
                "financial-insurance",
                "software-saas",
                "business-services",
                "pets",
                "kids-family",
                "real-estate",
                "industrial-b2b",
                "other"
              ]
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "description": "ISO country code or English name, e.g. \"CA\" or \"Canada\". ",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "State / province, e.g. \"Ontario\".",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "city",
            "in": "query",
            "required": false,
            "description": "City, e.g. \"Toronto\".",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "deal_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "percent_off",
                "amount_off",
                "bogo",
                "free_trial",
                "free_shipping",
                "bundle",
                "sale",
                "freebie",
                "other"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching deals, best first"
          }
        }
      }
    },
    "/api/v1/deals/{id}": {
      "get": {
        "operationId": "getDeal",
        "summary": "Get one deal",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The deal"
          },
          "404": {
            "description": "Not found or expired"
          }
        }
      }
    },
    "/api/v1/categories": {
      "get": {
        "operationId": "listCategories",
        "summary": "Category and deal-type ids",
        "responses": {
          "200": {
            "description": "Lists"
          }
        }
      }
    }
  }
}