New web-banking -> OFX gateway (; how to create importer?

David Barrett dbarrett at
Mon Dec 10 04:44:33 EST 2007

Hello, I'm working on a web-banking to OFX gateway, and I'm curious if
anybody can offer some tips for how to best integrate this into GnuCash?

As background, I didn't like how many banks either charge you extra to
download OFX data, or simply don't offer it all.  So I built a gateway to
scrape banking websites for transactions and return them as OFX files.

Currently I support US Bank and Wells Fargo, but I'm adding more as
requested -- you can check out the progress at

Regardless, I'd like to integrate this into GnuCash so you can simply import
your account data directly.  The goal is to make something similar to a
stripped-down version of the "OFX-DirectConnect" backend, except just for
transaction importing, streamlined with way fewer options, and working with
any bank -- regardless of whether it supports OFX connections.

As it stands, I'm at a loss to understand the current online banking
functions and where to tie in.  I'm starting to dig through the code, but
it's rather daunting and I'd welcome any pointers you can offer.

1) Should I add this under "File :: Import" or "Tools :: Online Banking
Setup"?  (I'm thinking "Files :: Import" because it not only looks easier,
but I'm really just building an "import" function -- it doesn't attempt to
simulate a true bidirectional OFX connection.)

2) Is /src/import-export/ofx a good importer on which to base my code, or is
there some easier/cleaner place to start?  (Ideally, an importer that
already pulls data down from an HTTP connection?)

3) Where is a good example showing some GnuCash networking code that I can
study?  (I'm very familiar with C/C++ network programming, but half the
challenge is just getting the first line to compile; I'd like to see some
working code to get started.)

4) Can you summarize for me at a high level the best way to get started
writing a network-based OFX importer?  I really envision the following
functions; any examples that already do each that I can study?
	- Add an entry to "File :: Import"
	- Open a dialog asking for a Bank domain name, username, and
	- Open an HTTP connection to the back end
	- Hand the results to the OFX importer and let it take over

Thanks, I welcome your advice and feedback!


PS: Feel free to visit to see it in action; use the bank
"" in order to get a feel for how it'd work, or type in your US Bank
or Wells Fargo login credentials to see it live in action.  (Please excuse
the certificate warnings; still getting that sorted out.)

PPS: I'm reading through the documentation on the website, and the "QIF
importer infrastructure" looks promising; is there anything else I should be

More information about the gnucash-devel mailing list