curl --request GET \
--url 'https://api.givingcompass.org/insights/typeahead/nonprofits?q=red%20cro&limit=5' \
--header 'X-API-Key: <api-key>'
import requests
response = requests.get(
"https://api.givingcompass.org/insights/typeahead/nonprofits",
params={"q": "red cro", "limit": 5},
headers={"X-API-Key": "<api-key>"},
)
print(response.json())
const response = await fetch(
"https://api.givingcompass.org/insights/typeahead/nonprofits?" +
new URLSearchParams({ q: "red cro", limit: "5" }),
{ headers: { "X-API-Key": "<api-key>" } }
);
const data = await response.json();
{
"query": "red cro",
"count": 2,
"results": [
{
"ein": "530196605",
"name": "American National Red Cross",
"city": "Washington",
"state": "DC",
"score": 42.0
},
{
"ein": "030179419",
"name": "Red Crow Foundation",
"city": "Burlington",
"state": "VT",
"score": 18.5
}
]
}
{
"detail": [
{
"loc": ["query", "q"],
"msg": "String should have at least 2 characters",
"type": "string_too_short"
}
]
}
Nonprofit Endpoints
Typeahead Nonprofits
Search-as-you-type nonprofit suggestions matched by name or EIN
GET
/
typeahead
/
nonprofits
curl --request GET \
--url 'https://api.givingcompass.org/insights/typeahead/nonprofits?q=red%20cro&limit=5' \
--header 'X-API-Key: <api-key>'
import requests
response = requests.get(
"https://api.givingcompass.org/insights/typeahead/nonprofits",
params={"q": "red cro", "limit": 5},
headers={"X-API-Key": "<api-key>"},
)
print(response.json())
const response = await fetch(
"https://api.givingcompass.org/insights/typeahead/nonprofits?" +
new URLSearchParams({ q: "red cro", limit: "5" }),
{ headers: { "X-API-Key": "<api-key>" } }
);
const data = await response.json();
{
"query": "red cro",
"count": 2,
"results": [
{
"ein": "530196605",
"name": "American National Red Cross",
"city": "Washington",
"state": "DC",
"score": 42.0
},
{
"ein": "030179419",
"name": "Red Crow Foundation",
"city": "Burlington",
"state": "VT",
"score": 18.5
}
]
}
{
"detail": [
{
"loc": ["query", "q"],
"msg": "String should have at least 2 characters",
"type": "string_too_short"
}
]
}
Search-as-you-type nonprofit lookup. Prefix-matches active 501(c)(3) legal names and IRS Business Master File alternate names using a weighted completion suggester, tolerating a single typo. Input that looks like an EIN—with or without dashes—returns that nonprofit directly.
Requests that fail validation (e.g.
Authorizations
string
required
API key authentication. Required for all endpoints.
Query Parameters
string
required
What the user typed (2–100 characters): a nonprofit name prefix, or an EIN with or without dashes (e.g.
12-3456789 or 123456789).integer
default:"10"
Maximum number of suggestions to return (1–25).
string
2-letter state code. Accepted for forward-compatibility but currently ignored—results are not state-filtered yet.
Response
string
required
The query string that was matched, echoed back.
integer
required
Number of suggestions returned.
object[]
required
Ranked nonprofit suggestions, best match first.
Show properties
Show properties
string
required
The organization’s 9-digit EIN as a string, with leading zeros preserved (e.g.
"030179419"). Never coerce to an integer.string
required
Display-ready, title-cased organization name.
string | null
Organization city, when available.
string | null
2-letter state code, when available.
number
required
Completion-suggester ranking weight, exposed for ranking and debugging only—don’t surface it to end users.
q shorter than 2 characters, limit outside 1–25) return a 422 validation error.
curl --request GET \
--url 'https://api.givingcompass.org/insights/typeahead/nonprofits?q=red%20cro&limit=5' \
--header 'X-API-Key: <api-key>'
import requests
response = requests.get(
"https://api.givingcompass.org/insights/typeahead/nonprofits",
params={"q": "red cro", "limit": 5},
headers={"X-API-Key": "<api-key>"},
)
print(response.json())
const response = await fetch(
"https://api.givingcompass.org/insights/typeahead/nonprofits?" +
new URLSearchParams({ q: "red cro", limit: "5" }),
{ headers: { "X-API-Key": "<api-key>" } }
);
const data = await response.json();
{
"query": "red cro",
"count": 2,
"results": [
{
"ein": "530196605",
"name": "American National Red Cross",
"city": "Washington",
"state": "DC",
"score": 42.0
},
{
"ein": "030179419",
"name": "Red Crow Foundation",
"city": "Burlington",
"state": "VT",
"score": 18.5
}
]
}
{
"detail": [
{
"loc": ["query", "q"],
"msg": "String should have at least 2 characters",
"type": "string_too_short"
}
]
}