# Nonprofit lookup (IRS)

> POST /nonprofit reads an EIN in the IRS exempt organization files: name, location, 501(c) subsection, deductibility, ruling date, NTEE code, finances and revocation.

`POST https://api.qelka.com/v1/nonprofit`

Check whether an Employer Identification Number (EIN) belongs to a US tax-exempt organization: you get its name and location, the section of the Internal Revenue Code it is exempt under, such as 501(c)(3), whether donations to it are deductible, its ruling date, its activity code, its latest assets, income and revenue, and whether the IRS revoked its exemption. Each lookup costs 1 credit, found or not; errors and test keys are never billed.

## Request

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `ein` | string | Yes | none | The EIN, 9 digits, with or without the dash, sent as 1 to 20 characters. Spaces and dashes are removed. |
| `fresh` | boolean | No | `false` | Accepted so that every endpoint takes the same fields. Lookups read the copy of the IRS files the API keeps and are never cached, so it changes nothing here. |

The lookup does not wait for the IRS, so it answers quickly; every snippet still sets a 30-second client timeout.

```bash title="cURL"
curl https://api.qelka.com/v1/nonprofit \
  --max-time 30 \
  -H "Authorization: Bearer $QELKA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ein": "53-0196605"}'
```
```javascript title="Node.js"
const response = await fetch('https://api.qelka.com/v1/nonprofit', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.QELKA_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ ein: '53-0196605' }),
  signal: AbortSignal.timeout(30_000),
})
const result = await response.json()
console.log(result)
```
```python title="Python"
import os

import requests

api_key = os.environ["QELKA_API_KEY"]
response = requests.post(
    "https://api.qelka.com/v1/nonprofit",
    headers={"Authorization": f"Bearer {api_key}"},
    json={"ein": "53-0196605"},
    timeout=30,
)
result = response.json()
print(result)
```
```php title="PHP"
<?php
$ch = curl_init('https://api.qelka.com/v1/nonprofit');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('QELKA_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode(['ein' => '53-0196605']),
    CURLOPT_TIMEOUT => 30,
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);
```
```go title="Go"
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
	"os"
	"time"
)

func main() {
	payload, _ := json.Marshal(map[string]any{"ein": "53-0196605"})
	request, _ := http.NewRequest(http.MethodPost, "https://api.qelka.com/v1/nonprofit", bytes.NewReader(payload))
	request.Header.Set("Authorization", "Bearer "+os.Getenv("QELKA_API_KEY"))
	request.Header.Set("Content-Type", "application/json")

	client := &http.Client{Timeout: 30 * time.Second}
	response, err := client.Do(request)
	if err != nil {
		panic(err)
	}
	defer response.Body.Close()

	var result map[string]any
	if err := json.NewDecoder(response.Body).Decode(&result); err != nil {
		panic(err)
	}
	fmt.Println(result)
}
```
```ruby title="Ruby"
require 'json'
require 'net/http'

uri = URI('https://api.qelka.com/v1/nonprofit')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = "Bearer #{ENV.fetch('QELKA_API_KEY')}"
request['Content-Type'] = 'application/json'
request.body = JSON.generate({ ein: '53-0196605' })

response = Net::HTTP.start(uri.host, uri.port, use_ssl: true, read_timeout: 30) do |http|
  http.request(request)
end
result = JSON.parse(response.body)
puts result
```

## Response

Every lookup gets a `200`, found or not. Read `status` first: `exempt`, `revoked`, `not_found` or `invalid`.

