42

Do any banks offer data feeds of personal accounts via any form of API? I'm essentially looking to check balances on accounts without logging into their website.

I remember reading about a universal banking protocol at some point... and maybe mint.com uses it to access accounts? Does mint.com have a special relationship with each bank, or can I leverage their method?

Edit: For my requirements, I'm only interested in accessing my own financial data.

ack
  • 14,285
  • 22
  • 55
  • 73

8 Answers8

29

Look up the Open Financial Exchange (OFX) format on the web. That (I believe) is a generic format for the banking industry.

Chad Bingham
  • 32,650
  • 19
  • 86
  • 115
user279521
  • 4,779
  • 21
  • 78
  • 109
22

API access

You will need to check with each institution if they provide an API for direct access. Some will provide access over a dial-up line, others have more modern IP based service. Each will likely require you to register and pay a fee.

Easier is to require the user to download their statement from the bank and import it into your application. Most online banking systems provide this functionality.

Formats

Either way, there are several formats supported by banks (taken from here).

  • OFX (Open Financial Exchange)
  • QIF (Quicken Interchange Format)
  • CSV (Comma-Separated Value)

You might see OFX referred to as Quickbooks, Microsoft Money 2005 or Sage Line 50. QIF is sometimes called Quicken 98 or 2000, or Microsoft Money 2003.

CSV formats will be proprietary per institution and require parsing logic developed for each instance.

Who uses what format

The UK banks that support OFX or QIF formats are:

  • Abbey (QIF, but not Abbey Business)
  • Alliance and Leicester (OFX and QIF)
  • Barclays (OFX)
  • Clydesdale (QIF)
  • Coutts & Co (OFX and QIF)
  • First Direct (QIF)
  • Halifax (OFX and QIF)
  • HSBC (OFX)
  • Lloyds (QIF)
  • NatWest(OFX)
  • Nationwide (OFX)
  • Royal Bank of Scotland (OFX and QIF)
  • Tesco (OFX and QIF)
  • Yorkshire (QIF)
Polsonby
  • 22,825
  • 19
  • 59
  • 74
badbod99
  • 7,429
  • 2
  • 32
  • 31
  • 1
    You can find the urls for accessing your ofx files for various banks at...https://ofx-cqat-filist.intuit.com/qbm1800/data/fidir.txt and http://wiki.gnucash.org/wiki/OFX_Direct_Connect_Bank_Settings. You have to send a specially formatted request. There's a python utility at http://microsoftmoneyoffline.wordpress.com/2010/02/06/discover-downloads-work-now/ called ofx-ba.py which shows you how to format the request. – Rehan Sep 29 '11 at 22:21
14

It is possible to write a basic screen scraper to pull account transactions from your Mint.com account. Of course, this means you'll have to have an account set up there and let them to the dirty work for you.

CasperJS is a great tool that makes this fairly trivial, you will need to install both Casper and PhantomJS, the framework it is built on.

var casper = require('casper').create();

casper.start('https://wwws.mint.com/login.event', function() {
    this.fill('form#form-login', {
        username: 'mintusername',
        password: 'mintpassword'
    }, true);
}).then(function() {
    this.echo('Downloading transaction history...')
    this.download('https://wwws.mint.com/transactionDownload.event', '/path/to/save/transactions.csv');
});

casper.run(function() {
    this.echo('Done.').exit();
});

This script logs into your Mint account, and downloads your transaction history (as a CSV file) to wherever you specify. From there, you can do what you like with the data. Of course, this script could be expanded significantly to do more advanced things, or to filter the transactions it pulls down, but as a matter of best practice I would advise keeping the screen scraping as simple as possible and add the logic on your program's end.

You can have this script run periodically using launchd for Mac OS X or cron for most Linux flavors.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Cecchi
  • 1,525
  • 9
  • 9
  • 1
    For a question specifically asking about personal finance this is probably the best solution. Actually, I'm going to do this myself. +1 for showing me CasperJS – kipple Jul 31 '13 at 06:28
  • 1
    Use https://wwws.mint.com/transactionDownload.event?startDate=07/01/2013&endDate=06/01/2013 to filter by date. I'm sure there are other parameters as well – kipple Jul 31 '13 at 07:41
  • Do you know there any solutions like this that can run on mobile devices? (webview or phantomjs driven by something like casper or watir). I've googled and pretty sure there isn't but just wanted to ask. – Danyal Aytekin Feb 25 '14 at 20:10
  • 2
    Yuk. Screen scraping. Screen scraping a product which already uses screen scraping! – geedubb Jan 13 '15 at 16:38
  • 1
    @geedubb, agreed. It's not pretty, but there's a reason they use screen scraping, and I'd rather scrape one source than potentially dozens! – Cecchi Jan 14 '15 at 21:13
4

Intuit are lauching new data services with access to over 18000 financial institutions via secure apis. I am not privy as to whether they will include UK banksand financial institutions, but here is the link:

https://developer.intuit.com/page/CustomerAccountData

iDev247
  • 1,761
  • 3
  • 16
  • 36
nepaluz
  • 109
  • 2
  • 1
  • 2
    link is 404'd. never trust anything that comes out of intuit's mouth. their financial mgmt softwares are inherently and inextricably linked to the desktop era. they've acquired mint.com and stalled/grounded the entire thing. they are as evil as microsoft, prism, or hitler. – grgry Jul 15 '13 at 03:52
  • 2
    Note from the site: *Monthly Minimum Recurring Fee: $1,000.00* – iDev247 Jan 07 '14 at 03:29
0

In Europe, you could use www.agregadorfinanciero.com API.

0

You could try Swift (see message types), its not the kind of thing you can just set up though, you'd have to speak to each institution you wanted to work with.

Jon Freedman
  • 9,469
  • 4
  • 39
  • 58
  • 1
    Swift is a bit more serious, it requires membership to Swift (which is expensive), a serious amount of security red-tape and more! – badbod99 Aug 12 '10 at 16:14
  • I think its the only option if you want to get the account balance for an account which doesn't belong to you - after all thats not exactly the sort of data you want to open up to all and sundry – Jon Freedman Aug 12 '10 at 16:22
0

There is a standard protocol known as OFX (ofx.net) that might meet your needs. Microsoft Money and Quicken both use it to update data.

Russ
  • 4,091
  • 21
  • 32
0

For those not overtly concerned about paying a fiver for an OFX converter, designed to handle Nationwide FlexAccount, e-Savings and Creditcards try the Nationwide OFX Converter.

For other banks and creditcards try iCreateOFX Basic and for Investment files try iCreateOFX Investment.

Nepaluz
  • 669
  • 1
  • 12
  • 27
nepaluz
  • 21
  • 3