API Qubihome
Gérez vos annonces et recevez vos contacts depuis votre propre logiciel. La référence ci-dessous est en anglais.
L'API est disponible avec les offres Agency et Developer pour les agents et agences vérifiés. Créez vos clés dans Intégrations.
Démarrage rapide
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}'Points de terminaison
| Méthode | Chemin | Fonction | Autorisation |
|---|---|---|---|
| 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 |
Règles
- Authentifiez chaque requête avec Authorization: Bearer YOUR_KEY.
- Les annonces créées sont des brouillons. L'envoi les place en modération ; elles ne sont en ligne qu'après approbation, comme dans l'application web.
- 120 requêtes par minute et par clé. Un dépassement renvoie HTTP 429. La limite d'annonces de votre offre s'applique aux envois.
- Les erreurs sont en JSON avec un objet "error" contenant code, message et details, et le statut HTTP correspondant.
- Les photos sont importées depuis des adresses https publiques. Les redirections et adresses privées sont refusées.
Webhooks
Chaque envoi est un POST avec un corps JSON et ces en-têtes. Vérifiez la signature avant de faire confiance aux données.
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"));
}Répondez avec un statut 2xx en moins de 8 secondes. Les envois échoués sont réessayés jusqu'à six fois avec des délais croissants.