bbdb

command module
v0.0.0-...-a5f5bcd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2020 License: MIT Imports: 17 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL