API de Qubihome
Gestiona tus anuncios y recibe tus contactos desde tu propio software. La referencia de abajo está en inglés.
La API está disponible en los planes Agency y Developer para agentes y agencias verificados. Crea las claves en Integraciones.
Inicio rápido
curl https://qubihome.vercel.app/api/v1/listings \
-H "Authorization: Bearer qh_live_..."
curl -X POST https://qubihome.vercel.app/api/v1/listings \
-H "Authorization: Bearer qh_live_..." \
-H "Content-Type: application/json" \
-d '{"category":"apartment","transaction":"sale","title":"Bright flat near the park",
"description":"Two rooms, renovated kitchen, balcony facing south.",
"price":245000,"currency":"EUR","country":"PL","city":"Krakow",
"latitude":50.0614,"longitude":19.9366,"area_m2":52,"rooms":2}'Endpoints
| Método | Ruta | Qué hace | Permiso |
|---|---|---|---|
| GET | /api/v1/listings | List your listings | listings:read |
| POST | /api/v1/listings | Create a draft listing | listings:write |
| GET | /api/v1/listings/{id} | Get one of your listings | listings:read |
| PATCH | /api/v1/listings/{id} | Update a draft or rejected listing | listings:write |
| POST | /api/v1/listings/{id}/submit | Send a draft to moderation | listings:write |
| POST | /api/v1/listings/{id}/status | Change the status of a live listing | listings:write |
| GET | /api/v1/listings/{id}/media | List photos and floor plans | listings:read |
| POST | /api/v1/listings/{id}/media | Import a photo or floor plan from a public https URL | listings:write |
| DELETE | /api/v1/listings/{id}/media/{mediaId} | Remove a photo or floor plan | listings:write |
| GET | /api/v1/leads | List contact requests sent to you | leads:read |
Reglas
- Autentica cada petición con Authorization: Bearer YOUR_KEY.
- Los anuncios que creas son borradores. Al enviarlos pasan a moderación y solo se publican tras la aprobación, igual que en la web.
- 120 peticiones por minuto y clave. Superarlo devuelve HTTP 429. El límite de anuncios de tu plan se aplica al enviar.
- Los errores son JSON con un objeto "error" que contiene code, message y details, y el estado HTTP correspondiente.
- Las fotos se importan desde direcciones https públicas. Se rechazan las redirecciones y las direcciones privadas.
Webhooks
Cada envío es un POST con cuerpo JSON y estas cabeceras. Verifica la firma antes de confiar en los datos.
X-Qubihome-Event: lead.created | listing.published | listing.status_changed
X-Qubihome-Delivery: <delivery id>
X-Qubihome-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>">// Node.js
import { createHmac, timingSafeEqual } from "node:crypto";
function verify(rawBody, header, secret) {
const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
if (Math.abs(Date.now() / 1000 - Number(parts.t)) > 300) return false;
const expected = createHmac("sha256", secret).update(parts.t + "." + rawBody).digest("hex");
return timingSafeEqual(Buffer.from(parts.v1, "hex"), Buffer.from(expected, "hex"));
}Responde con cualquier estado 2xx en 8 segundos. Los envíos fallidos se reintentan hasta seis veces con esperas crecientes.