| Field | Type | Description |
|---|---|---|
| `id` | string | Identifier of this lookup: `lkp_` followed by 26 characters. |
| `object` | string | Always `nonprofit`. |
| `input` | string | The `ein` you sent. |
| `ein` | string or null | The EIN written `XX-XXXXXXX`. `null` when the input is not 9 digits. |
| `valid` | boolean | `false` when the input is not 9 digits, or starts with a prefix the IRS does not assign and is in neither file. |
| `status` | string | `exempt`, `revoked`, `not_found` or `invalid`. |
| `reason` | string or null | Why the EIN is `invalid`: `invalid_format` or `invalid_prefix`. `null` otherwise. |
| `organization` | object or null | The organization, from the Business Master File, or from the revocation list when it is only there. |
| `organization.name` | string | Name as the IRS records it. |
| `organization.care_of` | string or null | In care of name. |
| `organization.city` | string or null | City. |
| `organization.state` | string or null | State code. |
| `organization.zip` | string or null | ZIP code. |
| `organization.subsection` | object or null | The section of the Internal Revenue Code the organization is exempt under. |
| `organization.subsection.code` | string | IRS subsection code, such as `03`. |
| `organization.subsection.label` | string or null | The section, such as `501(c)(3)`. |
| `organization.ruling_date` | string or null | Month the exemption was granted, `YYYY-MM`. |
| `organization.deductibility` | object or null | Whether donations are tax deductible. |
| `organization.deductibility.code` | string | IRS deductibility code: `1`, `2` or `4`. |
| `organization.deductibility.label` | string or null | What the code means, such as `Contributions are deductible`. |
| `organization.deductibility.deductible` | boolean | `true` for codes `1` and `4`. |
| `organization.foundation` | object or null | IRS foundation code and its label: public charity type or private foundation. |
| `organization.foundation.code` | string | The code, such as `15`. |
| `organization.foundation.label` | string or null | What it means. |
| `organization.organization_type` | object or null | Legal form: `code` and `label`, such as `1` for `Corporation`. |
| `organization.exempt_status` | object or null | Exempt status: `code` and `label`, such as `01` for `Unconditional exemption`. |
| `organization.affiliation` | object or null | Place in a group exemption: `code` and `label`, such as `3` for `Independent organization`. |
| `organization.ntee` | object or null | National Taxonomy of Exempt Entities code, which describes the activity. |
| `organization.ntee.code` | string | The NTEE code, such as `P210`. |
| `organization.ntee.group` | string | Its major group, the first letter, such as `P` for human services. |
| `organization.ntee.label` | string or null | What the code stands for, such as `American Red Cross`. |
| `organization.group_exemption` | string or null | Group exemption number, when the organization is covered by one. |
| `organization.filing` | object | Amounts from the latest return on file, in US dollars. |
| `organization.filing.tax_period` | string or null | End of the tax period of that return, `YYYY-MM`. |
| `organization.filing.assets` | number or null | Total assets at the end of the period. |
| `organization.filing.income` | number or null | Income amount. |
| `organization.filing.revenue` | number or null | Revenue amount. |
| `organization.in_master_file` | boolean | `true` when the organization is in the current Business Master File, `false` when it is only on the revocation list. |
| `revocation` | object or null | The automatic revocation of the exemption, when the organization has one. `null` otherwise. |
| `revocation.revoked_on` | string or null | Date the exemption was revoked, `YYYY-MM-DD`. |
| `revocation.posted_on` | string or null | Date the IRS posted the revocation, `YYYY-MM-DD`. |
| `revocation.reinstated_on` | string or null | Date the exemption was reinstated, `YYYY-MM-DD`. `null` when it was not. |
| `revocation.exemption_type` | string or null | The section the organization was exempt under before the revocation, such as `501(c)(7)`. |
| `dataset` | object or null | The IRS files compared. `null` when the input is not 9 digits. |
| `dataset.organizations` | integer | Organizations in the data: the Business Master File plus those only on the revocation list. |
| `dataset.revocations` | integer | Entries of the revocation list. |
| `dataset.master_file_published` | string or null | Date of the Business Master File in use, `YYYY-MM-DD`. |
| `dataset.revocations_published` | string or null | Date of the revocation list in use, `YYYY-MM-DD`. |
| `dataset.loaded_at` | string | When the API loaded them, ISO 8601. |
| `credits_used` | integer | Credits debited for this call: 1 with a live key, `0` with a test key. |
| `cached` | boolean | Always `false`: lookups are never cached. |

