> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gabin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# List the companies linked to a building

> Companies linked to a building: occupants (an establishment located there, matched by address or position) and corporate owners (land files), merged by SIREN. Active companies first, then by name.

Sole proprietorships (entrepreneurs individuels) are listed as occupants by their registered name; companies under partial diffusion never are. Up to 500 companies can be reached; above 100 linked companies, the address is usually a business domiciliation.



## OpenAPI

````yaml https://api.gabin.ai/v1/openapi.json get /v1/buildings/{id}/companies
openapi: 3.1.0
info:
  title: Gabin API
  version: 1.0.0
  description: >-
    French company and real-estate data for builders: companies (SIRENE, RNE),
    establishments, officers, annual accounts, buildings (BDNB), parcels,
    addresses, zones, multi-criteria search, vector tiles, reference data.
    Guides: https://docs.gabin.ai.


    **Authentication.** Every endpoint except `/v1/health` and
    `/v1/openapi.json` requires `Authorization: Bearer <key>`: an API key
    (`gab_live_…`, created at https://gabin.ai/compte/api) or an OAuth access
    token (`gat_…`, MCP connectors).


    **Limits (free plan).** 60 weighted requests per minute and 5,000 units per
    UTC day per account. A request weighs 1 unless its endpoint states
    otherwise. Every response carries `X-RateLimit-Limit`,
    `X-RateLimit-Remaining`, `X-RateLimit-Reset`, `X-Quota-Remaining` and
    `X-Request-Id`.


    **Responses.** Success: `{ "data": …, "meta": { … } }`. Lists are paginated
    by an opaque cursor (`meta.page.next_cursor`, up to 100 per page and 10,000
    results per query). Errors: `{ "error": { "code", "message", "docs_url" }
    }`. Dates are ISO 8601, amounts in euros, areas in m², coordinates WGS84
    `[lon, lat]`.


    **Data rules.** Companies under SIRENE partial diffusion are returned
    without the person's name, street address, position or building. Officers
    come from public registers only (name, first names, month and year of birth,
    mandates), without contact details. No contact data is exposed.
  contact:
    name: Gabin
    url: https://gabin.ai
servers:
  - url: https://api.gabin.ai
security:
  - bearerAuth: []
tags:
  - name: Companies
    description: >-
      Companies (SIRENE legal units): search with filters, profile,
      establishments, officers, annual accounts.
  - name: Establishments
    description: Establishments (SIRENE), by SIRET.
  - name: Officers
    description: >-
      Company officers from public registers (RNE): search by name, mandates,
      relationships.
  - name: Reference data
    description: >-
      Values accepted by the filters: NAF activities, legal form families,
      headcount ranges.
  - name: Account
    description: 'The account behind the API key: plan, limits, remaining quota.'
  - name: Meta
    description: Service status and OpenAPI document. No authentication.
  - name: Buildings
    description: >-
      French buildings (BDNB): profile, linked companies, sections (energy,
      transactions, owners, condominium, parcels, parking, permits, fiber,
      planning, market) and geographic search.
  - name: Parcels
    description: 'Cadastral parcels: boundary, area, buildings.'
  - name: Addresses
    description: >-
      Address geocoding (Base Adresse Nationale) with the BDNB building at the
      address, and named places.
  - name: Zones
    description: >-
      Cities, districts (merged IRIS), departments, and market figures of a zone
      (prices, rents, demography, income).
  - name: Search
    description: >-
      Multi-criteria search on buildings or companies in a zone: a catalog of
      fields, AND conditions, OR groups.
  - name: Tiles
    description: Vector tiles (Mapbox Vector Tile) of the gabin.ai map layers.
paths:
  /v1/buildings/{id}/companies:
    get:
      tags:
        - Buildings
      summary: List the companies linked to a building
      description: >-
        Companies linked to a building: occupants (an establishment located
        there, matched by address or position) and corporate owners (land
        files), merged by SIREN. Active companies first, then by name.


        Sole proprietorships (entrepreneurs individuels) are listed as occupants
        by their registered name; companies under partial diffusion never are.
        Up to 500 companies can be reached; above 100 linked companies, the
        address is usually a business domiciliation.
      operationId: listBuildingCompanies
      parameters:
        - name: id
          in: path
          required: true
          description: >-
            BDNB building id (`batiment_groupe_id`). Example:
            "bdnb-bg-CJ69-HW8G-PTTG".
          schema:
            type: string
            maxLength: 40
            pattern: ^bdnb-[a-z]{2,4}-[A-Za-z0-9]{4}(-[A-Za-z0-9]{4})*$
        - name: cursor
          in: query
          required: false
          description: >-
            Cursor returned in `meta.page.next_cursor` by the previous page.
            Keep the same filters; the page size is the one of the first page.
          schema:
            type: string
            maxLength: 300
        - name: limit
          in: query
          required: false
          description: Results per page, 1 to 100. Default 20.
          schema:
            default: 20
            type: integer
            minimum: 1
            maximum: 100
      responses:
        '200':
          description: OK
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
            X-Quota-Remaining:
              $ref: '#/components/headers/X-Quota-Remaining'
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/BuildingCompany'
                  meta:
                    $ref: '#/components/schemas/PageMeta'
              example:
                data:
                  - company:
                      siren: '999100017'
                      name: Atelier Thermique du Rhône
                      naf_code: 43.29A
                      naf_label: Travaux d'isolation
                      sector: renovation-energetique
                      created_on: '2014-03-12'
                      active: true
                      partial_diffusion: false
                      gabin_url: >-
                        https://gabin.ai/entreprise/atelier-thermique-du-rhone-999100017
                      legal_form: SAS, société par actions simplifiée
                      headcount_range: '11'
                      headquarters:
                        address: 12 rue Émile Zola
                        postal_code: '69100'
                        city: Villeurbanne
                      latest_revenue: null
                      latest_revenue_year_end: null
                    roles:
                      - occupant
                    establishment:
                      siret: '99910001700011'
                      headquarters: true
                      trade_name: null
                      naf_code: 43.29A
                      naf_label: Travaux d'isolation
                      active: true
                meta:
                  page:
                    next_cursor: null
                    limit: 20
                  total: 1
                  total_kind: exact
        '400':
          description: INVALID, PAGINATION_LIMIT
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                INVALID:
                  value:
                    error:
                      code: INVALID
                      message: 'limit: Too big: expected number to be <=100'
                      docs_url: https://docs.gabin.ai/errors#invalid
                PAGINATION_LIMIT:
                  value:
                    error:
                      code: PAGINATION_LIMIT
                      message: >-
                        At most 10,000 results can be reached for one query.
                        Narrow the filters.
                      docs_url: https://docs.gabin.ai/errors#pagination_limit
        '401':
          description: UNAUTHENTICATED
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                UNAUTHENTICATED:
                  value:
                    error:
                      code: UNAUTHENTICATED
                      message: Invalid or revoked API key.
                      docs_url: https://docs.gabin.ai/errors#unauthenticated
        '404':
          description: NOT_FOUND
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                NOT_FOUND:
                  value:
                    error:
                      code: NOT_FOUND
                      message: No company with SIREN 999999999.
                      docs_url: https://docs.gabin.ai/errors#not_found
        '429':
          description: RATE_LIMITED, QUOTA_EXCEEDED
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            Retry-After:
              $ref: '#/components/headers/Retry-After'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                RATE_LIMITED:
                  value:
                    error:
                      code: RATE_LIMITED
                      message: >-
                        Rate limit reached (60 weighted requests per minute).
                        Retry in 12 s.
                      docs_url: https://docs.gabin.ai/errors#rate_limited
                QUOTA_EXCEEDED:
                  value:
                    error:
                      code: QUOTA_EXCEEDED
                      message: >-
                        Daily quota reached (5000 units per UTC day). It resets
                        at 00:00 UTC.
                      docs_url: https://docs.gabin.ai/errors#quota_exceeded
        '503':
          description: TIMEOUT, BUSY
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            Retry-After:
              $ref: '#/components/headers/Retry-After'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                TIMEOUT:
                  value:
                    error:
                      code: TIMEOUT
                      message: The query took too long. Narrow it down and retry.
                      docs_url: https://docs.gabin.ai/errors#timeout
                BUSY:
                  value:
                    error:
                      code: BUSY
                      message: >-
                        The API is serving too many database requests right now.
                        Retry in 1 s.
                      docs_url: https://docs.gabin.ai/errors#busy
components:
  headers:
    X-Request-Id:
      description: Unique id of the request; quote it when contacting support.
      schema:
        type: string
    X-RateLimit-Limit:
      description: Weighted requests allowed per minute for the account.
      schema:
        type: integer
    X-RateLimit-Remaining:
      description: Weighted requests left in the current minute.
      schema:
        type: integer
    X-RateLimit-Reset:
      description: Seconds until the per-minute window resets.
      schema:
        type: integer
    X-Quota-Remaining:
      description: Units left in the daily quota (UTC day).
      schema:
        type: integer
    Retry-After:
      description: Seconds to wait before retrying.
      schema:
        type: integer
  schemas:
    BuildingCompany:
      type: object
      properties:
        company:
          $ref: '#/components/schemas/CompanySummary'
        roles:
          type: array
          items:
            type: string
            enum:
              - occupant
              - owner
          description: >-
            `occupant`: an establishment of the company is located in the
            building. `owner`: the company owns property in it (land files).
        establishment:
          anyOf:
            - type: object
              properties:
                siret:
                  type: string
                  description: SIRET of the establishment in the building.
                headquarters:
                  type: boolean
                  description: True for the registered office.
                trade_name:
                  description: Trade name (enseigne) of the establishment.
                  type:
                    - string
                    - 'null'
                naf_code:
                  description: NAF code of the establishment.
                  type:
                    - string
                    - 'null'
                naf_label:
                  type: string
                  description: Label of the NAF code, in French.
                active:
                  type: boolean
                  description: False when the establishment is closed.
              required:
                - siret
                - headquarters
                - trade_name
                - naf_code
                - naf_label
                - active
            - type: 'null'
          description: >-
            Establishment through which the company occupies the building; null
            for an owner only.
      required:
        - company
        - roles
        - establishment
      description: >-
        A company linked to a building: a legal entity, or a sole proprietorship
        occupying it (registered name). Never a company under partial diffusion.
    PageMeta:
      type: object
      properties:
        page:
          type: object
          properties:
            next_cursor:
              description: >-
                Opaque cursor for the next page: pass it as `cursor` with the
                same filters. Null on the last page or once 10,000 results have
                been reached.
              type:
                - string
                - 'null'
            limit:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
              description: Page size used for this response.
          required:
            - next_cursor
            - limit
        total:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: >-
            Number of matching results, qualified by `total_kind`. Example:
            8337.
        total_kind:
          type: string
          enum:
            - exact
            - lower_bound
            - estimate
          description: >-
            `exact`: counted. `lower_bound`: at least this many (counting
            stopped). `estimate`: database planner estimate, can be off by a few
            percent.
      required:
        - page
        - total
        - total_kind
      description: Pagination metadata of a list response.
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - UNAUTHENTICATED
                - FORBIDDEN
                - NOT_FOUND
                - INVALID
                - ZONE_REQUIRED
                - PAGINATION_LIMIT
                - RATE_LIMITED
                - QUOTA_EXCEEDED
                - TIMEOUT
                - BUSY
                - INTERNAL
              description: Stable machine-readable code.
            message:
              type: string
              description: Human-readable explanation, in English.
            docs_url:
              type: string
              description: Documentation page for this error code.
          required:
            - code
            - message
            - docs_url
      required:
        - error
      description: Error body. The HTTP status matches `error.code`.
    CompanySummary:
      type: object
      properties:
        siren:
          type: string
          description: 'SIREN: 9 digits. Example: 552100554.'
        name:
          type: string
          description: >-
            Registered name; first and last name for a sole proprietorship.
            Neutral label under partial diffusion ("Entrepreneur individuel").
            Example: "Atelier Thermique du Rhône".
        naf_code:
          type: string
          description: 'NAF rev. 2 sub-class of the company. Example: "43.29A".'
        naf_label:
          type: string
          description: 'Label of the NAF code, in French. Example: "Travaux d''isolation".'
        sector:
          description: Gabin sector slug of the NAF code, null outside sectors.
          type:
            - string
            - 'null'
        created_on:
          description: Creation date (YYYY-MM-DD).
          type:
            - string
            - 'null'
        active:
          type: boolean
          description: False when the company has ceased (SIRENE state C).
        partial_diffusion:
          type: boolean
          description: >-
            True when the company is under SIRENE partial diffusion: no name of
            the person, address limited to the city, no position, no building,
            no officers.
        gabin_url:
          type: string
          description: Page of the company on gabin.ai.
        legal_form:
          description: >-
            INSEE label of the legal form, in French. Example: "SAS, société par
            actions simplifiée".
          type:
            - string
            - 'null'
        headcount_range:
          type: string
          enum:
            - '11'
            - '12'
            - '21'
            - '22'
            - '31'
            - '32'
            - '41'
            - '42'
            - '51'
            - '52'
            - '53'
            - NN
            - '00'
            - '01'
            - '02'
            - '03'
          description: >-
            INSEE headcount range code. "NN": not reported. See GET
            /v1/headcount-ranges.
        headquarters:
          type: object
          properties:
            address:
              type: string
              description: Street of the registered office; empty under partial diffusion.
            postal_code:
              description: 'Postal code. Example: "69100".'
              type:
                - string
                - 'null'
            city:
              type: string
              description: 'City. Example: "Villeurbanne".'
          required:
            - address
            - postal_code
            - city
        latest_revenue:
          description: >-
            Latest reported revenue, present only when results are ranked by
            revenue (no `q`, `insee`, `iris` or `department`). Otherwise see GET
            /v1/companies/{siren}/financials. In euros; null when not reported.
          type:
            - number
            - 'null'
        latest_revenue_year_end:
          description: Fiscal year end (YYYY-MM-DD) of `latest_revenue`.
          type:
            - string
            - 'null'
      required:
        - siren
        - name
        - naf_code
        - naf_label
        - sector
        - created_on
        - active
        - partial_diffusion
        - gabin_url
        - legal_form
        - headcount_range
        - headquarters
        - latest_revenue
        - latest_revenue_year_end
      description: A company in a list.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key `gab_live_…` or OAuth access token `gat_…`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.