Route: /api/v2/search/spending_by_geography/
Method: POST
This route takes award filters, and returns spending by state code, county code, or congressional district code.
scope: Scope defines what location is used for filtering the aggregated_amount.
geo_layer: Defines which geographical level should be returned in the request. Options include: "state", "county", "district"
geo_layer_filter: Defines a filter for a specific geographic area correlating to the geo_layer. It is a list of strings that are the unique identifiers for the geographic location.
- When
geo_layer
is"state"
thenthe geo_layer_filters
should be the countyshape_code
ex:["MN", "WA", "DC"]
. The state is thestate_code
- When
geo_layer
is"county"
then thethe geo_layer_filters
should be the countygeo_id
ex:["51041", "51117", "51179"]
. The countyshape_code
is a concatenation of thestate_FIPS_code
+ thecounty_code
- When
geo_layer
is"district"
then the geo_layer filters should be the county geo_id ex:["5109", "5109", "5109"]
. The countyshape_code
is a concatenation of thestate_FIPS_code
+ thecongressional_code
{
"scope": "place_of_performance",
"geo_layer": "state",
"geo_layer_filters":["MN", "WA", "DC"],
"filters": {
"award_type_codes": ["A", "B", "03"],
"award_ids": [1, 2, 3],
"award_amounts": [
{
"lower_bound": 1000000.00,
"upper_bound": 25000000.00
},
{
"upper_bound": 1000000.00
},
{
"lower_bound": 500000000.00
}
]
}
}
{
"scope": "place_of_performance",
"geo_layer": "state",
"results": [
{
"shape_code": "MN",
"display_name": "Minnesota",
"aggregated_amount": 0
},
{
"shape_code": "DC",
"display_name": "District of Columbia",
"aggregated_amount": 6393118.28
},
{
"shape_code": "VA",
"display_name": "Virginia",
"aggregated_amount": 73700
}
]
}
{
"scope": "place_of_performance",
"geo_layer": "county",
"results": [
{
"shape_code": "51041",
"display_name": "Chesterfield County",
"aggregated_amount": 73700.27
}
]
}
{
"scope": "place_of_performance",
"geo_layer": "district",
"results": [
{
"shape_code": "5109",
"display_name": "VA-09",
"aggregated_amount": 47283.82
}
]
}
scope
: Choices areplace_of_performance
orrecipient_location
based on user's requestgeo_layer
: Choices arestate
,country
, ordistrict
that is based on user's requestshape_code
: Unique identifier used for mapping that is based on thegeo_layer
display_name
: Display name forshape code
for labels on mapaggregated_amount
: Sum offederal_action_obligation
from the filtered transactions
Possible HTTP Status Codes:
- 400 : Missing parameters or limit is not a valid, positive integer
- 500 : All other errors
{
"detail": "Sample error message"
}
Can we change
congressional district
tocongressional
in thegeo_layer
response?