Route: /api/v2/federal_accounts/<PK>/spending_by_category/
Method: POST
This route takes a federal_account DB ID and returns the data reqired to visualized the Spending By Category graphic.
{
"category": "program_activity"
"filters": {
"object_class": [
{
"major_object_class": 10, # Personnel compensation and benefits
"object_class": [111, 113, ...] # Full-time permanent, Other than full-time permanent, ...
},
{
"major_object_class": 90 # Other
}
],
"program_activiy": [1, 2, 3],
"time_period": [
{
"start_date": "2001-01-01",
"end_date": "2001-01-31"
}
]
}
}
{
"results":
{
"Office of the Secretary": 110,
"Office of Advocacy and Outreach": 10,
"Departmental Administration": 0
}
Possible HTTP Status Codes:
- 400 : Missing parameters or limit is not a valid, positive integer
- 500 : All other errors
{
"detail": "Sample error message"
}
https://github.com/fedspendingtransparency/usaspending-website/wiki/Award-Search-Visualizations