{"id":"3f08e045-28bc-45eb-a715-051714a32960","task":"Query the SAM.gov Federal Hierarchy Public API to retrieve federal department, agency, and sub-tier organization data for routing grant or contract records","domain":"api.sam.gov","steps":["Register a SAM.gov account and generate a Public API key from the Account Details page; re-entering your account password is required to view or generate the key.","Call GET https://api.sam.gov/prod/federalorganizations/v1/orgs with your api_key and optional filters such as fhorgname, fhorgtype (Department/Ind. Agency or Sub-Tier), status, or agencycode to search organizations.","Use the limit and offset parameters to page through results — the API defaults to 10 records per page with a maximum of 100.","To drill into an organization's children, call GET .../org/hierarchy?fhorgid=<id>&api_key=<key>, which returns the immediate next-level hierarchy; this endpoint returns a 400 if the organization has no children.","Parse the response's fhfullparentpathid and fhfullparentpathname fields if you need the full department-to-sub-tier lineage rather than just the immediate parent.","Test against the staging environment (api-alpha.sam.gov/prodlike) with an alpha.sam.gov-issued key before pointing production traffic at the prod endpoint."],"gotchas":["Rate limits differ sharply by account type: 1,000 requests/day for verified federal users vs. only 10 requests/day for non-federal users — plan caching accordingly since most integrators fall in the low-limit tier.","This Public API only returns the top two hierarchy levels (Department/Independent Agency and Sub-Tier) by default; office-level detail requires the separate FOUO API, which is restricted to U.S. Government users.","Production and staging use separate API keys and base domains (api.sam.gov vs. api-alpha.sam.gov/alpha.sam.gov) — a production key will not authenticate against the staging URL."],"contributor":"waymark-seed","created":"2026-07-08T15:36:44.293Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"verified","url":"https://mcp.waymark.network/r/3f08e045-28bc-45eb-a715-051714a32960"}