---
title: "VAR"
description: "API VAR - Validação de CPF em tempo real para decisões mais seguras"
lang: en
canonical: https://doc.apibrasil.io/apis/creditos/4b9bfb74-7eb1-48e0-8477-5247e344e461
markdown: https://doc.apibrasil.io/apis/creditos/4b9bfb74-7eb1-48e0-8477-5247e344e461.md
source: apibrasil-documentation
---

# VAR

> API VAR - Validação de CPF em tempo real para decisões mais seguras

- **Category:** Credit Analysis
- **Billing:** per query, with the Bearer Token only
- **Price:** R$1.78 per query
- **Limit:** 999,000 per month
- **Registration:** requires a CNPJ
- **Version:** v1
- **Published by:** APIBrasil
- **OpenAPI specification:** https://doc.apibrasil.io/apis/creditos/4b9bfb74-7eb1-48e0-8477-5247e344e461/openapi.json

## How to call

**Base address:** `https://gateway.apibrasil.io/api/v2`

Authentication: the `Authorization: Bearer <token>` header. Nothing else.

With `homolog: true` in the body, the gateway answers from a fixed base, with the real shape of the response, and does not charge. The CPF 00000000000 belongs to that base and to nobody: use it in tests, never in production.

## Endpoints (1 endpoint)

### 1. POST /consulta/cpf/credits

API VAR - Mais segurança e inteligência na análise de crédito em tempo real

A API VAR permite consultar CPF e informações de crédito em segundos, diretamente dentro do seu sistema, acelerando decisões e reduzindo riscos. Com integração rápida via método POST no endpoint de consulta/cpf/credits, você passa os dados essenciais e recebe um retorno estruturado com o perfil de crédito do consumidor para automatizar regras, limites e aprovações. Essa inteligência integrada aumenta a taxa de aprovação com segurança, evita inadimplência e melhora a experiência do cliente final. Use a API VAR para enriquecer cadastros, apoiar motores de decisão, personalizar ofertas financeiras e ter um fluxo de crédito mais ágil, confiável e lucrativo.

- **Method:** `POST`
- **Address:** `https://gateway.apibrasil.io/api/v2/consulta/cpf/credits`
- **Route version:** v1

**Headers**

| Header | Value |
| --- | --- |
| `Content-Type` | `application/json` |
| `Authorization` | `Bearer $APIBRASIL_TOKEN` |

**Request body**

```json
{
  "tipo": "var",
  "cpf": "00000000000",
  "homolog": true
}
```

**In cURL**

```bash
curl -X POST "https://gateway.apibrasil.io/api/v2/consulta/cpf/credits" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $APIBRASIL_TOKEN" \
  -d '{"tipo":"var","cpf":"00000000000","homolog":true}'
```

This endpoint accepts `homolog: true` in the body: the response comes back with valid data, `api_limit_for` equal to `homolog` and no charge.

**Sample response, from the catalog**

