PHPackages                             pxfzhkryfa/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. pxfzhkryfa/ofxparser

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

pxfzhkryfa/ofxparser
====================

Simple OFX file parser

1.2.2(7y ago)08MITPHPPHP ~5.6|~7.0

Since Jul 23Pushed 4y agoCompare

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

READMEChangelogDependencies (2)Versions (10)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

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 55% 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.

###  Release Activity

Cadence

Every ~194 days

Recently: every ~323 days

Total

9

Last Release

2752d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.4

1.2.0PHP ~5.6|~7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/d40ec321107a36ab0bcfb6d64f2767dd602e67b242f298da232775e1a22286f0?d=identicon)[PXfzHKrYFa](/maintainers/PXfzHKrYFa)

---

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)")[![PXfzHKrYFa](https://avatars.githubusercontent.com/u/7343825?v=4)](https://github.com/PXfzHKrYFa "PXfzHKrYFa (5 commits)")[![nicolasrabier](https://avatars.githubusercontent.com/u/2274443?v=4)](https://github.com/nicolasrabier "nicolasrabier (4 commits)")[![gitmathias](https://avatars.githubusercontent.com/u/365221?v=4)](https://github.com/gitmathias "gitmathias (4 commits)")[![hucharal](https://avatars.githubusercontent.com/u/6876338?v=4)](https://github.com/hucharal "hucharal (4 commits)")[![diegoricardo](https://avatars.githubusercontent.com/u/2482691?v=4)](https://github.com/diegoricardo "diegoricardo (4 commits)")[![fernando-nery](https://avatars.githubusercontent.com/u/15134576?v=4)](https://github.com/fernando-nery "fernando-nery (2 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)")[![valorin](https://avatars.githubusercontent.com/u/897369?v=4)](https://github.com/valorin "valorin (1 commits)")[![gammamatrix](https://avatars.githubusercontent.com/u/524724?v=4)](https://github.com/gammamatrix "gammamatrix (1 commits)")[![jacques](https://avatars.githubusercontent.com/u/2543?v=4)](https://github.com/jacques "jacques (1 commits)")[![jpswade](https://avatars.githubusercontent.com/u/1087963?v=4)](https://github.com/jpswade "jpswade (1 commits)")[![oceanapplications](https://avatars.githubusercontent.com/u/2704923?v=4)](https://github.com/oceanapplications "oceanapplications (1 commits)")

---

Tags

parserfinanceofxopen financial exchange

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[nikic/php-parser

A PHP parser written in PHP

17.4k902.6M1.8k](/packages/nikic-php-parser)[doctrine/lexer

PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.

11.2k910.8M118](/packages/doctrine-lexer)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[matomo/device-detector

The Universal Device Detection library, that parses User Agents and detects devices (desktop, tablet, mobile, tv, cars, console, etc.), clients (browsers, media players, mobile apps, feed readers, libraries, etc), operating systems, devices, brands and models.

3.5k23.5M111](/packages/matomo-device-detector)

PHPackages © 2026

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