Tom Reznick bio photo

Tom Reznick

Jack of all trades, master of the universe

Email Twitter LinkedIn Github

Find a Credit Union With the NCUA Gem

The NCUA uses asynchronous JSON requests to find a Credit Union. We make a Gem for that.

At Continuity, we write software that helps banks and credit unions complete their federal compliance work. There are quite a few regulators that pertain to banks and credit unions, but perhaps none more significant than the Federal Deposit Insurance Corporation (FDIC) and the National Credit Union Administration (NCUA).

About a month ago, we made a gem wrapping the FDIC’s unpublished JSON API.

When we first built this gem, we had hoped that the NCUA would move some of their Credit Union search tools to use JSON asynchronously like the FDIC has. That day as come, and so we’ve made another gem that wraps the NCUA’s find a credit union tool.

New JSON API? We can gem that!1

This is great for us, because it lets us validate client data against regulatory records, and gives us programmatic access to a vast source of public government data.

Here’s the source.

The Gem’s README provides a good measure of the documentation for its use, but I’ll repeat some here to explain some of the design decisions.

The NCUA API lets you search for a Credit Union office by name, charter_number, and address.

1 credit_unions = NCUA.find_office_by_name('Federal')
2 #=> [NCUA::CreditUnion::Office, ...]
3 credit_unions = NCUA.find_office_by_charter_number(12345)
4 #=> [NCUA::CreditUnion::Office, ...]
5 # Note: searching by address takes an optional radius parameter that defines in miles
6 # the radius of your address query. When omitted, it queries 100 miles by default.
7 credit_unions = NCUA.find_office_by_address('59 Elm St. New Haven, CT', radius: 50)
8 #=> [NCUA::CreditUnion::Office, ...]

Note that the query methods return NCUA::CreditUnion::Office objects. The NCUA’s Credit Union Locator searches for credit union offices, which may be specific branches of a Credit Union.

Therefore, you can expect the charter_number query to return all of the office locations for a particular credit union.

From any NCUA::CreditUnion::Office you can get details of the Credit Union in question:

1 credit_unions = NCUA.find_office_by_charter_number(12345)
2 #=> [NCUA::CreditUnion::Office, ...]
3 credit_unions.first.details
4 #=> NCUA::CreditUnion::Details

You can also query this directly from the NCUA module:

1 NCUA.find_credit_union(charter_number)
2 #=> NCUA::CreditUnion::Details

We scrape the data from this page, so there’s a good chance that this might blow up. If so, let us know!

We’re working on making this gem better. It needs some good error handling and some way of letting us know when the NCUA’s markup changes so we can scrape differently. There’s also the option to scrape more data from the NCUA, specifically some of their Financial Performance Reports, but this may not be a direction we want to move towards.

But for now, that’s all.

Also first post! w00t!
PRs welcome
:x (because vimgolf)

  1. No relation to python ¯\_(ツ)_/¯