```json
{
  "user": {
    "first_name": "[omitido]",
    "email": "[omitido]",
    "cellphone": "[omitido]",
    "notification": "yes"
  },
  "balance": "105,660",
  "balance_before": "105,660",
  "tax": "0,000",
  "status_code": 200,
  "error": false,
  "message": "Dados validos em homologacao! Voce nao foi tarifado e a requisicao nao foi contabilizada.",
  "valor_consulta": 0,
  "api_limit_for": "homolog",
  "homolog": true,
  "data": {
    "resultados": [
      {
        "cadastral": {
          "comprovante_rfb": "MOCK-HML-0001",
          "ds_faixa_idade": "De 26 a 35",
          "ds_nacionalidade": "Brasileira",
          "ds_orgao_emissor": "SSP-MG",
          "ds_sexo": "Feminino",
          "ds_signo": "Virgem",
          "ds_status_rfb": "REGULAR",
          "dt_atualizacao_rfb": "2025-03-01",
          "dt_inscricao": "15/08/2010",
          "dt_nasc": "1992-09-12",
          "nit_pis": null,
          "nm_completo": "HELENA MOCK SILVA HOMOLOG",
          "nm_mae": "ROSA MOCK SILVA HOMOLOG",
          "nm_social": "HELENA MOCK SILVA HOMOLOG",
          "nome_unico": false,
          "nr_cpf": "00000000000",
          "nr_cpf_mae": null,
          "nr_rg": "MG99112233",
          "nr_titulo_eleitoral": null,
          "sg_sexo": "F",
          "sg_sg_uf_rg": "MG",
          "st_menor_idade": false,
          "st_pep": false,
          "st_ppp": false
        },
        "contato": {
          "ds_email": [
            {
              "cd_ordem": 1,
              "ds_email": "[omitido]",
              "dt_inclusao": "2025-02-18"
            },
            {
              "cd_ordem": 2,
              "ds_email": "[omitido]",
              "dt_inclusao": "2024-11-05"
            }
          ],
          "endereco": [
            {
              "caracteristicas": "Residencial",
              "cd_ordem": 1,
              "ds_bairro": "JARDIM DADOS FICTICIOS",
              "ds_cidade": "CIDADE HOMOLOG",
              "ds_complemento": "BL Z AP 101",
              "ds_logradouro": "RUA SEM NUMERO REAL 5000",
              "ds_regiao": "SUDESTE",
              "dt_informacao": "2025-02-20",
              "latitude": "-19.750000",
              "longitude": "-43.940000",
              "nr_nr_cep": "30130000",
              "nr_numero": "10",
              "outras_grafias": null,
              "sg_sg_uf": "MG",
              "sg_tipo_logradouro": "RUA"
            },
            {
              "caracteristicas": "Comercial",
              "cd_ordem": 2,
              "ds_bairro": "DISTRITO MOCK INDUSTRIAL",
              "ds_cidade": "POLO FICTICIO",
              "ds_complemento": "GALPAO 9",
              "ds_logradouro": "AV INEXISTENTE NO CADASTRO 200",
              "ds_regiao": "SUDESTE",
              "dt_informacao": "2024-12-01",
              "latitude": "-20.100000",
              "longitude": "-44.200000",
              "nr_nr_cep": "32600000",
              "nr_numero": "2500",
              "outras_grafias": null,
              "sg_sg_uf": "MG",
              "sg_tipo_logradouro": "AV"
            }
          ],
          "nr_telefone": [
            {
              "cd_ordem": 1,
              "ds_tipo_nr_telefone": "Movel",
              "dt_inclusao": "2025-02-18",
              "nr_ddd": "31",
              "nr_ddi": "55",
              "nr_nr_telefone": "900001111",
              "sg_uf_ddd": "MG"
            },
            {
              "cd_ordem": 2,
              "ds_tipo_nr_telefone": "Fixo",
              "dt_inclusao": "2024-11-05",
              "nr_ddd": "31",
              "nr_ddi": "55",
              "nr_nr_telefone": "30001111",
              "sg_uf_ddd": "MG"
            }
          ]
        },
        "nr_cpf": "00000000000",
        "obito": {
          "ano_obito": null,
          "dt_obito": null,
          "fonte_obito": null,
          "mes_obito": null,
          "possivel_obito": false,
          "st_obito": false,
          "tipo_obito": null
        },
        "socioeconomico": {
          "cd_ocupacao": "212405",
          "cfm": [],
          "ds_faixa_renda_presumida": "De R$ 3.000,01 a R$ 6.000,00",
          "ds_grau_escolaridade": "Ensino Medio Completo",
          "ds_ocupacao": "Analista de sistemas (mock)",
          "dt_faixa_renda_presumida": "2025-02-01",
          "dt_grau_escolaridade": "2024-12-01",
          "dt_ocupacao": "2025-02-01",
          "historico_ocupacoes": [
            {
              "ano": "2025",
              "cbo": "212405",
              "ds_ocupacao": "Analista de sistemas (mock)",
              "faixa_renda_presumida": 5100,
              "renda_presumida": "5.100,00"
            },
            {
              "ano": "2024",
              "cbo": "411010",
              "ds_ocupacao": "Assistente administrativo (mock)",
              "faixa_renda_presumida": 2800,
              "renda_presumida": "2.800,00"
            }
          ]
        },
        "vinculo": {
          "empregador": [
            {
              "cd_ordem": 1,
              "dt_admissao": "2022-07-11",
              "dt_demissao": null,
              "dt_informacao": "2025-02-18",
              "nr_cnpj": "11222333000181",
              "razao_social": "EMPRESA TOTALMENTE FICTICIA VAR LTDA"
            }
          ],
          "parentesco": [
            {
              "cd_ordem": 1,
              "ds_vinculo": "Irma",
              "dt_informacao": "2024-10-10",
              "nm_completo": "MARINA MOCK SILVA HOMOLOG",
              "nr_cpf": "11144477735"
            }
          ],
          "possiveis_colegas_trabalho": [
            {
              "cd_ordem": 1,
              "nm_completo": "PEDRO MOCK OLIVEIRA HOMOLOG",
              "nr_cpf": "52998224725"
            },
            {
              "cd_ordem": 2,
              "nm_completo": "JULIA MOCK COSTA HOMOLOG",
              "nr_cpf": "39053344705"
            }
          ],
          "socios": []
        }
      }
    ]
  }
}
```

In the sample responses, the fields of the account that generated the sample (`user.first_name`, `user.email`, `user.cellphone`) come out as `[omitido]`. The rest is what the catalog publishes.

## Pitfalls: what an integration gets wrong without warning

Established from the responses the catalog itself publishes. In every one of them the code works on the happy path and fails silently everywhere else:

1. **The error arrives in the BODY, with HTTP 200.**
   The response carries a boolean `error` field and a `message`. Checking only `response.ok` or the HTTP status lets a failure through as a success. ALWAYS check `error === false` before reading `data`.

2. **`balance`, `tax` and `extra_charges.total` are STRINGS in Brazilian format — and the format varies between APIs.**
   Values seen in the catalog: `"154,380"`, `"497,84"`, `"0,000"` and `"0.19"`. Comma in some, dot in another; three decimal places in some, two in another. In JavaScript, `parseFloat("154,380")` returns `154` and drops the cents with no error at all, and `Number("154,380")` returns `NaN`. Write a converter that handles both separators, and never use these fields in a financial decision without converting them.

3. **Every call costs money.**
   Blind retries multiply the bill. Never automatically repeat a 4xx: a bad parameter repeated is still bad, and still charged. Retry only timeouts and 5xx, with exponential backoff and a small attempt ceiling.

4. **HTTP 402 means insufficient balance, and retrying does not fix it.**
   It is the one status that needs a human — a top-up. Treat it as a terminal error with its own message, and do not lump it in with generic 4xx.

5. **`extra_charges` bills on top of the lookup price.**
   When the body asks for add-on services, the response lists each one with its price plus a `total` that is NOT included in the base amount. If you show cost to an end user, add both.

## See also

- OpenAPI specification: https://doc.apibrasil.io/apis/creditos/4b9bfb74-7eb1-48e0-8477-5247e344e461/openapi.json
- API catalog: [API catalog](https://doc.apibrasil.io/apis.md)
- Official SDKs: [Official SDKs](https://doc.apibrasil.io/sdks.md)
- Documentation index: https://doc.apibrasil.io/llms.txt
- HTML version of this page: https://doc.apibrasil.io/apis/creditos/4b9bfb74-7eb1-48e0-8477-5247e344e461
