BBDb
Free open-source API for querying banks identification in Brazil.
About
Monetary transactions in Brazil, such as transfers and deposits, require a numeric code that identifies the financial institution that manages the destined account. This numeric code is assigned to each member of the STR (Sistema de Transferência de Reservas) by the country's central bank, Banco Central do Brasil.
BBDb is an open-source web service that provides this information up-to-date and free of charge.
Usage
At a glance, here's an example of filling a <select>
element with data from the API.
<select></select>
<script>
const select = document.querySelector("select");
fetch("https://bbdb.crz.li/?compe=y")
.then((resp) => resp.json())
.then((data) => {
data.forEach((entry) => {
const opt = document.createElement("option");
opt.value = entry.code;
opt.textContent = entry.name;
select.add(opt);
});
});
</script>
The compe
parameter exclude records with a blank code
field.
API
The public endpoint is https://bbdb.crz.li
.
GET /
- Get all the records.
GET /?q=...
- Filter the records by partial match. Normalizes special characters.
GET /?compe=y|yes|t|true|1
- Exclude records with a blank
code
field.
Development
You'll need Go 1.14.2+. Clone and download dependencies.
$ go mod download
See Makefile for build tasks.
The data is loaded from disk, and the expected format is CSV.
Reference
License
The MIT License © 2014 Arthur Corenzan