FORMAT: 1A HOST: https://api.usaspending.gov
Deprecated: Please see the following API contract instead: usaspending_api/api_contracts/contracts/v2/search/spending_by_category/recipient
This endpoint supports the Advanced Search page and allow for complex filtering for specific subsets of spending data.
This endpoint returns a list of the top results of Recipient DUNS sorted by the total amounts in descending order.
-
Request (application/json)
-
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object" }
-
Attributes (object)
filters
(required, FilterObject) The filters to find with said categorylimit
: 5 (optional, number) The number of results to include per pagepage
: 1 (optional, number) The page of results to return based on the limitsubawards
(optional, boolean) Determines whether Prime Awards or Sub Awards are searched
-
Body
{ "filters": { "recipient_id": "1c3edaaa-611b-840c-bf2b-fd34df49f21f-P", "time_period": [ { "start_date": "2019-09-28", "end_date": "2020-09-28" } ] }, "category": "recipient_duns", "limit": 5, "page": 1 }
-
-
Response 200 (application/json)
-
Attributes (object)
category
:recipient_duns
(required, string)results
(required, array[CategoryResult], fixed-type)limit
: 10 (required, number)page_metadata
(PageMetadataObject)messages
(optional, array[string]) An array of warnings or instructional directives to aid consumers of this endpoint with development and debugging.
-
Body
{ "category": "recipient_duns", "limit": 10, "page_metadata": { "page": 1, "next": 2, "previous": null, "hasNext": false, "hasPrevious": false }, "results": [ { "amount": 46069068318.25, "recipient_id": null, "name": "MULTIPLE RECIPIENTS", "code": null }, { "amount": 17388378311.33, "recipient_id": "005a8812-bab5-2780-533b-b62c33271882-C", "name": "LOCKHEED MARTIN CORPORATION", "code": "008016958" } ], "messages": [ "For searches, time period start and end dates are currently limited to an earliest date of 2007-10-01. For data going back to 2000-10-01, use either the Custom Award Download feature on the website or one of our download or bulk_download API endpoints as listed on https://api.usaspending.gov/docs/endpoints." ] }
-
id
(required, number) The id is the database key.name
(required, string, nullable)code
(required, string, nullable)code
is a user-displayable code (such as a program activity or NAICS code, but not a database ID). When no such code is relevant, return anull
.amount
(required, number)
page
(required, number)hasNext
(required, boolean)
keywords
: [transport
] (optional, array[string])time_period
(optional, array[TimePeriodObject], fixed-type)place_of_performance_scope
(optional, enum[string])- Members
domestic
foreign
- Members
place_of_performance_locations
(optional, array[LocationObject], fixed-type)agencies
(optional, array[AgencyObject], fixed-type)recipient_search_text
: [Hampton
] (optional, array[string])recipient_id
(optional, string) A unique identifier for the recipient which includes the recipient hash and level.recipient_scope
(optional, enum[string])- Members
domestic
foreign
- Members
recipient_locations
(optional, array[LocationObject], fixed-type)recipient_type_names
: [category_business
] (optional, array[string])award_type_codes
(optional, FilterObjectAwardTypes)award_ids
: [SPE30018FLGFZ
,SPE30018FLJFN
] (optional, array[string]) Award IDs surrounded by double quotes (e.g."SPE30018FLJFN"
) will perform exact matches as opposed to the default, fuzzier full text matches. Useful for Award IDs that contain spaces or other word delimiters.award_amounts
(optional, array[AwardAmounts], fixed-type)program_numbers
: [10.331
] (optional, array[string])naics_codes
(optional, NAICSCodeObject)psc_codes
(optional, enum[PSCCodeObject, array[string]]) Supports new PSCCodeObject or legacy array of codes.contract_pricing_type_codes
: [J
] (optional, array[string])set_aside_type_codes
: [NONE
] (optional, array[string])extent_competed_type_codes
: [A
] (optional, array[string])tas_codes
(optional, array[TASCodeObject], fixed-type)treasury_account_components
(optional, array[TreasuryAccountComponentsObject], fixed-type)def_codes
(optional, array[DEFC], fixed-type) If thedef_codes
provided are in the COVID-19 or IIJA group, the query will only return results of transactions where theaction_date
is on or after the enactment date of the public law associated with that disaster code.
This TimePeriodObject can fall into different categories based on the request.
-
if
subawards
trueSee the Subaward Search category defined in SubawardSearchTimePeriodObject
-
otherwise
See the Transaction Search category defined in TransactionSearchTimePeriodObject
These fields are defined in the StandardLocationObject
type
(required, enum[string])- Members
awarding
funding
- Members
tier
(required, enum[string])- Members
toptier
subtier
- Members
name
:Department of Defense
(required, string)
lower_bound
(optional, number)upper_bound
: 1000000 (optional, number)
require
: [33
] (optional, array[string], fixed-type)exclude
: [3333
] (optional, array[string], fixed-type)
require
: [[Service
,B
,B5
]] (optional, array[array[string]], fixed-type)exclude
: [[Service
,B
,B5
,B502
]] (optional, array[array[string]], fixed-type)
require
: [[091
]] (optional, array[array[string]], fixed-type)exclude
: [[091
,091-0800
]] (optional, array[array[string]], fixed-type)
ata
(optional, string, nullable) Allocation Transfer Agency Identifier - three charactersaid
(required, string) Agency Identifier - three charactersbpoa
(optional, string, nullable) Beginning Period of Availability - four digitsepoa
(optional, string, nullable) Ending Period of Availability - four digitsa
(optional, string, nullable) Availability Type Code - X or nullmain
(required, string) Main Account Code - four digitssub
(optional, string, nullable) Sub-Account Code - three digits
List of filterable award types
A
B
C
D
02
03
04
05
06
07
08
09
10
11
A
B
C
D
IDV_A
IDV_B
IDV_B_A
IDV_B_B
IDV_B_C
IDV_C
IDV_D
IDV_E
List of Disaster Emergency Fund (DEF) Codes (DEFC) defined by legislation at the time of writing. A list of current DEFC can be found here.