{
    "openapi": "3.1.0",
    "info": {
        "title": "Usta-Bul açık API",
        "version": "1.1.0",
        "description": "Türkiye'de usta ve firma arama (salt okunur). Telefon ve kişisel veriler verilmez. Dakikada 60 istek.",
        "contact": {
            "url": "https://usta-bul.com/iletisim"
        }
    },
    "servers": [
        {
            "url": "https://usta-bul.com/api/v1"
        }
    ],
    "paths": {
        "/search": {
            "get": {
                "operationId": "searchProfessionals",
                "summary": "Usta/firma ara",
                "parameters": [
                    {
                        "name": "category",
                        "in": "query",
                        "required": false,
                        "description": "Kategori slug veya adı (ör. elektrikci)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "city",
                        "in": "query",
                        "required": false,
                        "description": "İl slug veya adı (ör. bursa)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "district",
                        "in": "query",
                        "required": false,
                        "description": "İlçe slug veya adı",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "q",
                        "in": "query",
                        "required": false,
                        "description": "Serbest metin",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "open_now",
                        "in": "query",
                        "required": false,
                        "description": "Yalnız şu an açık olanlar (1)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "verified",
                        "in": "query",
                        "required": false,
                        "description": "Yalnız onaylı hesaplar (1)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "min_rating",
                        "in": "query",
                        "required": false,
                        "description": "0-5 arası en düşük puan",
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "onerilen|puan|yorum|populer|yeni|ad",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Sayfa",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Sayfa başına (en fazla 25)",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Sonuçlar",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "total": {
                                            "type": "integer"
                                        },
                                        "page": {
                                            "type": "integer"
                                        },
                                        "pages": {
                                            "type": "integer"
                                        },
                                        "results": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Professional"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/categories": {
            "get": {
                "operationId": "listCategories",
                "summary": "Kategoriler ve usta sayıları",
                "responses": {
                    "200": {
                        "description": "Liste"
                    }
                }
            }
        },
        "/locations": {
            "get": {
                "operationId": "listCities",
                "summary": "İller",
                "responses": {
                    "200": {
                        "description": "Liste"
                    }
                }
            }
        },
        "/locations/{city}": {
            "get": {
                "operationId": "listDistricts",
                "summary": "Bir ilin ilçeleri",
                "parameters": [
                    {
                        "name": "city",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Liste"
                    }
                }
            }
        },
        "/profiles/{slug}": {
            "get": {
                "operationId": "getProfessional",
                "summary": "Usta/firma profili",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Profil",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Professional"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Bulunamadı"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "Professional": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "type": {
                        "type": "string"
                    },
                    "category": {
                        "type": "string"
                    },
                    "location": {
                        "type": "string"
                    },
                    "rating": {
                        "type": "number"
                    },
                    "review_count": {
                        "type": "integer"
                    },
                    "verified": {
                        "type": "boolean"
                    },
                    "premium": {
                        "type": "boolean"
                    },
                    "open_now": {
                        "type": "boolean"
                    },
                    "url": {
                        "type": "string"
                    },
                    "markdown_url": {
                        "type": "string"
                    },
                    "services": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "badges": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            }
        }
    }
}