Brasilapi (BrasilAPI v0.1.5)

View Source

A simple Elixir client for BrasilAPI.

BrasilAPI is a public API that provides access to various Brazilian data such as postal codes, states, cities, banks, and more.

Examples

# Get all banks
{:ok, banks} = Brasilapi.get_all_banks()

# Get a specific bank by code
{:ok, bank} = Brasilapi.get_bank_by_code(1)

# Get CEP information
{:ok, cep_data} = Brasilapi.get_cep("89010025")

# Get CNPJ information
{:ok, company} = Brasilapi.get_cnpj("19131243000197")

# Get DDD information
{:ok, ddd_info} = Brasilapi.get_ddd(11)

# Get national holidays
{:ok, holidays} = Brasilapi.get_holidays(2021)

# Get all tax rates
{:ok, rates} = Brasilapi.get_all_rates()

# Get a specific tax rate
{:ok, rate} = Brasilapi.get_rate_by_acronym("CDI")

# Get PIX participants
{:ok, participants} = Brasilapi.get_pix_participants()

# Get domain information
{:ok, domain} = Brasilapi.get_domain_info("brasilapi.com.br")

# Get all currencies
{:ok, currencies} = Brasilapi.get_currencies()

# Get exchange rate
{:ok, exchange_rate} = Brasilapi.get_exchange_rate("USD", "2025-02-13")

# Get all brokerage firms
{:ok, brokers} = Brasilapi.get_brokers()

# Get specific brokerage firm by CNPJ
{:ok, broker} = Brasilapi.get_broker_by_cnpj("02332886000104")

# Get book information by ISBN
{:ok, book} = Brasilapi.get_book("9788545702870")

Summary

Functions

Get all banks from BrasilAPI.

Get all available tax rates and indices.

Get a specific bank by its code.

Get book information by ISBN from multiple providers.

Get a specific brokerage firm by its CNPJ from CVM records.

Get all active brokerage firms registered with CVM.

Get CEP (postal code) information using the v2 endpoint.

Get company information by CNPJ.

Get all available currencies for exchange rate queries.

Get DDD (area code) information including state and cities.

Get Brazilian domain (.br) registration information.

Get the exchange rate between Real and another currency for a specific date.

Get national holidays for a specific year.

Get all PIX participants.

Get a specific tax rate or index by its name/acronym.

Functions

get_all_banks()

Get all banks from BrasilAPI.

get_all_rates()

Get all available tax rates and indices.

get_bank_by_code(code)

Get a specific bank by its code.

get_book(isbn, opts \\ [])

Get book information by ISBN from multiple providers.

get_broker_by_cnpj(cnpj)

Get a specific brokerage firm by its CNPJ from CVM records.

get_brokers()

Get all active brokerage firms registered with CVM.

get_cep(cep)

Get CEP (postal code) information using the v2 endpoint.

get_cnpj(cnpj)

Get company information by CNPJ.

get_currencies()

Get all available currencies for exchange rate queries.

get_ddd(ddd)

Get DDD (area code) information including state and cities.

get_domain_info(domain)

Get Brazilian domain (.br) registration information.

get_exchange_rate(currency, date)

Get the exchange rate between Real and another currency for a specific date.

get_holidays(year)

Get national holidays for a specific year.

get_pix_participants()

Get all PIX participants.

get_rate_by_acronym(acronym)

Get a specific tax rate or index by its name/acronym.