{
  "openapi": "3.1.0",
  "info": {
    "title": "RetourRadar Live Retourprijzen API",
    "version": "1.0.0",
    "description": "Publieke read-only API voor AI-tools (ChatGPT Actions, Claude, Perplexity, Gemini en agents) om actuele Nederlandse en Belgische retour-, outlet- en tweedekansprijzen, besparingen en nagelezen winkelretourvoorwaarden op te vragen.",
    "contact": {
      "name": "RetourRadar",
      "url": "https://retourradar.com/ai-api",
      "email": "info@retourradar.com"
    },
    "termsOfService": "https://retourradar.com/voorwaarden"
  },
  "servers": [
    {
      "url": "https://retourradar.com",
      "description": "RetourRadar Productie"
    }
  ],
  "x-mcp": {
    "endpoint": "https://retourradar.com/mcp",
    "transport": "streamable-http",
    "protocolVersion": "2025-03-26"
  },
  "x-agent-search": {
    "endpoint": "https://retourradar.com/.well-known/search",
    "methods": [
      "GET",
      "QUERY",
      "POST"
    ],
    "contentType": "text/markdown"
  },
  "paths": {
    "/.well-known/search": {
      "get": {
        "operationId": "searchForAgents",
        "summary": "Search for Agents (Markdown/JSON zoekendpoint)",
        "description": "Cloudflare Search for Agents endpoint waarmee AI-agents met één query live retourdeals, winkelvoorwaarden, categorieën en koopgidsen doorzoeken.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Zoekopdracht in natuurlijke taal of productnaam."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 10
            },
            "description": "Maximaal aantal retourdeals."
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "alles",
                "deals",
                "winkels",
                "gidsen"
              ]
            },
            "description": "Optioneel brontypefilter."
          }
        ],
        "responses": {
          "200": {
            "description": "Markdown- of JSON-zoekresultaten inclusief actuele prijzen en bronlinks.",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/ai/v1/deals": {
      "get": {
        "operationId": "zoekRetourdeals",
        "summary": "Zoek live retour-, outlet- en tweedekansdeals",
        "description": "Filter en doorzoek actuele retourprijzen in Nederland en België op zoekterm, EAN/GTIN, categorie, merk, winkel, conditie of prijs.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Zoekterm of modelnaam."
          },
          {
            "name": "ean",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "EAN/GTIN-barcode (8–14 cijfers)."
          },
          {
            "name": "categorie",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Hoofdcategorie-slug (bijv. elektronica, huis-keuken, gaming)."
          },
          {
            "name": "sub",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Subcategorie-slug."
          },
          {
            "name": "merk",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Merknaam."
          },
          {
            "name": "winkel",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Winkel-ID (bijv. coolblue, bol, amazon, mediamarkt)."
          },
          {
            "name": "conditie",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "als-nieuw",
                "licht-gebruikt",
                "gebruikt",
                "refurbished",
                "nieuw"
              ]
            },
            "description": "Fysieke conditieklasse."
          },
          {
            "name": "min_prijs",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "Minimale retourprijs in EUR."
          },
          {
            "name": "max_prijs",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "Maximale retourprijs in EUR."
          },
          {
            "name": "min_korting",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "Minimale korting in procenten."
          },
          {
            "name": "min_score",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "Minimale RadarScore (0–10)."
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "score",
                "prijs_op",
                "prijs_af",
                "korting",
                "nieuwste",
                "besparing"
              ]
            },
            "description": "Sorteervolgorde."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 25,
              "default": 10
            },
            "description": "Aantal deals (max 25)."
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 500,
              "default": 0
            },
            "description": "Paginatie-offset."
          }
        ],
        "responses": {
          "200": {
            "description": "Actuele retourdeals inclusief nieuwprijs-vergelijking, besparing en deal_url.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DealsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/ai/v1/prijsvergelijk": {
      "get": {
        "operationId": "vergelijkRetourprijs",
        "summary": "Vergelijk actuele retourprijzen voor een specifiek product",
        "description": "Geeft voor een productnaam of EAN de laagste, hoogste en gemiddelde retourprijs, nieuwprijsvergelijking, maximale eurobesparing en aanbieders terug.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Productnaam of model (minimaal 2 tekens, tenzij ean wordt opgegeven)."
          },
          {
            "name": "ean",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "EAN/GTIN-barcode (8–14 cijfers)."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 15,
              "default": 8
            },
            "description": "Maximaal aantal deals."
          }
        ],
        "responses": {
          "200": {
            "description": "Samenvatting van live retourprijzen en besparing voor het gezochte product.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrijsvergelijkResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/ai/v1/deals/{sleutel}": {
      "get": {
        "operationId": "haalDealDetails",
        "summary": "Details en aanbieders van een specifieke retourdeal",
        "parameters": [
          {
            "name": "sleutel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Unieke productsleutel."
          }
        ],
        "responses": {
          "200": {
            "description": "Dealdetails en alle actieve aanbiedingen per webshop.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DealDetailResponse"
                }
              }
            }
          },
          "404": {
            "description": "Deal niet gevonden of niet meer actief."
          }
        }
      }
    },
    "/api/ai/v1/winkels": {
      "get": {
        "operationId": "lijstWinkels",
        "summary": "Aangesloten winkels en nagelezen retourvoorwaarden",
        "parameters": [
          {
            "name": "winkel",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter op specifieke winkelnaam of winkel-ID."
          }
        ],
        "responses": {
          "200": {
            "description": "Winkels met actieve deal-aantallen en retourbeleid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WinkelsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/ai/v1/categorieen": {
      "get": {
        "operationId": "lijstCategorieen",
        "summary": "Beschikbare productcategorieën en aantallen",
        "responses": {
          "200": {
            "description": "Alle hoofdcategorieën en subcategorieën met live dealaantallen.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CategorieenResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/ai/v1/stats": {
      "get": {
        "operationId": "platformStatistieken",
        "summary": "Live platformcijfers van RetourRadar",
        "responses": {
          "200": {
            "description": "Actuele platformstatistieken (totaal deals, winkels, gemiddelde besparing, laatste scan).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatsResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Deal": {
        "type": "object",
        "properties": {
          "sleutel": {
            "type": "string"
          },
          "naam": {
            "type": "string"
          },
          "merk": {
            "type": [
              "string",
              "null"
            ]
          },
          "ean": {
            "type": [
              "string",
              "null"
            ]
          },
          "categorie": {
            "type": [
              "string",
              "null"
            ]
          },
          "subcategorie": {
            "type": [
              "string",
              "null"
            ]
          },
          "winkel_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "winkel_naam": {
            "type": [
              "string",
              "null"
            ]
          },
          "retourprijs_eur": {
            "type": [
              "number",
              "null"
            ]
          },
          "nieuwprijs_eur": {
            "type": [
              "number",
              "null"
            ]
          },
          "besparing_eur": {
            "type": [
              "number",
              "null"
            ]
          },
          "korting_pct": {
            "type": [
              "number",
              "null"
            ]
          },
          "conditie": {
            "type": [
              "string",
              "null"
            ]
          },
          "radar_score": {
            "type": [
              "number",
              "null"
            ]
          },
          "voorraad_status": {
            "type": "string"
          },
          "laatst_gezien": {
            "type": [
              "string",
              "null"
            ]
          },
          "co2_besparing_kg": {
            "type": [
              "number",
              "null"
            ]
          },
          "is_amazon_offer": {
            "type": "boolean"
          },
          "deal_url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "DealsResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "valuta": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "deals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Deal"
            }
          }
        }
      },
      "PrijsvergelijkResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "query": {
            "type": "string"
          },
          "valuta": {
            "type": "string"
          },
          "gevonden": {
            "type": "integer"
          },
          "laagste_retourprijs_eur": {
            "type": [
              "number",
              "null"
            ]
          },
          "hoogste_retourprijs_eur": {
            "type": [
              "number",
              "null"
            ]
          },
          "gemiddelde_retourprijs_eur": {
            "type": [
              "number",
              "null"
            ]
          },
          "laagste_nieuwprijs_eur": {
            "type": [
              "number",
              "null"
            ]
          },
          "maximale_besparing_eur": {
            "type": [
              "number",
              "null"
            ]
          },
          "gemiddelde_korting_pct": {
            "type": [
              "number",
              "null"
            ]
          },
          "winkels_met_voorraad": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "beste_deals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Deal"
            }
          }
        }
      },
      "DealDetailResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "valuta": {
            "type": "string"
          },
          "deal": {
            "$ref": "#/components/schemas/Deal"
          },
          "aanbiedingen_aantal": {
            "type": "integer"
          },
          "aanbiedingen": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "WinkelsResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "count": {
            "type": "integer"
          },
          "winkels": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "CategorieenResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "count": {
            "type": "integer"
          },
          "categorieen": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "StatsResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "actieve_deals": {
            "type": "integer"
          },
          "nieuw_vandaag": {
            "type": "integer"
          },
          "aantal_winkels": {
            "type": "integer"
          },
          "gemiddelde_besparing_eur": {
            "type": [
              "number",
              "null"
            ]
          },
          "gemiddelde_korting_pct": {
            "type": [
              "number",
              "null"
            ]
          }
        }
      }
    }
  }
}