```json title="Response"
{
  "id": "lkp_01M8CFQ9KCAEGWZFV6T5NDF6A3",
  "object": "nonprofit",
  "input": "53-0196605",
  "ein": "53-0196605",
  "valid": true,
  "status": "exempt",
  "reason": null,
  "organization": {
    "name": "AMERICAN NATIONAL RED CROSS",
    "care_of": null,
    "city": "WASHINGTON",
    "state": "DC",
    "zip": "20006-5310",
    "subsection": { "code": "03", "label": "501(c)(3)" },
    "ruling_date": "1938-12",
    "deductibility": { "code": "1", "label": "Contributions are deductible", "deductible": true },
    "foundation": {
      "code": "15",
      "label": "Organization that receives a substantial part of its support from a governmental unit or the general public 170(b)(1)(A)(vi)"
    },
    "organization_type": { "code": "1", "label": "Corporation" },
    "exempt_status": { "code": "01", "label": "Unconditional exemption" },
    "affiliation": { "code": "1", "label": "Central organization (no group exemption)" },
    "ntee": { "code": "P210", "group": "P", "label": "American Red Cross" },
    "group_exemption": null,
    "filing": { "tax_period": "2025-06", "assets": 5052941623, "income": 4608946426, "revenue": 3916983933 },
    "in_master_file": true
  },
  "revocation": null,
  "dataset": {
    "organizations": 3050635,
    "revocations": 1228742,
    "master_file_published": "2026-11-09",
    "revocations_published": "2026-11-17",
    "loaded_at": "2026-11-26T17:46:03.756Z"
  },
  "credits_used": 1,
  "cached": false
}
```

## Act on the status

