Skip to main content
GET /v1/tiles/{layer}/{z}/{x}/{y}.pbf serves the layers of the gabin.ai map as Mapbox Vector Tiles (MVT, XYZ scheme), for MapLibre GL JS, Mapbox GL JS or any MVT client. Use tiles when you want to draw many buildings or parcels at once; use GET /v1/buildings when you need the data of a few hundred buildings (see buildings).
The response is application/vnd.mapbox-vector-tile with Cache-Control: private, max-age=3600.

Layers

Each layer is served on a zoom range. A request outside it returns 400 INVALID:
The source layer is the name of the layer inside the tile. You need it as source-layer in MapLibre and Mapbox styles. Set minzoom and maxzoom of your map source to the layer’s range. The map then requests no tile below the range, and above it reuses the tiles of the last level (overzoom), so it never asks the API for a zoom it refuses.

Feature properties

Feature properties are those of the gabin.ai map. Ids in them open the matching endpoints: batiment_groupe_id goes to GET /v1/buildings/{id}, parcelle_id to GET /v1/parcels/{id}.
batiment_groupe_id, code_commune_insee, surface_m2, nb_log (dwellings), nb_log_bucket, nb_niveau (levels), nb_niveau_bucket, annee_construction, mat_mur_bucket, mat_toit_bucket, max_hauteur, acceslibre_erp_count, acceslibre_a_ascenseur, statut_fibre_bucket, is_friche, dpe (energy class A to G), entreprises (linked legal entities).
parcelle_id, code_commune_insee, surface_m2, code_section, numero_plan.
label, owner_kind, fj_bucket, nb_locaux, cat_ent, naf_div, effectif_bucket, is_gest, batiment_groupe_id, nb_proprietaires, ca_bucket, sig_perte, sig_cp_neg.
code (zone code), nom (zone name), maille (zone level, such as quartier or commune), value (the metric value).
abf-batiments: batiment_groupe_id, kind (monument, abords, spr, site). abf-perimetres: idass, kind, nomass.
Property names are in French and match the gabin.ai map. Inspect a tile to see the properties of the other layers.

Layer options

Some layers accept filters in the query string. They are passed as they are; unknown keys are ignored. For example, apartment prices by zone:

Empty tiles

A tile with no feature returns 204 No Content with an empty body. If you fetch tiles yourself, treat a 204 as an empty tile, not as an error.

Weight and limits

The cache is shared by all accounts and keyed by layer, coordinates and options, so a tile someone requested in the last 10 minutes costs 0.1. A map view requests many tiles at once. Two limits matter:
  • Rate and quota. Tiles count against your per-minute rate and daily quota like any request, at their weight. See limits.
  • Concurrent requests. A tile read from the database counts toward the limit of 2 concurrent requests per account. Above it, the API answers 429 RATE_LIMITED with Retry-After: 1 and gives the weight back. Cached tiles are not subject to this limit.
When a map loads a new area, several uncached tiles can be refused this way and stay blank. A server-side proxy that sends at most 2 tile requests at a time and retries on 429 avoids it. See keep your key on the server.

Add a Gabin layer to MapLibre GL JS

MapLibre’s transformRequest adds the Authorization header to the tile requests sent to api.gabin.ai. This page draws the building footprints, colored by energy class, and logs the building id on click:
The background-only style keeps the example free of third-party keys. In a real map, start from your basemap style and call addSource and addLayer the same way. With Mapbox GL JS, transformRequest works the same.
An API key in browser code is visible to anyone who opens the page, in the source and in the network panel. Whoever copies it can spend your quota, and every call is attributed to your account. Keep keys on your server: proxy the tiles, or serve the page only on a local machine while you prototype. If a key leaks, revoke it at gabin.ai/compte/api.

Keep your key on the server

A small proxy keeps the key server-side, sends at most 2 tile requests at a time to Gabin, and retries on 429. The browser then requests your own URL, without transformRequest.
proxy.mjs
In the map, point the source at the proxy and drop transformRequest:
Before you expose such a proxy publicly, add your own access control and rate limit: otherwise anyone can use your quota through it.

Next steps

Buildings

Open the building a user clicked: profile, companies, owners, sections.

Limits

Rate, quota, concurrency and the weight of each request.