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).
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 returns400 INVALID:
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}.
buildings (source layer batiments)
buildings (source layer batiments)
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).parcels (source layer parcelles)
parcels (source layer parcelles)
parcelle_id, code_commune_insee, surface_m2, code_section, numero_plan.owners (source layer owners)
owners (source layer owners)
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.market (source layer marche)
market (source layer marche)
code (zone code), nom (zone name), maille (zone level, such as quartier or commune), value (the metric value).heritage (source layers abf-batiments, abf-perimetres)
heritage (source layers abf-batiments, abf-perimetres)
abf-batiments: batiment_groupe_id, kind (monument, abords, spr, site). abf-perimetres: idass, kind, nomass.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 returns204 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_LIMITEDwithRetry-After: 1and gives the weight back. Cached tiles are not subject to this limit.
Add a Gabin layer to MapLibre GL JS
MapLibre’stransformRequest 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:
addSource and addLayer the same way. With Mapbox GL JS, transformRequest works the same.
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, withouttransformRequest.
proxy.mjs
transformRequest:
Next steps
Buildings
Open the building a user clicked: profile, companies, owners, sections.
Limits
Rate, quota, concurrency and the weight of each request.