Skip to content

Provide scrapers for all major Israeli banks and credit card companies

License

Notifications You must be signed in to change notification settings

erezd/israeli-bank-scrapers

 
 

Repository files navigation

Israeli Bank Scrapers - Get closer to your own data

NPM

npm version dependencies Status devDependencies Status

What's here?

What you can find here is scrapers for all major Israeli banks and credit card companies. That's the plan at least. Currently only Discount Bank, Leumi Card and Isracard are supported.

Prerequisites

To use this you will need to have Node.js >= 6 installed.

Getting started

To use these scrapers you'll need to install the package from npm:

npm install israeli-bank-scrapers --save

Then you can simply import and use it in your node module:

import { createScraper } from 'israeli-bank-scrapers';

const credentials = {...}; // different for each bank
const options = {...};
const scraper = createScraper(options);
const scrapeResult = scraper.scrape(credentials);

if (scrapeResult.success) {
  console.log(`account number: ${scrapeResult.accountNumber}`);
  console.log(`# transactions found: ${scrapeResult.txns.length}`);
}
else {
  console.error(`scraping failed for the following reason: ${scrapeResult.errorType}`);
}

The definition of the options object is as follows:

{
  companyId: string, // mandatory; one of 'discount', 'leumiCard', 'isracard'
  startDate: Date, // the date to fetch transactions from (can't be before the minimum allowed time difference for the scraper)
  verbose: boolean // include more debug info about in the output
}

The structure of the result object is as follows:

{
  success: boolean,
  accountNumber: string,
  txns: [{
    type: string, // can be either 'normal' or 'installments'
    identifier: int, // only if exists
    date: Date,
    processedDate: Date,
    amount: double,
    description: string,
    installments: {
      number: int, // the current installment number
      total: int, // the total number of installments
    }
  }],
  errorType: "invalidPassword"|"changePassword"|"timeout"|"generic", // only on success=false
  errorMessage: string, // only on success=false
}

You can also use the SCRAPERS list to get scraper metadata:

import { SCRAPERS } from 'israeli-bank-scrapers';

The return value is a list of scraper metadata:

{
  <companyId>: {
    name: string, // the name of the scraper
    loginFields: [ // a list of login field required by this scraper
      '<some field>' // the name of the field
    ]
  }
}

Specific definitions per scraper

Discount scraper

This scraper expects the following credentials object:

const credentials = {
  id: <user identification number>,
  password: <user password>,
  num: <user identificaiton code>
};

This scraper supports fetching transaction from up to one year (minus 1 day).

Leumi-Card scraper

This scraper expects the following credentials object:

const credentials = {
  username: <user name>,
  password: <user password>
};

This scraper supports fetching transaction from up to one year.

Isracard scraper

This scraper expects the following credentials object:

const credentials = {
  id: <user identification number>,
  card6Digits: <6 last digits of card>
  password: <user password>
};

This scraper supports fetching transaction from up to one year.

License

The MIT License

About

Provide scrapers for all major Israeli banks and credit card companies

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%