Agency search¶
The agency filter (and its variants — awarding_agency, funding_agency) on every endpoint that exposes one is a resolver, not a substring search. You hand it any agency identifier — a name, abbreviation, code — and Tango figures out which Organization (and its hierarchy subtree) you meant.
What it accepts¶
A single agency identifier value, in any of these forms:
| You pass | Example | Resolves to |
|---|---|---|
| Abbreviation | HHS, DOD, FDA | The agency whose canonical short name matches |
| Name (full or partial) | Health and Human Services, Defense | The closest matching agency by full-text / fuzzy name |
| CGAC code (3-digit) | 075 | The L1 department |
| FPDS sub-agency code (4-digit) | 7530 | The L2 agency under the matching department |
| Federal Hierarchy key (fh_key) | 100004222 | The exact org row in agencies_organization |
| AAC code | 87FCAB | The org row whose AAC matches |
You don't pick a "type". You just hand over the identifier you have, and Tango ranks candidates across multiple signal types (abbreviation > acronym > alternate name > hierarchy) plus direct field matches (CGAC, FPDS code, fh_key, name trigram).
Multi-value OR (|)¶
Use | to filter by multiple agencies at once. Each token is resolved independently, then results are the union of every token's subtree.
GET /api/contracts/?awarding_agency=HHS|DOD
Returns contracts awarded by anything under HHS or anything under DOD, as a flat list in the endpoint's default order.
What | does not do:
- It does not group results by token.
- It does not preserve token order.
- It is not "search by N inputs and merge with deduplication" — each token is an independent agency selection.
If you need bucketed-by-agency results (e.g. 5 HHS contracts + 5 DOD contracts), make N separate calls. A lopsided union (huge agency + tiny agency) buries the small one in pagination.
Pagination¶
The response shape is identical to a single-token query. Standard pagination fields (count, next, previous, results) apply to the union.
Examples¶
Single agency by abbreviation¶
GET /api/contracts/?awarding_agency=HHS&limit=5
Single agency by FPDS code¶
GET /api/contracts/?awarding_agency=7530
Two agencies (OR)¶
GET /api/contracts/?awarding_agency=HHS|DOD
Forecast filter with fh_key¶
GET /api/forecasts/?agency=100004222
Mixed inputs¶
You can mix forms across |-separated tokens — abbreviation in one, fh_key in the next, name in the third:
GET /api/opportunities/?agency=HHS|100000700|Treasury
Each token is resolved independently.
Endpoints¶
The same resolver is used wherever you see an agency filter:
/api/contracts/—awarding_agency,funding_agency/api/idvs/—awarding_agency,funding_agency/api/otas/—awarding_agency,funding_agency/api/otidvs/—awarding_agency,funding_agency/api/subawards/—awarding_agency,funding_agency/api/vehicles/—agency/api/opportunities/—agency/api/notices/—agency/api/forecasts/—agency/api/grants/—agency/api/protests/—agency
For the per-endpoint filter list, see the relevant API reference page (e.g. Contracts).
See also¶
- Federal agency hierarchy — how Tango models L1 / L2 / L3 / sub-office relationships.
- Organizations API — direct access to the underlying
Organizationrecords.