List / search
Search and filter the SAM Federal Hierarchy: the canonical tree of federal departments and the agencies under them (909 organizations as of 2026-11-03, re-read in full from SAM.gov daily). It has two levels: commands and contracting offices are not in it, and a search for one finds the agency it belongs to (see search). Use it to resolve and normalize agency identity, walk the org tree, or join external datasets on Treasury cgac codes. Free with any key; this is reference data.
Parameters
type- Org type, uppercased:DEPARTMENT(169, level 1) orAGENCY(740, level 2).cgac- Treasury Common Government-wide Accounting Code, e.g.097(DoD),017(Navy). Many orgs share a department'scgac.parent_id- Filter to immediate children of thisorganization_id.hierarchy_level- Depth;1= root department.is_active- Defaults totrue. Passis_active=falseto include inactive orgs.search- Case-insensitive match across canonical name, short name, and alternative names (≥ 2 chars). A term of 4 or more characters also matches the agency paths on SAM notices, sosearch=CARDEROCKreturns DEPT OF THE NAVY withmatched_variantset to the path it matched (DEPT OF DEFENSE.DEPT OF THE NAVY.NAVSEA.NAVSEA WARFARE CENTER.NSWC CARDEROCK).%and_match literally.limit- Results per page. Default 100; maximum 100 on the free trial and 1,000 on paid plans. Over the maximum returns402.offset- ≥ 0.
Response (list rows, 10 fields)
{
"data": [
{
"organization_id": 300000188,
"fh_key": "300000188",
"cgac": "017",
"canonical_name": "DEPT OF THE NAVY",
"short_name": "USN",
"type": "AGENCY",
"hierarchy_level": 2,
"parent_id": 100000000,
"is_active": true,
"matched_variant": null
}
],
"pagination": { "limit": 50, "offset": 0, "total": 1, "has_next": false }
}
Example
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://govconapi.com/api/v1/federal-hierarchy?search=navy&limit=10"
matched_variant is null unless the row matched search only through a notice path; it then holds the most frequent such path, so you can see which office the term found. A department name is never a path match on its own: search=defense returns the agencies named for defense, not every DoD office.
Note: Both /federal-hierarchy and /federal-hierarchy/ work; no redirect. total is exact. Results ordered by hierarchy_level then canonical_name. Reference data; expect rare changes. Key your joins on organization_id (stable integer). To open one result in full, with its parents and children, use the single organization endpoint.