Code Monkey home page Code Monkey logo

nubank-api's Introduction

NuBank API

travis Test Coverage Code Climate

Not related to NuBank Inc.

Install

yarn add nubank
# or
npm i --save nubank

Is it ok to use this? NuBank won't block me?

As of this tweet, seems that there is no problem in using this! https://twitter.com/nubankbrasil/status/766665014161932288

Usage

First of all you need to sign in to your account using your credentials:

import createNuBank from 'nubank'
const NuBank = createNuBank()

NuBank.getLoginToken({
  password: 'i_luv_c4ts',
  login: 'YOUR_CPF', // no dashes nor dots!
}).then(response => console.log(`I'm in!`)) // just need to call this once

// After signing you can now fetch your whole feed
// since the very beginning of your relationship with NuBank <3

NuBank
  .getWholeFeed()
  .then(history => {
    // ... doing some neat personal analysis ...
    // ... jeez, too much money spent on candies and coffee ...

    // history is something like:
    [
     { description: 'Netflix Com',
       category: 'transaction',
       amount: 2290,
       time: '2016-09-06T09:22:00Z',
       title: 'serviços',
       details: [Object],
       id: '57ce8ab9-016d-4060-907d-4e5f4306483f',
       _links: [Object],
       href: 'nuapp://transaction/57ce8ab9-016d-4060-907d-4e5f4306483f'
     }, ...]
  })

API

NuBank.getCustomer

Gets your customer related information You must have called getLoginToken first.

NuBank.getCustomer().then(customer => console.log(customer))
// The customer object contains your name, address, devices
// reported income, etc.

NuBank.getCustomerAccount

Gets your credit card account information. You must have called getLoginToken first.

NuBank.getCustomerAccount().then(account => console.log(account))
// The account object contains your credit limit, current balance,
// interest rate, bill's due day, net related info, etc.

Thanks

For NuBank for having such a great API!

Notes

This API IS NOT a official API from NuBank Inc. but it does use the same REST api that their web app uses.

nubank-api's People

Contributors

arthurnobrega avatar fakenickels avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nubank-api's Issues

Is NuBank.getWholeFeed() not returning any transaction history anymore?

I wanted this api to make an app for financial tracking with BI, but it seems like it's not bringing results like this:

// history is something like:
    [
     { description: 'Netflix Com',
       category: 'transaction',
       amount: 2290,
       time: '2016-09-06T09:22:00Z',
       title: 'serviços',
       details: [Object],
       id: '57ce8ab9-016d-4060-907d-4e5f4306483f',
       _links: [Object],
       href: 'nuapp://transaction/57ce8ab9-016d-4060-907d-4e5f4306483f'
     }, ...]

as pointed out in the read.me file. Or am I doing something wrong?

Unable to resolve module 'url'

I installed the library with npm i --save nubank, and imported it on my react-native project. Other than that's my code (it runs when the app starts):

NuBank.getLoginToken({
      password: 'mypass',
      login: 'mycpf', // no dashes nor dots!
    }).then(response => console.log(`I'm in!`))

      NuBank
    .getWholeFeed()
    .then(history => {console.warn(history)});  

My app doesn't compile sucessfully, the terminal gives me this error:

error: bundling failed: Error: Unable to resolve module `url` from `node_modules/nubank/node_modules/node-fetch/index.js`: url could not be found within the project.

I tried running npm install, with no success.

How should I proceed? Thanks in advance.

Tem alguma maneira de usar sem certificado?

Oi, tudo bem? Eu tenho um app de finanças e quero que os meus clientes sincronizem as contas do nubank, mas queria saber se tem uma maneira de usar sem certificado. Pois vejo alguns apps que usam sem solicitar o certificado. Eu quero que o meu cliente coloca o usuário e senha e baixe os dados. Eu vejo que o Mobills deve usar uma dessas soluções, pois lá só coloca o usuário e senha e já pega os dados

Getting 'too many requests' error from nubank after some request/ Recebendo 'too many requests' do nubank depois de realizar algumas requisições

Hello, i was trying to test the methods and after like 5 or 6 tests, i started to receive {error: too many requests} and i can no longer acess my account. Do you know how can i pass through this?

Olá, eu estava testando os metodos da sua API, mas após alguns testes, uns 5 ou 6, começei a receber {error: too many requests} e meu acesso a conta foi bloqueado, voce sabe como eu poderia resolver isso?

New QRCode requirement

Hello!

I noticed that Nubank started asking for a QRCode on the online site to give access to the API, which made our strategy of accessing the API to break.

Can you test if it's working for you?

Do you have any idea how to work around after this change?

Api url has changed

I've been using this lib for a couple months, with everything ok.
Now I'm getting this error:

FetchError: request to https://prod-auth.nubank.com.br/api/token failed, reason: write EPROTO 140736572793792:error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate:../deps/openssl/openssl/ssl/s3_ pkt.c:1498:SSL alert number 42 140736572793792:error:1409E0E5:SSL routines:ssl3_write_bytes:ssl handshake failure:../deps/openssl/openssl/ssl/s3_pkt.c:659

I think the api URL has changed to this new url:

https://prod-s0-webapp-proxy.nubank.com.br/api/proxy/AJxL5LBUC2Tx4PB-W6VD1SEIOd2xp14EDQ.aHR0cHM6Ly9wcm9kLWdsb2JhbC1hdXRoLm51YmFuay5jb20uYnIvYXBpL3Rva2Vu

Add TS types support

Create types to allow easier use. Personally, I'm thinking about doing this one myself when I have a bit more time 😄

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.