CAMBIO

Cotação de câmbio

Cotação PTAX de moeda estrangeira frente ao Real, por data, direto do Banco Central.

Exchange rates

PTAX foreign currency rate against the Real, by date, straight from the Central Bank.

SYNC resposta na mesma chamada answers in the same call

Endpoints

Endpoints

GET /api/v1/cambio/moedas lista as moedas disponíveis lists the available currencies
GET /api/v1/cambio/{moeda}/{data} cotação de uma moeda numa data a currency's rate on a given date

Parâmetros

Parameters

NomeNameOndeInDescriçãoDescription
moeda path sigla ISO 4217 (ex.: USD, EUR), lista completa em /cambio/moedas ISO 4217 sigla (e.g. USD, EUR), full list at /cambio/moedas
data path formato YYYY-MM-DD YYYY-MM-DD format

Exemplo

Example

curl https://api.alicercelabs.com.br/api/v1/cambio/USD/2026-08-25 \
          -H "Authorization: Bearer <token>"
{
          "success": true,
          "data": {
            "moeda": "USD",
            "data": "2026-08-25",
            "cotacoes": [
              { "paridade_compra": 1, "paridade_venda": 1, "cotacao_compra": 5.148, "cotacao_venda": 5.149,
                "data_hora_cotacao": "2026-08-25 13:04:44.743388", "tipo_boletim": "Fechamento PTAX" }
            ]
          },
          "meta": { "elapsed_ms": 210, "request_id": "..." }
        }

O array cotacoes tem um item por boletim do dia (abertura, intermediários, fechamento PTAX), cortado aqui pra caber no exemplo.

The cotacoes array has one item per bulletin of the day (opening, intermediates, PTAX closing), trimmed here just to fit the example.

Erros possíveis

Possible errors

StatusMotivoReason
400data fora do formato YYYY-MM-DDdate isn't in YYYY-MM-DD format
401token ausente ou inválidomissing or invalid token
404nenhuma cotação nos últimos 10 dias retrocedendo a partir da data pedidano rate found in the 10 days walking back from the requested date
429limite de taxa excedidorate limit exceeded
503dado indisponível no momentodata temporarily unavailable

Usando o SDK

Using the SDK

SDKs oficiais: Go · Python · JavaScript.

Official SDKs: Go · Python · JavaScript.

Buscar a cotação de uma moeda

Look up a currency's rate

import (
	"context"
	"fmt"

	alicercelabs "github.com/alicercelabs/alicercesdk-go"
)

client := alicercelabs.New("alk_...")
ctx := context.Background()

cotacao, err := client.Cambio.Get(ctx, "USD", "2026-08-25")
if err != nil {
	panic(err)
}
fmt.Println(cotacao.Cotacoes[0].CotacaoVenda)
from alicercelabs import AlicerceLabs

client = AlicerceLabs(api_key="alk_...")

cotacao = client.cambio.get("USD", "2026-08-25")
print(cotacao["cotacoes"][0]["cotacao_venda"])
import { AlicerceLabs } from "alicercesdk-javascript";

const client = new AlicerceLabs("alk_...");

const cotacao = await client.cambio.get("USD", "2026-08-25");
console.log(cotacao.cotacoes[0].cotacao_venda);

Limites

Limits

100/dia · 4/hora sem token, por IP chamador; com uma API key (gerada no painel), 1.000/dia · 41/hora. Resposta em cache por 24h.

100/day · 4/hour without a token, per calling IP; with an API key (generated in the panel), 1,000/day · 41/hour. Response cached for 24h.