{
    "openapi": "3.1.0",
    "info": {
        "title": "Ürünsepetim Deals API",
        "version": "1.0.0",
        "description": "Read-only API for current discounted deals in Turkey (hotels, breakfast, spa, tours, theme parks...). Prices are in TRY. Buy links (buy_url) are affiliate links. Ürünsepetim bir fırsat rehberidir. \"buy_url\" bağlantıları iş ortağı fırsat sitesine (firsatbufirsat.com) yönlendirir; satın alımlarda komisyon kazanabiliriz, ödediğiniz fiyat değişmez. Fiyat ve stok bilgisi fırsat sitesindeki güncel duruma göre geçerlidir. / Ürünsepetim is a deal guide: buy links go to the partner deal site and may earn us a commission at no extra cost to you. Prices are shown in Turkish Lira (TRY) and can change."
    },
    "servers": [
        {
            "url": "https://urunsepetim.com/api/v1"
        }
    ],
    "paths": {
        "/deals": {
            "get": {
                "operationId": "searchDeals",
                "summary": "Search deals by keyword and filters",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "Keyword, e.g. \"spa\", \"kahvaltı\", \"bungalov\", \"hayvanat bahçesi\". Turkish letters are optional."
                    },
                    {
                        "name": "city",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "City name or slug, e.g. \"İstanbul\". See /filters."
                    },
                    {
                        "name": "category",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "Category slug, e.g. \"masaj\". See /filters."
                    },
                    {
                        "name": "tour",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "Tour or hotel route slug, e.g. \"kapadokya-turlari\". See /filters."
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 80
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 24,
                            "default": 12
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Matching deals",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DealList"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/deals/ending-soon": {
            "get": {
                "operationId": "endingSoon",
                "summary": "Deals that end soonest (today's deals)",
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 24,
                            "default": 10
                        }
                    },
                    {
                        "name": "tours_only",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deals sorted by remaining time",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DealList"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/deals/{id}": {
            "get": {
                "operationId": "getDeal",
                "summary": "Full details of one deal",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The deal, with description, terms, options and address"
                    },
                    "404": {
                        "description": "Deal not found or no longer available"
                    }
                }
            }
        },
        "/filters": {
            "get": {
                "operationId": "listFilters",
                "summary": "Valid category, city and tour route values",
                "responses": {
                    "200": {
                        "description": "Filter values"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "Deal": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    },
                    "summary": {
                        "type": "string"
                    },
                    "city": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "district": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "provider": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "price": {
                        "$ref": "#/components/schemas/Money"
                    },
                    "original_price": {
                        "$ref": "#/components/schemas/Money"
                    },
                    "discount_percent": {
                        "type": "integer"
                    },
                    "ends_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "seconds_left": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "image": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "url": {
                        "type": "string",
                        "description": "Deal page on urunsepetim.com"
                    },
                    "buy_url": {
                        "type": "string",
                        "description": "Tracked link to the partner site where the purchase is completed"
                    },
                    "tags": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "Money": {
                "type": [
                    "object",
                    "null"
                ],
                "properties": {
                    "amount": {
                        "type": "number"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "formatted": {
                        "type": "string"
                    }
                }
            },
            "DealList": {
                "type": "object",
                "properties": {
                    "total": {
                        "type": "integer"
                    },
                    "page": {
                        "type": "integer"
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "has_more": {
                        "type": "boolean"
                    },
                    "deals": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Deal"
                        }
                    },
                    "disclosure": {
                        "type": "string"
                    }
                }
            }
        }
    }
}