PHPackages                             devcapere/ofxparser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. devcapere/ofxparser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

devcapere/ofxparser
===================

Simple OFX file parser

0110↓100%PHP

Since Jul 17Pushed 1y agoCompare

[ Source](https://github.com/DevCapere/ofxparser)[ Packagist](https://packagist.org/packages/devcapere/ofxparser)[ RSS](/packages/devcapere-ofxparser/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

OFX Parser
==========

[](#ofx-parser)

[![Build Status](https://camo.githubusercontent.com/c922048e6dd4d30b8f60d05d23d391b9108c1f13cc8cff489b24f01831461ac7/68747470733a2f2f7472617669732d63692e6f72672f61736772696d2f6f66787061727365722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/asgrim/ofxparser) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/b3ee211e31f8644170f7f322a3259f5836c0faa7f647c8a513fb8fa009a209c9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f61736772696d2f6f66787061727365722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/asgrim/ofxparser/?branch=master) [![Code Coverage](https://camo.githubusercontent.com/f087f41590a7bfebe73f02a00aab5897a0e35f38324d430de5e0858d31133222/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f61736772696d2f6f66787061727365722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/asgrim/ofxparser/?branch=master) [![Latest Stable Version](https://camo.githubusercontent.com/36e21d29ec8fe97837e0de18975934fe4bac437a4c9040a76faa9533752879c7/68747470733a2f2f706f7365722e707567782e6f72672f61736772696d2f6f66787061727365722f762f737461626c65)](https://packagist.org/packages/asgrim/ofxparser) [![License](https://camo.githubusercontent.com/5225ba97053b920cba5fb64005aeb1a700d5a0dfef28c98dc33a744cb8e3aee5/68747470733a2f2f706f7365722e707567782e6f72672f61736772696d2f6f66787061727365722f6c6963656e7365)](https://packagist.org/packages/asgrim/ofxparser)

OFX Parser is a PHP library designed to parse an OFX file downloaded from a financial institution into simple PHP objects.

It supports multiple Bank Accounts, the required "Sign On" response, and recognises OFX timestamps.

Installation
------------

[](#installation)

Simply require the package using [Composer](https://getcomposer.org/):

```
$ composer require asgrim/ofxparser
```

Usage
-----

[](#usage)

You can access the nodes in your OFX file as follows:

```
$ofxParser = new \OfxParser\Parser();
$ofx = $ofxParser->loadFromFile('/path/to/your/bankstatement.ofx');

$bankAccount = reset($ofx->bankAccounts);

// Get the statement start and end dates
$startDate = $bankAccount->statement->startDate;
$endDate = $bankAccount->statement->endDate;

// Get the statement transactions for the account
$transactions = $bankAccount->statement->transactions;
```

Most common nodes are support. If you come across an inaccessible node in your OFX file, please submit a pull request!

Investments Support
-------------------

[](#investments-support)

Investments look much different than bank / credit card transactions. This version supports a subset of the nodes in the OFX 2.0.3 spec, per the immediate needs of the author(s). You may want to reference the OFX documentation if you choose to implement this library. In particular, this does not currently process investment positions (INVPOSLIST) or referenced security definitions (SECINFO).

This is not a pure pass-through of fields, such as this implementation in python: [csingley/ofxtools](https://github.com/csingley/ofxtools). This package contains fields that have been "translated" on occasion to make it more friendly to those less-familiar with the investments OFX spec.

To load investments from a Quicken (QFX) file or a MS Money (OFX / XML) file:

```
// You'll probably want to alias the namespace:
use OfxParser\Entities\Investment as InvEntities;

// Load the OFX file
$ofxParser = new \OfxParser\Parsers\Investment();
$ofx = $ofxParser->loadFromFile('/path/to/your/investments_file.ofx');

// Loop over investment accounts (named bankAccounts from base lib)
foreach ($ofx->bankAccounts as $accountData) {
    // Loop over transactions
    foreach ($accountData->statement->transactions as $ofxEntity) {
        // Keep in mind... not all properties are inherited for all transaction types...

        // Maybe you'll want to do something based on the transaction properties:
        $nodeName = $ofxEntity->nodeName;
        if ($nodeName == 'BUYSTOCK') {
            // @see OfxParser\Entities\Investment\Transaction...

            $amount = abs($ofxEntity->total);
            $cusip = $ofxEntity->securityId;

            // ...
        }

        // Maybe you'll want to do something based on the entity:
        if ($ofxEntity instanceof InvEntities\Transaction\BuyStock) {
            // ...
        }

    }
}
```

Fork &amp; Credits
------------------

[](#fork--credits)

This is a fork of [grimfor/ofxparser](https://github.com/Grimfor/ofxparser) made to be framework independent. The source repo was designed for Symfony 2 framework, so credit should be given where credit due! Heavily refactored by [Oliver Lowe](https://github.com/loweoj) and loosely based on the ruby [ofx-parser by Andrew A. Smith](https://github.com/aasmith/ofx-parser).

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 Bus Factor1

Top contributor holds 55.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/30b54fce2c4786a0c474410ae0ecad48f8b094446ed9db729aafd3c4efd91ae1?d=identicon)[devcapere](/maintainers/devcapere)

---

Top Contributors

[![asgrim](https://avatars.githubusercontent.com/u/496145?v=4)](https://github.com/asgrim "asgrim (72 commits)")[![loweoj](https://avatars.githubusercontent.com/u/915917?v=4)](https://github.com/loweoj "loweoj (12 commits)")[![ambroisemaupate](https://avatars.githubusercontent.com/u/380026?v=4)](https://github.com/ambroisemaupate "ambroisemaupate (8 commits)")[![moleculezz](https://avatars.githubusercontent.com/u/118499?v=4)](https://github.com/moleculezz "moleculezz (7 commits)")[![nicolasrabier](https://avatars.githubusercontent.com/u/2274443?v=4)](https://github.com/nicolasrabier "nicolasrabier (4 commits)")[![diegoricardo](https://avatars.githubusercontent.com/u/2482691?v=4)](https://github.com/diegoricardo "diegoricardo (4 commits)")[![hucharal](https://avatars.githubusercontent.com/u/6876338?v=4)](https://github.com/hucharal "hucharal (4 commits)")[![gitmathias](https://avatars.githubusercontent.com/u/365221?v=4)](https://github.com/gitmathias "gitmathias (4 commits)")[![AlexJoseGaspar](https://avatars.githubusercontent.com/u/174710396?v=4)](https://github.com/AlexJoseGaspar "AlexJoseGaspar (3 commits)")[![gwennael-jean](https://avatars.githubusercontent.com/u/4457236?v=4)](https://github.com/gwennael-jean "gwennael-jean (2 commits)")[![renatomb](https://avatars.githubusercontent.com/u/30217311?v=4)](https://github.com/renatomb "renatomb (2 commits)")[![fernando-nery](https://avatars.githubusercontent.com/u/15134576?v=4)](https://github.com/fernando-nery "fernando-nery (2 commits)")[![oceanapplications](https://avatars.githubusercontent.com/u/2704923?v=4)](https://github.com/oceanapplications "oceanapplications (1 commits)")[![jacques](https://avatars.githubusercontent.com/u/2543?v=4)](https://github.com/jacques "jacques (1 commits)")[![valorin](https://avatars.githubusercontent.com/u/897369?v=4)](https://github.com/valorin "valorin (1 commits)")[![jpswade](https://avatars.githubusercontent.com/u/1087963?v=4)](https://github.com/jpswade "jpswade (1 commits)")[![gammamatrix](https://avatars.githubusercontent.com/u/524724?v=4)](https://github.com/gammamatrix "gammamatrix (1 commits)")

### Embed Badge

![Health badge](/badges/devcapere-ofxparser/health.svg)

```
[![Health](https://phpackages.com/badges/devcapere-ofxparser/health.svg)](https://phpackages.com/packages/devcapere-ofxparser)
```

###  Alternatives

[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k89.3M627](/packages/jms-serializer-bundle)[hassankhan/config

Lightweight configuration file loader that supports PHP, INI, XML, JSON, and YAML files

97513.5M170](/packages/hassankhan-config)[meyfa/php-svg

Read, edit, write, and render SVG files with PHP

54613.9M42](/packages/meyfa-php-svg)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
