{
    "openapi": "3.1.0",
    "info": {
        "title": "Smart Device Deals API",
        "version": "1.0",
        "description": "Read-only API for comparing prices of phones, TVs, appliances, computers and accessories from official brand stores and trusted shops. No key needed. Please cache responses and keep under 60 requests per minute.",
        "contact": {
            "email": "robitanvir1@gmail.com"
        }
    },
    "servers": [
        {
            "url": "https://smartdevicedeals.com/wp-json/sdd/v1"
        }
    ],
    "paths": {
        "/products": {
            "get": {
                "operationId": "searchProducts",
                "summary": "Search and filter products",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": false,
                        "description": "Search words, e.g. \"galaxy s25 ultra\" or \"noise cancelling headphones\".",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "category",
                        "in": "query",
                        "required": false,
                        "description": "Category slug(s), comma separated. See /categories.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "brand",
                        "in": "query",
                        "required": false,
                        "description": "Brand slug(s), comma separated. See /brands.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "Two-letter country code of the store, e.g. US, GB, BD, SG.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "min_price_usd",
                        "in": "query",
                        "required": false,
                        "description": "Minimum price in US dollars (approximate conversion).",
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "max_price_usd",
                        "in": "query",
                        "required": false,
                        "description": "Maximum price in US dollars (approximate conversion).",
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "in_stock",
                        "in": "query",
                        "required": false,
                        "description": "Only products in stock at the store.",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "Sort order.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "relevance",
                                "newest",
                                "price_asc",
                                "price_desc",
                                "discount"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number (1-50).",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Results per page (1-50, default 20).",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Matching products",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "total": {
                                            "type": "integer"
                                        },
                                        "page": {
                                            "type": "integer"
                                        },
                                        "total_pages": {
                                            "type": "integer"
                                        },
                                        "products": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "description": "A product with its latest tracked price, store and identifiers."
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/products/{id}": {
            "get": {
                "operationId": "getProduct",
                "summary": "One product with specifications, description and price history",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Product details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "description": "A product with its latest tracked price, store and identifiers."
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found"
                    }
                }
            }
        },
        "/categories": {
            "get": {
                "operationId": "listCategories",
                "summary": "All product categories with slugs and counts",
                "responses": {
                    "200": {
                        "description": "Categories"
                    }
                }
            }
        },
        "/brands": {
            "get": {
                "operationId": "listBrands",
                "summary": "All brands with slugs and counts",
                "responses": {
                    "200": {
                        "description": "Brands"
                    }
                }
            }
        }
    }
}