| `status` | `reason` | What it means | What to do |
|---|---|---|---|
| `exempt` | `null` | The organization is in the IRS files and its exemption is not revoked. | Check `organization.subsection` and `organization.deductibility`: only some organizations can receive tax-deductible donations. |
| `revoked` | `null` | The IRS revoked the exemption and has not reinstated it. | Do not treat the organization as tax-exempt. Read `revocation.revoked_on`, and ask the organization whether it has applied for reinstatement. |
| `not_found` | `null` | The EIN is well formed but in neither IRS file. | It may belong to a business, or to an organization the IRS has not recognized as exempt. Confirm on the IRS [Tax Exempt Organization Search](https://apps.irs.gov/app/eos/). |
| `invalid` | `invalid_format` | The input is not 9 digits once spaces and dashes are removed. | Ask for the EIN again. |
| `invalid` | `invalid_prefix` | The EIN starts with two digits the IRS does not assign, and is in neither file. | Ask for the EIN again: it is mistyped or invented. |

Every status is billed 1 credit, because the lookup ran.

Not every tax-exempt organization is listed: churches are not required to apply for recognition of exemption, and an organization recognized after the files in use were published is not in them yet.

Test keys read two fictional organizations instead of the IRS files: `99-0000001`, `SAMPLE COMMUNITY FOUNDATION` in Springfield, IL, exempt under 501(c)(3), and `99-0000002`, `TEST REVOKED SOCIAL CLUB`, whose 501(c)(7) exemption was revoked on 2022-05-15. Any other well-formed EIN is `not_found`, or `invalid` with an unassigned prefix.

## Deductibility and revocation

Exemption and deductibility are not the same thing. Organizations exempt under 501(c)(3) can usually receive tax-deductible donations; most other subsections, such as social welfare organizations (501(c)(4)) or social clubs (501(c)(7)), cannot. `organization.deductibility` gives the IRS answer: code `1` for deductible, `2` for not deductible, `4` for deductible by treaty (foreign organizations).

The IRS revokes an exemption automatically when an organization does not file a required annual return or notice for three consecutive years. A revoked organization must apply again to be exempt; when the IRS reinstates it, `revocation.reinstated_on` is set and the status is `exempt` again. An organization that obtained a new ruling after its revocation is `exempt` too: its `ruling_date` falls in or after the month of `revocation.revoked_on`.

## How the EIN is checked

An EIN has 9 digits, written `XX-XXXXXXX`. Its first two digits are a prefix the IRS assigns; these are never assigned: `00`, `07`, `08`, `09`, `17`, `18`, `19`, `28`, `29`, `49`, `69`, `70`, `78`, `79`, `89`, `96` and `97`. The prefix is only checked when the EIN is in neither IRS file.

## Where the data comes from

The data is the IRS [Exempt Organizations Business Master File Extract](https://www.irs.gov/charities-non-profits/exempt-organizations-business-master-file-extract-eo-bmf), four regional files published monthly by IRS Statistics of Income, merged by EIN with the IRS [Automatic Revocation of Exemption List](https://www.irs.gov/charities-non-profits/tax-exempt-organization-search-bulk-data-downloads), also published monthly. Both are works of the U.S. Government, in the public domain. They are loaded into the API's database, so a lookup never waits for the IRS; street addresses are not stored. When this page was built, the master file of 2026-11-09 and the revocation list of 2026-11-17 were loaded: 3,050,635 organizations and 1,228,742 revocations. `dataset` in each response gives the files actually compared. See the [data sources page](https://qelka.com/data-sources).

## Examples

### Look up a revoked organization

With a test key in `QELKA_API_KEY`, this request returns the fictional revoked social club. It is only on the revocation list, so `in_master_file` is `false` and most organization fields are `null`.

```bash title="cURL"
curl https://api.qelka.com/v1/nonprofit \
  --max-time 30 \
  -H "Authorization: Bearer $QELKA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ein": "99-0000002"}'
```
```javascript title="Node.js"
const response = await fetch('https://api.qelka.com/v1/nonprofit', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.QELKA_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ ein: '99-0000002' }),
  signal: AbortSignal.timeout(30_000),
})
const result = await response.json()
console.log(result)
```
```python title="Python"
import os

import requests

api_key = os.environ["QELKA_API_KEY"]
response = requests.post(
    "https://api.qelka.com/v1/nonprofit",
    headers={"Authorization": f"Bearer {api_key}"},
    json={"ein": "99-0000002"},
    timeout=30,
)
result = response.json()
print(result)
```

```json title="Response"
{
  "id": "lkp_01M8CGAAP3MS8G2Y6NVK1CW4RT",
  "object": "nonprofit",
  "input": "99-0000002",
  "ein": "99-0000002",
  "valid": true,
  "status": "revoked",
  "reason": null,
  "organization": {
    "name": "TEST REVOKED SOCIAL CLUB",
    "care_of": null,
    "city": "SPRINGFIELD",
    "state": "IL",
    "zip": "62702-0002",
    "subsection": { "code": "07", "label": "501(c)(7)" },
    "ruling_date": null,
    "deductibility": null,
    "foundation": null,
    "organization_type": null,
    "exempt_status": null,
    "affiliation": null,
    "ntee": null,
    "group_exemption": null,
    "filing": { "tax_period": null, "assets": null, "income": null, "revenue": null },
    "in_master_file": false
  },
  "revocation": {
    "revoked_on": "2022-05-15",
    "posted_on": "2022-08-08",
    "reinstated_on": null,
    "exemption_type": "501(c)(7)"
  },
  "dataset": {
    "organizations": 1,
    "revocations": 1,
    "master_file_published": "2026-01-12",
    "revocations_published": "2026-01-12",
    "loaded_at": "2026-01-15T00:00:00.000Z"
  },
  "credits_used": 0,
  "cached": false
}
```

## Errors

| Status | Type | When |
|---|---|---|
| 400 | [invalid_request](https://qelka.com/docs/errors#invalid_request) | `ein` missing, empty or longer than 20 characters, a body that is not a JSON object, or a field the request table does not list |
| 401 | [invalid_api_key](https://qelka.com/docs/errors#invalid_api_key) | The key is missing, unknown or revoked |
| 402 | [insufficient_credits](https://qelka.com/docs/errors#insufficient_credits) | Your balance is less than 1 credit (live keys only) |
| 403 | [forbidden](https://qelka.com/docs/errors#forbidden) | The key is restricted to other endpoints |
| 405 | [invalid_request](https://qelka.com/docs/errors#invalid_request) | The method is not `POST` |
| 429 | [rate_limited](https://qelka.com/docs/errors#rate_limited) | Too many requests: wait `Retry-After` seconds |
| 500 | [internal_error](https://qelka.com/docs/errors#internal_error) | Unexpected error on our side: retry with backoff |
| 502 | [upstream_unavailable](https://qelka.com/docs/errors#upstream_unavailable) | The IRS data is not loaded yet: retry later |

No error is billed. An EIN that is in neither file is not an error: it is a `200` with `status: "not_found"`.

## Related

- [Nonprofit verification API](https://qelka.com/products/nonprofit-verification)
- Free tool: [nonprofit EIN lookup](https://qelka.com/tools/nonprofit-ein-lookup)
- [SEC company data](https://qelka.com/docs/api-reference/sec-company) for the EINs of SEC filers, also in the free [EIN lookup](https://qelka.com/tools/ein-lookup)
- [Batch](https://qelka.com/docs/api-reference/batch): up to 100 lookups in one call, each item with `type: "nonprofit"`
- [Bulk](https://qelka.com/docs/api-reference/bulk): a whole file of EINs with `type=nonprofit`
- [Errors](https://qelka.com/docs/errors), [Test mode](https://qelka.com/docs/test-mode)
