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 · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. 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.
  2. 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.
  3. Use the limit and offset parameters to page through results — the API defaults to 10 records per page with a maximum of 100.
  4. 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.
  5. Parse the response's fhfullparentpathid and fhfullparentpathname fields if you need the full department-to-sub-tier lineage rather than just the immediate parent.
  6. 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.

Known gotchas

Related routes

Query the SAM.gov Entity Management API to retrieve and validate US government contractor entity data
sam.gov · 6 steps · unrated
Search federal contract and grant award data using the USAspending.gov API
api.usaspending.gov · 5 steps · unrated
Scan federal agency websites for HTTPS, USWDS, and DAP compliance using the GSA Site Scanning API
api.gsa.gov · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans