TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/jbms/finance-dl/llms.txt
Use this file to discover all available pages before exploring further.
finance_dl.ofx scraper connects directly to financial institutions that support the OFX protocol using the ofxclient Python package — no browser or Selenium required. It downloads transaction and balance data for every account accessible under your credentials, automatically fills historical gaps using repeated requests, and always fetches up to the present date. This page covers all configuration parameters, the output file naming scheme, smart download behavior, how to find OFX connection details for your institution, and how to use the interactive shell.
Configuration Parameters
A dictionary containing all connection details for your financial institution. All fields come from ofxhome.com.
Path on the local filesystem where OFX files will be written. The directory (and any account sub-directories) will be created automatically if they do not exist.
An optional mapping of account numbers (as they appear in the OFX output) to human-readable directory names. When provided, the mapped name is used exactly as the sub-directory name — if it is not a valid directory name, finance-dl will fail. Unmapped accounts use their account number directly.
Number of days of overlap when issuing follow-up requests to fill gaps in downloaded data. Overlapping ranges make it less likely that a transaction is missed; duplicates can be filtered during processing. The default of
2 is suitable in almost all cases.The earliest date from which to attempt data retrieval when no files have been downloaded yet. A binary search is performed starting from this date to find the oldest point at which the server returns a valid response. The default covers essentially all modern financial history.
The minimum number of days the server is expected to return per request. If the most recent downloaded range starts no more than this many days before today, no additional request is issued. The default of
20 is appropriate because most OFX servers support at least 30 days per request.Output Format
Each account’s data is stored in its own sub-directory ofoutput_directory. The sub-directory name is the account number, or the mapped name from acct_dir_map if one is provided.
Within each account sub-directory, files are named using the pattern:
<start-date>and<end-date>reflect theDTSTARTandDTENDfields in the OFX file, formatted asYYYYMMDD.<fetch-timestamp>is the Unix epoch time in seconds at the moment of download.
19991201-20000115--1705000000.ofx
Smart Download Behavior
Because many institutions cap the number of days returnable in a single OFX request,finance_dl.ofx issues multiple requests automatically:
- First run — binary search: When no files exist for an account, a binary search is performed from
min_start_datetoward today to find the earliest date the server will honor. Once found, that batch is saved and subsequent requests fill forward. - Gap filling: On every run, the scraper scans existing files for date-range gaps and issues requests to fill them, using
overlap_daysof backwards overlap. - Present-day fetch: At least one request reaching up to today’s date is always issued, so the most recent transactions are always retrieved.
Finding Your Institution’s OFX Parameters
Visit ofxhome.com and search for your financial institution by name. The listing shows theFI Id, FI Org, and FI Url values to use in ofx_params. Not all institutions support OFX direct connect — if your institution is not listed, or the connection fails, use the institution’s dedicated Selenium scraper instead.
Discover Card users: Discover enforces a minimum 5-second delay between OFX requests. The
finance_dl.ofx module detects Discover automatically (by checking org for the string "Discover") and adds the required delay. No extra configuration is needed.Config Example
Chase / Advanced client_args Example
Chase and some other institutions require OFX version 103 and a unique client ID. Generate the ID once with openssl rand -hex 16 and reuse it on every run:
Interactive Shell
From the finance-dl interactive shell, theinteractive context manager yields the following variables:
| Variable | Description |
|---|---|
ofx_params | The ofx_params dict passed in from the config. |
output_directory | The output_directory string passed in from the config. |
inst | A connected ofxclient.institution.Institution object, already authenticated. |
inst to explore accounts or trigger downloads manually: