npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bb-api

v2.3.4

Published

Unofficial node.js implementation of Banco do Brasil's mobile API

Downloads

24

Readme

bb-api GitHub license npm version Build Status

Unofficial node.js implementation of Banco do Brasil's mobile API

Installation

yarn add bb-api
# or
npm install bb-api --save

API Usage

Checking Account (Conta Corrente)

import BB from 'bb-api';

const bb = new BB();
await bb.login({ branch: 'XXXXX', account: 'XXXXXXX', password: 'XXXXXXXX' });

// Recover balance
const checkingBalance = await bb.checking.getBalance();

// Recover transactions in month
const checkingTransactions = await bb.checking.getTransactions({
  year: 2018,
  month: 11,
});

Savings Account (Poupança)

import BB from 'bb-api';

const bb = new BB();
await bb.login({ branch: 'xxxxxx', account: 'xxxxxxx', password: 'xxxxxxxx' });

// Recover savings accounts available (variações, ex: 1, 51, etc)
const savingsAccounts = await bb.savings.getAccounts();

// Recover transactions from savings account in month
const savingsTransactions = await savingsAccounts[0].getTransactions({
  year: 2018,
  month: 11,
});

Credit Card (Cartão de Crédito)

import BB from 'bb-api';

const bb = new BB();
await bb.login({ branch: 'xxxxxx', account: 'xxxxxxx', password: 'xxxxxxxx' });

// Recover list of available credit cards
const creditCards = await bb.creditCard.getCards();

// Recover bills of a credit card (faturas)
const creditCardBills = await creditCards[0].getBills();

// Recover transactions from specific bill
const creditCardTransactions = await creditCardBills[0].getTransactions();

Command line

Clone the repository and follow the steps bellow:

To use it via command line just execute the command below, replacing XXXXXs by your credentials:

$ yarn babel-node src/index.js --bbBranch="XXXXX" --bbAccount="XXXXXXX" --bbPassword="XXXXXXXX"

and it will print in console the last data of your account:

{
  checkingBalance: 273.48,
  checkingTransactions: [
    {
      date: 2018-11-05T02:00:00.000Z,
      description: 'Transferido da poupança',
      amount: 840.18
    },
    {
      date: 2018-11-05T02:00:00.000Z,
      description: 'Compra com Cartão',
      amount: -10.19
    },
    {
      date: 2018-11-05T02:00:00.000Z,
      description: 'Transferência enviada 04/11 JOÃO',
      amount: -159.18
    },
    ...
  ]
}

{
  savingsAccounts: [
    {
      variation: 1,
      description: 'Poupança Ouro - Variação 1'
    },
    {
      variation: 51,
      description: 'Poupança Ouro - Variação 51'
    },
    ...
  ],
  savingsTransactions: [
    {
      date: 2018-11-16T02:00:00.000Z,
      description: 'Juros',
      amount: 0.02
    },
    {
      date: 2018-11-30T02:00:00.000Z,
      description: 'Transferencia Para Conta',
      amount: -3.92
    },
    ...
  ]
}

{
  creditCards: [
    {
      brand: 'VISA',
      modality: '74',
      cardAccountNumber: '12345678',
      cardNumber: '0000123456781111'
    },
    {
      brand: 'VISA',
      modality: '1',
      cardAccountNumber: '12345679',
      cardNumber: '0000123456781112'
    },
    ...
  ],
  creditCardBills: [
    {
      cardAccountNumber: '12345678',
      billId: '123123123',
      billDate: '25112018'
    },
    {
      cardAccountNumber: '12345678',
      billId: '123123124',
      billDate: '25102018'
    },
    ...
  ],
  creditCardTransactions: [
    {
      type: 'payment',
      date: 2018-10-22T03:00:00.000Z,
      description: 'PGTO. CASH AG. 1111 000123456 100',
      amount: 1000.12
    },
    {
      type: 'atSight',
      date: 2018-10-10T03:00:00.000Z,
      description: 'RESTAURANTE X',
      amount: -27
    },
    ...
  ],
}

Contributing

  1. Fork it (https://github.com/arthurnobrega/bb-api/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request