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

# Arbo as a data source

> Bring data from Arbo to Nekt.

Arbo is a real estate platform that provides property management and listing services for real estate agencies. It offers tools for managing properties, condominiums, owners, and real estate transactions, enabling real estate professionals to efficiently organize and showcase their property portfolios.

## Configuring Arbo as a Source

In the [Sources](https://app.nekt.ai/sources) tab, click on the "Add source" button located on the top right of your screen. Then, select the Arbo option from the list of connectors.

Click **Next** and you'll be prompted to add your access.

### 1. Add account access

You'll need to provide your Arbo API authentication token to access your data.

The following configuration is available:

* **Auth Token**: (Required) The API key to authenticate against the Arbo API service. Contact Arbo support to obtain your API authentication token.

* **Leads API Auth Token**: (Optional) When provided, the **Leads** stream becomes available. This token authenticates against the Arbo Leads API (separate endpoint). Use it if you want to sync lead data (contacts, status, broker, associated properties). If omitted, the Leads stream will not appear in the stream list.

Once you're done, click **Next**.

### 2. Select streams

Choose which data streams you want to sync. For faster extractions, select only the streams that are relevant to your analysis. You can select entire groups of streams or pick specific ones.

> Tip: The stream can be found more easily by typing its name.

Select the streams and click **Next**.

### 3. Configure data streams

Customize how you want your data to appear in your catalog. Select the desired layer where the data will be placed, a folder to organize it inside the layer, a name for each table (which will effectively contain the fetched data) and the type of sync.

* **Layer**: choose between the existing layers on your catalog. This is where you will find your new extracted tables as the extraction runs successfully.
* **Folder**: a folder can be created inside the selected layer to group all tables being created from this new data source.
* **Table name**: we suggest a name, but feel free to customize it. You have the option to add a **prefix** to all tables at once and make this process faster!
* **Sync Type**: you can choose between INCREMENTAL and FULL\_TABLE.
  * Incremental: every time the extraction happens, we'll get only the new data - which is good if, for example, you want to keep every record ever fetched.
  * Full table: every time the extraction happens, we'll get the current state of the data - which is good if, for example, you don't want to have deleted data in your catalog.

Once you are done configuring, click **Next**.

### 4. Configure data source

Describe your data source for easy identification within your organization, not exceeding 140 characters.

To define your [Trigger](https://docs.nekt.com/runs/scheduling-and-triggers), consider how often you want data to be extracted from this source. This decision usually depends on how frequently you need the new table data updated (every day, once a week, or only at specific times).

Optionally, you can define some additional settings:

* Configure Delta Log Retention and determine for how long we should store old states of this table as it gets updated. Read more about this resource [here](https://docs.nekt.com/get-started/core-concepts/resource-control).
* Determine when to execute an **Additional [Full Sync](https://docs.nekt.com/get-started/core-concepts/types-of-sync#additional-full-sync)**. This will complement the incremental data extractions, ensuring that your data is completely synchronized with your source every once in a while.

Once you are ready, click **Next** to finalize the setup.

### 5. Check your new source

You can view your new source on the [Sources](https://app.nekt.ai/sources) page. If needed, manually trigger the source extraction by clicking on the arrow button. Once executed, your data will appear in your Catalog.

<Warning>For you to be able to see it on your [Catalog](https://app.nekt.ai/catalog), you need at least one successful source run.</Warning>

# Streams and Fields

Below you'll find all available data streams from Arbo and their corresponding fields:

<AccordionGroup>
  <Accordion title="Imoveis">
    Stream for managing property listings, including all property details, location information, pricing, and features.

    **Identifiers:**

    * `ref_id` - Unique identifier for the property (primary key)
    * `codigo` - Property code
    * `codigo_origem` - Original property code

    **Status & Visibility:**

    * `ativo` - Whether the property is active
    * `publicado` - Whether the property is published
    * `status_comercial` - Commercial status
    * `origemcadastro` - Registration origin

    **Property Information:**

    * `titulo` - Property title
    * `descricao` - Property description
    * `categoria` - Property category
    * `categoria_imovel` - Property category type
    * `tipo_imovel` - Property type (Residencial, Comercial, etc.)
    * `finalidade` - Property purpose (Venda, Aluguel, Venda e Locação)
    * `mobiliado` - Whether the property is furnished
    * `permuta` - Whether exchange is accepted
    * `financiamento` - Whether financing is available

    **Property Details:**

    * `qtd_quartos` - Number of bedrooms
    * `qtd_suites` - Number of suites
    * `qtd_vagas` - Number of parking spaces
    * `qtd_banheiro` - Number of bathrooms
    * `area_total` - Total area
    * `area_privativa` - Private area

    **Address Information:**

    * `end_condominio` - Condominium name
    * `end_bairro` - Neighborhood
    * `end_cidade` - City
    * `end_estado` - State
    * `end_logradouro` - Street address
    * `end_complemento` - Address complement
    * `end_numero` - Address number
    * `end_cep` - ZIP code
    * `latitude` - Latitude coordinate
    * `longitude` - Longitude coordinate

    **Pricing:**

    * `valor_venda` - Sale price
    * `valor_aluguel` - Rental price
    * `valor_condominio` - Condominium fee
    * `valor_iptu` - IPTU tax value

    **Media:**

    * `fotos` - Array of property photos, each containing:
      * `url` - Photo URL
      * `ordem` - Display order
      * `principal` - Whether it's the main photo
      * `marcadagua_url` - Watermark URL
      * `sizes` - Object with `medium` and `small` image URLs
    * `url_video` - Video URL
    * `url_tour` - Virtual tour URL

    **Relationships:**

    * `condominio` - Condominium ID (foreign key to condominios)
    * `prop_id` - Property ID (used for child stream proprietarios)
    * `corretor` - Broker information object:
      * `codigo` - Broker code
      * `nome` - Broker name
    * `imobiliaria` - Real estate agency information object:
      * `nome` - Agency name
      * `infos` - Array of info objects with `url` and `tipo`
      * `telefones` - Array of phone numbers

    **Features & Metadata:**

    * `caracteristicas` - Array of property features/amenities
    * `emp_fields` - Enterprise fields object with pricing and area filters:
      * `emp_preco_min` - Minimum price
      * `emp_preco_max` - Maximum price
      * `emp_preco_min_loc` - Minimum rental price
      * `emp_preco_max_loc` - Maximum rental price
      * `emp_areautil_min` - Minimum usable area
      * `emp_areautil_max` - Maximum usable area
      * `emp_areaprivativa_min` - Minimum private area
      * `emp_areaprivativa_max` - Maximum private area
      * `emp_areatotal_min` - Minimum total area
      * `emp_areatotal_max` - Maximum total area
      * `emp_dorm_min` - Minimum bedrooms
      * `emp_dorm_max` - Maximum bedrooms
      * `emp_porcentagem_total` - Total percentage

    **Timestamps:**

    * `created_at` - Creation timestamp
    * `updated_at` - Last update timestamp
  </Accordion>

  <Accordion title="Condominios">
    Stream for managing condominium information, including location, characteristics, and photos.

    **Identifiers:**

    * `id` - Unique identifier for the condominium (primary key)
    * `cond_cod` - Condominium code
    * `cond_cod_origem` - Original condominium code

    **Basic Information:**

    * `cond_nome` - Condominium name
    * `cond_tipo` - Condominium type
    * `cond_ano` - Construction year (can be string or number)
    * `cond_construt` - Builder/Constructor
    * `cond_desc` - Description
    * `cond_coment` - Comments
    * `condominio_ativo` - Whether the condominium is active

    **Address Information:**

    * `cond_logradouro` - Street address
    * `cond_numero` - Address number
    * `cond_bairro` - Neighborhood
    * `cond_ptref` - Reference point
    * `cond_city` - City
    * `cond_est` - State
    * `cond_cep` - ZIP code
    * `cond_latitude` - Latitude coordinate
    * `cond_longitude` - Longitude coordinate
    * `cond_raiomapa` - Map radius

    **Media & Features:**

    * `fotos` - Array of condominium photos, each containing:
      * `url` - Photo URL
      * `ordem` - Display order
      * `principal` - Whether it's the main photo
      * `marcadagua_url` - Watermark URL
      * `sizes` - Object with `medium` and `small` image URLs
    * `caracteristicas` - Array of condominium features/amenities
    * `imobiliaria` - Real estate agency information (can be ID number or full object)

    **Timestamps:**

    * `createdat` - Creation timestamp
    * `updatedat` - Last update timestamp
  </Accordion>

  <Accordion title="Proprietarios">
    Stream for managing property owners. This is a child stream of Imoveis, meaning it requires a parent property record to fetch owner information.

    **Identifiers:**

    * `id` - Unique identifier for the owner (primary key)
    * `usu_id` - User ID (property ID, references prop\_id from imoveis)
    * `imb_id` - Real estate agency ID

    **Owner Information:**

    * `nome` - Owner name
    * `email` - Owner email
    * `rg` - RG (Brazilian ID)
    * `cpf` - CPF (Brazilian tax ID)

    **Contact Information:**

    * `telefones` - Array of phone number objects, each containing:
      * `id` - Phone number ID
      * `numero` - Phone number
      * `contato` - Contact name/description

    **Timestamps:**

    * `createdat` - Creation timestamp
    * `updatedat` - Last update timestamp
  </Accordion>

  <Accordion title="Cidades">
    Stream for retrieving cities with available properties.

    **Identifiers:**

    * `end_cidade` - City name (primary key)

    **Metrics:**

    * `count` - Number of properties in this city
  </Accordion>

  <Accordion title="Bairros">
    Stream for retrieving neighborhoods with available properties.

    **Identifiers:**

    * `end_bairro` - Neighborhood name (part of composite primary key)
    * `end_cidade` - City name (part of composite primary key)

    **Metrics:**

    * `count` - Number of properties in this neighborhood
  </Accordion>

  <Accordion title="Tipos Imovel">
    Stream for retrieving property type categories.

    **Identifiers:**

    * `id` - Property type ID (primary key)

    **Information:**

    * `categoria` - Property type category
  </Accordion>

  <Accordion title="Leads">
    Stream for lead/contact data from the Arbo Leads API. This stream is **only available** when the optional **Leads API Auth Token** is configured in the source. Uses a separate API base URL and pagination (page size 100).

    **Identifiers:**

    * `id` - Lead ID (primary key)

    **Lead Information:**

    * `ativo` - Whether the lead is active
    * `nome` - Lead name
    * `email` - Lead email
    * `telefone` - Lead phone number

    **Broker & Assignment:**

    * `corretor` - Broker information object:
      * `id` - Broker ID
      * `nome` - Broker name
      * `email` - Broker email
      * `telefone` - Broker phone number
      * `telefones` - Array of phone entries (id, label)
    * `time` - Assigned team object (id, nome)

    **Lead Classification:**

    * `midia` - Lead acquisition media/source (id, nome)
    * `status` - Lead status (id, label)
    * `negocio` - Business type, e.g. Locação, Venda (id, label)

    **Associated Properties:**

    * `imoveis` - Array of properties linked to the lead, each with:
      * `id` - Property ID
      * `codigo` - Property code
      * `codigo_origem` - Original property code

    **Timestamps:**

    * `createdat` - Creation timestamp
    * `updatedat` - Last update timestamp
  </Accordion>
</AccordionGroup>

# Data Model

The following diagram illustrates the relationships between the data streams in Arbo. The arrows indicate the join keys that link the different entities, providing a clear overview of the data structure.

```mermaid theme={null}
graph TD;
    subgraph "Core Entities"
        Imoveis("Imoveis");
        Condominios("Condominios");
        Proprietarios("Proprietarios");
        Leads("Leads");
        TiposImovel("Tipos Imovel");
    end

    subgraph "Reference Data"
        Cidades("Cidades");
        Bairros("Bairros");
    end

    Imoveis -- "condominio -> id" --> Condominios;
    Proprietarios -- "usu_id -> prop_id" --> Imoveis;
    Leads -- "imoveis[].id" --> Imoveis;
    Bairros -- "end_cidade" --> Cidades;
    Imoveis -- "categoria" --> TiposImovel;
```

# Use Cases for Data Analysis

This guide outlines valuable business intelligence use cases when consolidating Arbo data, along with ready-to-use SQL queries that you can run on [Explorer](https://app.nekt.ai/explorer).

### 1. Property Portfolio Overview

Get a comprehensive view of your property portfolio with key metrics including property counts, pricing distribution, and availability by location.

**Business Value:**

* Identify property distribution across cities and neighborhoods
* Analyze pricing trends and availability
* Track active vs. published properties
* Understand property type distribution

<Accordion title="SQL query">
  <Tabs>
    <Tab title="AWS">
      ```sql theme={null}
      SELECT
         i.end_cidade AS city,
         i.end_bairro AS neighborhood,
         i.categoria AS category,
         i.tipo_imovel AS property_type,
         i.finalidade AS purpose,
         COUNT(*) AS property_count,
         COUNT(DISTINCT i.condominio) AS condominium_count,
         AVG(i.valor_venda) AS avg_sale_price,
         AVG(i.valor_aluguel) AS avg_rental_price,
         SUM(CASE WHEN i.ativo = true THEN 1 ELSE 0 END) AS active_count,
         SUM(CASE WHEN i.publicado = true THEN 1 ELSE 0 END) AS published_count,
         AVG(i.area_total) AS avg_total_area,
         AVG(i.qtd_quartos) AS avg_bedrooms
      FROM
         nekt_raw.arbo_imoveis i
      WHERE
         i.ativo = true
      GROUP BY
         1, 2, 3, 4, 5
      ORDER BY
         property_count DESC
      ```
    </Tab>

    <Tab title="GCP">
      ```sql theme={null}
      SELECT
         i.end_cidade AS city,
         i.end_bairro AS neighborhood,
         i.categoria AS category,
         i.tipo_imovel AS property_type,
         i.finalidade AS purpose,
         COUNT(*) AS property_count,
         COUNT(DISTINCT i.condominio) AS condominium_count,
         AVG(i.valor_venda) AS avg_sale_price,
         AVG(i.valor_aluguel) AS avg_rental_price,
         SUM(CASE WHEN i.ativo = true THEN 1 ELSE 0 END) AS active_count,
         SUM(CASE WHEN i.publicado = true THEN 1 ELSE 0 END) AS published_count,
         AVG(i.area_total) AS avg_total_area,
         AVG(i.qtd_quartos) AS avg_bedrooms
      FROM
         `nekt_raw.arbo_imoveis` i
      WHERE
         i.ativo = true
      GROUP BY
         1, 2, 3, 4, 5
      ORDER BY
         property_count DESC
      ```
    </Tab>
  </Tabs>
</Accordion>

<Accordion title="Sample Result">
  | city    | neighborhood | category    | property\_type | purpose         | property\_count | condominium\_count | avg\_sale\_price | avg\_rental\_price | active\_count | published\_count | avg\_total\_area | avg\_bedrooms |
  | ------- | ------------ | ----------- | -------------- | --------------- | --------------- | ------------------ | ---------------- | ------------------ | ------------- | ---------------- | ---------------- | ------------- |
  | Pelotas | Centro       | Studio      | Residencial    | Venda           | 45              | 12                 | 245000.00        | NULL               | 45            | 42               | 35.5             | 1.0           |
  | Pelotas | Três Vendas  | Apartamento | Residencial    | Venda e Locação | 38              | 8                  | 385000.00        | 2800.00            | 38            | 35               | 72.3             | 2.5           |
  | Pelotas | Laranjal     | Terreno     | Residencial    | Venda           | 22              | 3                  | 150000.00        | NULL               | 22            | 20               | 250.0            | NULL          |
</Accordion>

### 2. Property-Owner Relationships

Analyze the relationship between properties and their owners to understand portfolio distribution and owner information.

**Business Value:**

* Identify owners with multiple properties
* Analyze owner contact information completeness
* Track property-owner associations
* Understand property distribution per owner

<Accordion title="SQL query">
  <Tabs>
    <Tab title="AWS">
      ```sql theme={null}
      SELECT
         p.nome AS owner_name,
         p.email AS owner_email,
         p.cpf AS owner_cpf,
         COUNT(DISTINCT p.usu_id) AS property_count,
         STRING_AGG(DISTINCT i.categoria, ', ') AS property_categories,
         STRING_AGG(DISTINCT i.end_cidade, ', ') AS cities,
         AVG(i.valor_venda) AS avg_property_value,
         SUM(ARRAY_LENGTH(p.telefones)) AS total_phone_numbers
      FROM
         nekt_raw.arbo_proprietarios p
         LEFT JOIN nekt_raw.arbo_imoveis i ON p.usu_id = i.prop_id
      GROUP BY
         1, 2, 3
      HAVING
         COUNT(DISTINCT p.usu_id) > 0
      ORDER BY
         property_count DESC
      ```
    </Tab>

    <Tab title="GCP">
      ```sql theme={null}
      SELECT
         p.nome AS owner_name,
         p.email AS owner_email,
         p.cpf AS owner_cpf,
         COUNT(DISTINCT p.usu_id) AS property_count,
         STRING_AGG(DISTINCT i.categoria, ', ') AS property_categories,
         STRING_AGG(DISTINCT i.end_cidade, ', ') AS cities,
         AVG(i.valor_venda) AS avg_property_value,
         ARRAY_LENGTH(p.telefones) AS total_phone_numbers
      FROM
         `nekt_raw.arbo_proprietarios` p
         LEFT JOIN `nekt_raw.arbo_imoveis` i ON p.usu_id = i.prop_id
      GROUP BY
         1, 2, 3, 8
      HAVING
         COUNT(DISTINCT p.usu_id) > 0
      ORDER BY
         property_count DESC
      ```
    </Tab>
  </Tabs>
</Accordion>

<Accordion title="Sample Result">
  | owner\_name  | owner\_email                                  | owner\_cpf     | property\_count | property\_categories | cities              | avg\_property\_value | total\_phone\_numbers |
  | ------------ | --------------------------------------------- | -------------- | --------------- | -------------------- | ------------------- | -------------------- | --------------------- |
  | João Silva   | [joao@example.com](mailto:joao@example.com)   | 123.456.789-00 | 5               | Studio, Apartamento  | Pelotas             | 285000.00            | 2                     |
  | Maria Santos | [maria@example.com](mailto:maria@example.com) | 987.654.321-00 | 3               | Terreno, Casa        | Pelotas, Rio Grande | 320000.00            | 1                     |
</Accordion>

### 3. Condominium Analysis

Analyze condominium data to understand property distribution, features, and location patterns.

**Business Value:**

* Understand property concentration in condominiums
* Analyze condominium characteristics and features
* Track condominium locations and distribution
* Compare property values within condominiums

<Accordion title="SQL query">
  <Tabs>
    <Tab title="AWS">
      ```sql theme={null}
      SELECT
         c.cond_nome AS condominium_name,
         c.cond_city AS city,
         c.cond_bairro AS neighborhood,
         COUNT(DISTINCT i.ref_id) AS property_count,
         AVG(i.valor_venda) AS avg_sale_price,
         AVG(i.area_total) AS avg_area,
         ARRAY_LENGTH(c.caracteristicas) AS feature_count,
         ARRAY_LENGTH(c.fotos) AS photo_count,
         c.condominio_ativo AS is_active
      FROM
         nekt_raw.arbo_condominios c
         LEFT JOIN nekt_raw.arbo_imoveis i ON c.id = i.condominio
      GROUP BY
         1, 2, 3, 7, 8, 9
      ORDER BY
         property_count DESC
      ```
    </Tab>

    <Tab title="GCP">
      ```sql theme={null}
      SELECT
         c.cond_nome AS condominium_name,
         c.cond_city AS city,
         c.cond_bairro AS neighborhood,
         COUNT(DISTINCT i.ref_id) AS property_count,
         AVG(i.valor_venda) AS avg_sale_price,
         AVG(i.area_total) AS avg_area,
         ARRAY_LENGTH(c.caracteristicas) AS feature_count,
         ARRAY_LENGTH(c.fotos) AS photo_count,
         c.condominio_ativo AS is_active
      FROM
         `nekt_raw.arbo_condominios` c
         LEFT JOIN `nekt_raw.arbo_imoveis` i ON c.id = i.condominio
      GROUP BY
         1, 2, 3, 7, 8, 9
      ORDER BY
         property_count DESC
      ```
    </Tab>
  </Tabs>
</Accordion>

## Implementation Notes

### Leads stream

* The **Leads** stream is only available when **Leads API Auth Token** is set in the source configuration. It uses a separate Arbo Leads API endpoint and token.
* Leads API uses the same pagination pattern (page, lastPage) with a page size of 100. Pagination fields may be returned as strings or numbers; the tap normalizes them for comparison.

### Data Quality Considerations

* The `proprietarios` stream is a child stream of `imoveis` and requires a parent property record with a valid `prop_id`
* Property prices (`valor_venda`, `valor_aluguel`) may be NULL for properties not available for sale/rent
* Some fields like `cond_ano` (construction year) may be returned as strings or numbers depending on the API response
* The `imobiliaria` field in condominios can be either an ID number or a full object, and is converted to a string format for consistency

### API Limits & Performance

* The main Arbo API and the Leads API use pagination with a page size of 100 records
* For faster extractions, select only the streams necessary for your analysis
* The `proprietarios` stream will only sync for properties that have a valid `prop_id` value

## Skills for agents

<Snippet file="agent-skills-intro.mdx" />

<Card title="Download Arbo skills file" icon="wand-magic-sparkles" href="/sources/arbo.md">
  Arbo connector documentation as plain markdown, for use in AI agent contexts.
</Card>
