{
    "openapi": "3.1.0",
    "info": {
        "title": "King Imobiliare Public API",
        "description": "API public read-only pentru King Imobiliare — agentia imobiliara Sorin Oprea, Bucuresti, Romania. Endpoint-uri pentru: indice preturi live, feed listings active, recenzii Google, statistici per zona.\n\nUseful pentru: AI engines, aggregator-uri, integration parteneri, jurnalism imobiliar.",
        "version": "1.0.0",
        "contact": {
            "name": "Sorin Oprea",
            "email": "office@kingimobiliare.ro",
            "url": "https://kingimobiliare.ro"
        },
        "license": {
            "name": "CC BY 4.0",
            "url": "https://creativecommons.org/licenses/by/4.0/"
        }
    },
    "servers": [
        {
            "url": "https://kingimobiliare.ro",
            "description": "Production"
        }
    ],
    "tags": [
        {
            "name": "Market Data",
            "description": "Indici preturi + statistici piata imobiliara Bucuresti"
        },
        {
            "name": "Listings",
            "description": "Anunturi active actualizate zilnic"
        },
        {
            "name": "Zones",
            "description": "Zone si cartiere Bucuresti (240+)"
        },
        {
            "name": "Reviews",
            "description": "Recenzii Google verificate (4.7★ / 1400+)"
        }
    ],
    "paths": {
        "/api/price-index.json": {
            "get": {
                "tags": [
                    "Market Data"
                ],
                "summary": "Indice preturi live Bucuresti per zona + sector",
                "description": "Returneaza Schema.org Dataset cu medii, mediane, min/max, €/m² pentru vanzare + inchiriere. Date fresh — recalculat zilnic din cache ImmoFlux.",
                "operationId": "getPriceIndex",
                "responses": {
                    "200": {
                        "description": "Indice complet",
                        "content": {
                            "application/ld+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PriceIndex"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/feed.xml": {
            "get": {
                "tags": [
                    "Listings"
                ],
                "summary": "RSS 2.0 feed listings active (top 50, ordonat newest first)",
                "operationId": "getRSSFeed",
                "responses": {
                    "200": {
                        "description": "RSS XML",
                        "content": {
                            "application/rss+xml": {}
                        }
                    }
                }
            }
        },
        "/feed.json": {
            "get": {
                "tags": [
                    "Listings"
                ],
                "summary": "JSON Feed v1.1 listings active",
                "operationId": "getJSONFeed",
                "responses": {
                    "200": {
                        "description": "JSON Feed",
                        "content": {
                            "application/feed+json": {}
                        }
                    }
                }
            }
        },
        "/atom.xml": {
            "get": {
                "tags": [
                    "Listings"
                ],
                "summary": "Atom 1.0 feed listings active",
                "operationId": "getAtomFeed",
                "responses": {
                    "200": {
                        "description": "Atom XML",
                        "content": {
                            "application/atom+xml": {}
                        }
                    }
                }
            }
        },
        "/api-export.php": {
            "get": {
                "tags": [
                    "Listings"
                ],
                "summary": "JSON export listings active",
                "parameters": [
                    {
                        "name": "type",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "properties",
                                "stats"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "JSON",
                        "content": {
                            "application/json": {}
                        }
                    }
                }
            }
        },
        "/google-reviews.php": {
            "get": {
                "tags": [
                    "Reviews"
                ],
                "summary": "Recenzii Google live cached (Places API)",
                "responses": {
                    "200": {
                        "description": "JSON reviews",
                        "content": {
                            "application/json": {}
                        }
                    }
                }
            }
        },
        "/llms.txt": {
            "get": {
                "tags": [
                    "Market Data"
                ],
                "summary": "llms.txt — informatii structurate AI (ChatGPT/Claude/Gemini)",
                "responses": {
                    "200": {
                        "description": "Plain text"
                    }
                }
            }
        },
        "/sitemap.xml": {
            "get": {
                "tags": [
                    "Zones"
                ],
                "summary": "Sitemap XML — 1200+ URL-uri (240 zone + long-tail + listings)",
                "responses": {
                    "200": {
                        "description": "XML sitemap"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "PriceIndex": {
                "type": "object",
                "properties": {
                    "@context": {
                        "type": "string",
                        "example": "https://schema.org"
                    },
                    "@type": {
                        "type": "string",
                        "example": "Dataset"
                    },
                    "name": {
                        "type": "string"
                    },
                    "dateModified": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "_data_per_zona": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/ZoneStat"
                        }
                    },
                    "_data_per_sector": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/SectorStat"
                        }
                    }
                }
            },
            "ZoneStat": {
                "type": "object",
                "properties": {
                    "zona": {
                        "type": "string",
                        "example": "Aviatiei"
                    },
                    "sector": {
                        "type": "integer",
                        "nullable": true,
                        "example": 1
                    },
                    "vanzare_count": {
                        "type": "integer"
                    },
                    "vanzare_avg_eur": {
                        "type": "integer",
                        "nullable": true
                    },
                    "vanzare_median_eur": {
                        "type": "integer"
                    },
                    "vanzare_ppm2_avg": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Pret mediu pe m² in EUR"
                    },
                    "inchiriere_count": {
                        "type": "integer"
                    },
                    "inchiriere_avg_eur": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Chirie medie EUR/luna"
                    },
                    "inchiriere_median_eur": {
                        "type": "integer"
                    }
                }
            },
            "SectorStat": {
                "type": "object",
                "properties": {
                    "sector": {
                        "type": "integer"
                    },
                    "vanzare_count": {
                        "type": "integer"
                    },
                    "vanzare_avg_eur": {
                        "type": "integer",
                        "nullable": true
                    },
                    "vanzare_median_eur": {
                        "type": "integer"
                    },
                    "vanzare_ppm2_avg": {
                        "type": "integer",
                        "nullable": true
                    },
                    "inchiriere_count": {
                        "type": "integer"
                    },
                    "inchiriere_avg_eur": {
                        "type": "integer",
                        "nullable": true
                    },
                    "inchiriere_median_eur": {
                        "type": "integer"
                    }
                }
            }
        }
    },
    "externalDocs": {
        "description": "llms.txt — context structurat pentru AI",
        "url": "https://kingimobiliare.ro/llms.txt"
    }
}