{
  "openapi": "3.1.0",
  "info": {
    "title": "ObraTudela precios",
    "version": "1.0.0",
    "description": "Precios de referencia de construcción en España (BCEXTREM 2026 + BCCA, 63.447 partidas) para agentes de IA, con pago por uso x402. Spanish construction reference prices for AI agents, pay-per-use with x402 (USDC on Base).",
    "x-guidance": "The same tools are also available as a remote MCP server (streamable HTTP) at https://api.cenital.org/mcp. If you do not know the BC3 code, first use the FREE GET /api/buscar?q=TEXT (Spanish text, e.g. \"contenedor escombros 8 m3\") to find it. Use GET /api/precio?cod=CODE for the reference price (EUR) of one Spanish construction item by its BC3 code (e.g. M12O013). Use POST /api/oferta with a JSON body {\"lineas\":[{\"cod\":\"M05RN060\",\"cantidad\":8},{\"texto\":\"contenedor escombros 8 m3\",\"cantidad\":2}]} to price up to 100 lines by code or Spanish description; returns unit price, amount and total. Nothing is charged if no item is found. 3D MODELS: GET /api/piezas (FREE) lists the 113 parts of an open-licence 3D road bicycle; GET /api/pieza?id=ID returns its data sheet (size, volume, weight by material, STL/PDF/SolidWorks links); GET /api/imprimir?id=ID&material=PLA&relleno=20 estimates 3D printing grams, time and cost. LAND PARCELS (Spain): GET /api/parcela?rc=CADASTRAL_REFERENCE or ?lat=..&lon=.. returns official area, perimeter, boundary and cadastral data.",
    "contact": {
      "name": "Excavaciones y Servicios Arturo S.L.",
      "email": "excavacionesart@gmail.com",
      "url": "https://www.obratudela.com"
    }
  },
  "servers": [
    {
      "url": "https://api.cenital.org"
    }
  ],
  "paths": {
    "/api/buscar": {
      "get": {
        "operationId": "buscarPartidas",
        "summary": "Buscar partidas (gratis) - Find Spanish construction items and their BC3 codes by text",
        "description": "Free search, no payment. Returns BC3 codes, units and descriptions (no prices) to use with /api/precio or /api/oferta. Búsqueda gratuita de partidas por texto en español.",
        "tags": [
          "Construction prices"
        ],
        "security": [],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Texto a buscar en español, p. ej. \"contenedor escombros 8 m3\"",
            "schema": {
              "type": "string",
              "example": "zanja"
            }
          },
          {
            "name": "limite",
            "in": "query",
            "required": false,
            "description": "Número de resultados (1-20, por defecto 10)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "consulta": {
                      "type": "string"
                    },
                    "resultados": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "cod": {
                            "type": "string"
                          },
                          "uni": {
                            "type": "string"
                          },
                          "res": {
                            "type": "string"
                          },
                          "grupo": {
                            "type": "string"
                          },
                          "coincidencia": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "cod",
                          "res"
                        ]
                      }
                    }
                  },
                  "required": [
                    "resultados"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing q parameter"
          }
        }
      }
    },
    "/api/piezas": {
      "get": {
        "operationId": "catalogoPiezasBici",
        "summary": "Catálogo de piezas (gratis) - List the 113 parts of an open-licence 3D road bicycle",
        "description": "Free, no payment. Parts of a complete road bicycle modelled in SolidWorks 2020 (cenital.org): id, name, assembly, code and size in mm. Optional text filter q.",
        "tags": [
          "3D models"
        ],
        "security": [],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Filtro de texto, p. ej. \"buje\" o \"pedal\"",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "piezas": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "nombre": {
                            "type": "string"
                          },
                          "conjunto": {
                            "type": "string"
                          },
                          "medidas_mm": {
                            "type": "array",
                            "items": {
                              "type": "number"
                            }
                          }
                        },
                        "required": [
                          "id",
                          "nombre"
                        ]
                      }
                    }
                  },
                  "required": [
                    "piezas"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/pieza": {
      "get": {
        "operationId": "fichaPiezaBici",
        "summary": "Ficha de pieza - Technical data sheet of one 3D bicycle part (size, volume, weight by material, STL/PDF/SolidWorks links)",
        "description": "Technical data sheet of one part of an open-licence 3D road bicycle (113 parts, SolidWorks 2020, cenital.org): size in mm, volume, surface, weight in steel/aluminium/titanium/carbon/PLA, whether it fits a 256 mm 3D printer, and links to its STL, dimensioned PDF drawing and SolidWorks file. Ficha técnica de una pieza de la bici en 3D.",
        "tags": [
          "3D models"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Id de la pieza (ver /api/piezas), p. ej. Buje_cuerpo_1",
            "schema": {
              "type": "string",
              "example": "Buje_cuerpo_1"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pieza": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "pieza"
                  ]
                },
                "example": {
                  "pieza": {
                    "id": "Buje_cuerpo_1",
                    "nombre": "Buje cuerpo",
                    "medidas_mm": {
                      "x": 50,
                      "y": 50,
                      "z": 75.5
                    },
                    "volumen_cm3": 51.17,
                    "peso_g_segun_material": {
                      "aluminio": 138.2,
                      "PLA": 63.5
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.010000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        }
      }
    },
    "/api/imprimir": {
      "get": {
        "operationId": "impresionPiezaBici",
        "summary": "Cálculo de impresión - 3D printing estimate (grams, metres, hours, cost) for one bicycle part",
        "description": "3D printing estimate for one part of an open-licence 3D road bicycle (cenital.org): filament grams, metres, approximate print time and cost for PLA, PETG, ABS or TPU at a given infill, and whether it fits a 256 mm printer (Elegoo Centuri Carbon). Cálculo de impresión 3D de una pieza.",
        "tags": [
          "3D models"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Id de la pieza (ver /api/piezas), p. ej. Buje_cuerpo_1",
            "schema": {
              "type": "string",
              "example": "Buje_cuerpo_1"
            }
          },
          {
            "name": "material",
            "in": "query",
            "required": false,
            "description": "Filamento: PLA (por defecto), PETG, ABS o TPU",
            "schema": {
              "type": "string",
              "enum": [
                "PLA",
                "PETG",
                "ABS",
                "TPU"
              ]
            }
          },
          {
            "name": "relleno",
            "in": "query",
            "required": false,
            "description": "Relleno en % (0-100, por defecto 20)",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "impresion": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "impresion"
                  ]
                },
                "example": {
                  "impresion": {
                    "pieza": "Buje_cuerpo_1",
                    "material": "PLA",
                    "relleno_pct": 20,
                    "gramos": 30.1,
                    "metros_filamento": 10.1,
                    "horas_aprox": 0.5,
                    "coste_eur_aprox": 0.6,
                    "cabe_en_impresora": true
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.050000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        }
      }
    },
    "/api/parcela": {
      "get": {
        "operationId": "parcelaCatastro",
        "summary": "Parcela catastral - Spanish cadastral parcel: area, perimeter, boundary and data, by reference or coordinates",
        "description": "Spanish land parcel lookup from the official Cadastre (Catastro): by cadastral reference (14 or 20 chars) or by WGS84 lat/lon. Returns official area in m², perimeter, centre, boundary polygon, municipality, address, class (urban/rustic), properties in it and, for one property, use, built area, year and crops. No owner data. Medición de parcela catastral. Nothing is charged if the parcel does not exist or the Cadastre does not respond.",
        "tags": [
          "Cadastre"
        ],
        "parameters": [
          {
            "name": "rc",
            "in": "query",
            "required": false,
            "description": "Referencia catastral (14 o 20 caracteres), p. ej. 8451004UM6085S",
            "schema": {
              "type": "string",
              "example": "8451004UM6085S"
            }
          },
          {
            "name": "lat",
            "in": "query",
            "required": false,
            "description": "Latitud WGS84, si no se da rc",
            "schema": {
              "type": "number",
              "example": 41.5845
            }
          },
          {
            "name": "lon",
            "in": "query",
            "required": false,
            "description": "Longitud WGS84, si no se da rc",
            "schema": {
              "type": "number",
              "example": -4.58
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "parcela": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "parcela"
                  ]
                },
                "example": {
                  "parcela": {
                    "referencia_catastral": "8451004UM6085S",
                    "superficie_m2": 1137,
                    "perimetro_m": 152.3,
                    "centro": {
                      "lat": 41.58,
                      "lon": -4.58
                    },
                    "municipio": "TUDELA DE DUERO",
                    "inmuebles": 4
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.050000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        }
      }
    },
    "/api/precio": {
      "get": {
        "operationId": "precioPartida",
        "summary": "Precio de partida - Spanish construction item reference price by BC3 code",
        "description": "Spanish construction unit price lookup (BCEXTREM 2026 + BCCA, 63,447 items). Use when you need the reference price in EUR, unit and description of a Spanish building or civil-works item by its BC3 code, e.g. excavation, demolition, machinery hire. Precio de referencia de una partida de obra por su código BC3.",
        "tags": [
          "Construction prices"
        ],
        "parameters": [
          {
            "name": "cod",
            "in": "query",
            "required": true,
            "description": "Código BC3 de la partida, p. ej. M12O013",
            "schema": {
              "type": "string",
              "example": "M12O013"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "partida": {
                      "type": "object",
                      "properties": {
                        "cod": {
                          "type": "string"
                        },
                        "uni": {
                          "type": "string"
                        },
                        "res": {
                          "type": "string"
                        },
                        "precio": {
                          "type": "number",
                          "description": "EUR"
                        },
                        "grupo": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cod",
                        "uni",
                        "res",
                        "precio"
                      ]
                    },
                    "nota": {
                      "type": "string"
                    },
                    "contacto": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "partida"
                  ]
                },
                "example": {
                  "partida": {
                    "cod": "M12O013",
                    "uni": "ud",
                    "res": "Contenedor para escombros 8 m3",
                    "precio": 215,
                    "grupo": "MAQUINARIA"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.010000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        }
      }
    },
    "/api/oferta": {
      "post": {
        "operationId": "rellenarOferta",
        "summary": "Rellenar oferta - Price a Spanish construction bill of quantities",
        "description": "Prices a Spanish construction bill of quantities: up to 100 lines by BC3 code or free-text description (Spanish) with quantity; returns unit price, amount and total in EUR from BCEXTREM 2026 + BCCA. Rellena una petición de oferta de obra con precios de referencia.",
        "tags": [
          "Construction prices"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "lineas": {
                    "type": "array",
                    "maxItems": 100,
                    "items": {
                      "type": "object",
                      "properties": {
                        "cod": {
                          "type": "string",
                          "description": "Código BC3 (opcional si hay texto)"
                        },
                        "texto": {
                          "type": "string",
                          "description": "Descripción en español (si no hay código)"
                        },
                        "cantidad": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "required": [
                  "lineas"
                ]
              },
              "example": {
                "lineas": [
                  {
                    "cod": "M05RN060",
                    "cantidad": 8
                  },
                  {
                    "texto": "contenedor escombros 8 m3",
                    "cantidad": 2
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "lineas": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "total": {
                      "type": "number",
                      "description": "EUR"
                    },
                    "moneda_precios": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "lineas",
                    "total"
                  ]
                },
                "example": {
                  "lineas": [
                    {
                      "cod": "M05RN060",
                      "res": "Mini retroexcavadora",
                      "precio": 31.9,
                      "cantidad": 8,
                      "importe": 255.2
                    }
                  ],
                  "total": 685.2,
                  "moneda_precios": "EUR"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.500000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        }
      }
    }
  }
}