Technical writing

Following a Nonprofit Through Federal Data: Status, Finances, and the Money In

· 8 min read· AI Analytics
IRSNonprofitsUSAspendingOpen DataData Engineering

A US nonprofit is one of the most transparent entities in the economy, by law — and yet its full federal footprint sits in pieces. One file says it is tax-exempt. Another, its own annual return, lays out its revenue, its executives' pay, and the grants it hands out. A third shows the federal money flowing the other way, into its accounts. Each is public; together they are a complete financial portrait. This is how to assemble it.

The datasets

  • IRS exempt organizations — the status layer: is the entity tax-exempt, under which subsection (501(c)(3), (c)(4)…), and since when.
  • IRS Form 990 — the books: revenue, expenses, executive compensation, and the Schedule I grants the organization itself makes.
  • USAspending awards and subawards, plus grants.gov — the federal money flowing to the organization, directly or passed through a prime recipient.

The key: the EIN

The Employer Identification Number is the nonprofit world's universal join key. The IRS files are built on it, and USAspending recipient records carry it (alongside the newer UEI). Join on the EIN and a charity's tax status, its own 990 books, and the federal awards it has received resolve to one entity. Where an EIN is masked — the IRS redacts them for some individual filers, and USAspending masks recipients on certain assistance records — a normalized name plus the UEI is the fallback, with the usual caveats about name drift.

# The universal nonprofit key is the EIN (Employer Identification Number).
# IRS files and USAspending recipient records both carry it; join on EIN, fall
# back to normalized name + UEI where an EIN is masked or missing.

import requests, csv, io

# 1. IRS exempt organizations: is it tax-exempt, under which subsection, since when?
#    (IRS Exempt Organizations Business Master File / Pub 78 data — bulk CSV.)

# 2. IRS Form 990: the org's own books — revenue, expenses, exec comp, and
#    Schedule I grants it MAKES to others. (Form 990 e-file XML / index.)

# 3. USAspending: the federal money flowing TO it — grants, contracts, subawards.
def usaspending_for_ein(ein):
    return requests.post(
        "https://api.usaspending.gov/api/v2/search/spending_by_award/",
        json={"filters": {"recipient_search_text": [ein],
                          "award_type_codes": ["02", "03", "04", "05"]},  # grants/assistance
              "fields": ["Award ID", "Recipient Name", "Award Amount"]},
        timeout=30,
    ).json()

# Money OUT (990 Schedule I) and money IN (USAspending) are different directions:
# the 990 shows what a foundation grants; USAspending shows what a charity receives.

Money in, money out — don't conflate them

The most common mistake in nonprofit data is mixing directions. A private foundation's 990 Schedule I shows the grants it makes — money out. USAspending shows federal awards a charity receives — money in. The same organization can appear as both a grantor (on its own 990) and a grantee (on USAspending), and a clean pipeline keeps the two flows distinct. Layer in subawards and you can also see money that reaches a nonprofit indirectly, as a subrecipient under another organization's prime federal award — a flow the prime's record alone would hide.

The gotchas

  • 990 filing lag and form type. Returns post a year or more late, and 990-EZ and 990-PF carry different fields than the full 990 — a panel has to handle all three.
  • EIN masking. Some IRS records redact the EIN for privacy; those rows only join by name + UEI.
  • Fiscal-year misalignment. A nonprofit's 990 fiscal year rarely matches the federal fiscal year of its awards; align on periods, not calendar years.
  • Name drift and DBAs. The legal name on the 990, the recipient name on USAspending, and the public “doing business as” name often differ — the recurring entity-resolution tax.

Related writing: Following the Money — the broader synthesis on tracing any entity through federal spending, contracts, and ownership records, of which the nonprofit EIN join is one clean case.

See also: IRS Form 990 — the dataset behind the finances-and-governance stage of this pipeline.