-
Notifications
You must be signed in to change notification settings - Fork 67
Federal Account Page
The federal account page contains:
- A Sankey diagram and text narrative for the current fiscal year (not affected by filters)
- Spending Over Time
- Spending by Category
- Spending by Award
The Sankey and text narrative do not respond to any filters.
GET /federal_accounts/:id/
- Where
:id
is the database primary key for this federal account. - Despite the name, this API call will return margin information about the federal account: the account's name and fragments of its account symbol.
POST /tas/balances/total/
{
"group": "reporting_period_start",
"field": "gross_outlay_amount_by_tas_cpe",
"aggregate": "sum",
"order": ["reporting_period_start"],
"filters": [{
"field": "treasury_account_identifier__federal_account_id",
"operation": "equals",
"value": 2357
}, {
"field": ["reporting_period_start", "reporting_period_end"],
"operation": "range_intersect",
"value": 2017,
"value_format": "fy"
}]
}
Rationale: This API call returns only the Gross Outlay value for the federal account aggregated over the current fiscal year. The current API design is only capable of aggregating values for one field at a time, so this API call needs to be performed multiple times. This API call needs to be repeated with the following field
values to obtain all the values required to generate the Sankey and text narrative:
-
budget_authority_unobligated_balance_brought_forward_fyb
- Balance brought forward (part 1) -
adjustments_to_unobligated_balance_brought_forward_cpe
- Balance brought forward (part 2) -
other_budgetary_resources_amount_cpe
- Other budgetary resources -
budget_authority_appropriated_amount_cpe
- New appropriations -
budget_authority_available_amount_total_cpe
- Budget Authority -
obligations_incurred_total_by_tas_cpe
- Obligated balance -
unobligated_balance_cpe
- Unobligated amount -
gross_outlay_amount_by_tas_cpe
- Gross Outlay
Note: You must sum both balance brought forward values to get the full balance brought forward amount.
The Spending Over Time has a number of possible combinations that result in different API calls. This visualization is further complicated by the fact that, like the Sankey, API limitations only return one set of values per call, so multiple calls (to different endpoints!) must be made to generate the visualization.
This visualization may be rendered in years or quarters, both of which result in different API endpoints even when the filters are consistent between the two.
This visualization may be filtered with obligation filters and non-obligation filters. Obligation filters are:
- Object class
- Program activity
Non-obligation filters are anything else.
POST /tas/balances/total/
{
"filters": [{
"field": "treasury_account_identifier__federal_account_id",
"operation": "equals",
"value": 2357
}],
"group": ["submission__reporting_fiscal_year"],
"field": "adjustments_to_unobligated_balance_brought_forward_cpe",
"aggregate": "sum",
"order": ["submission__reporting_fiscal_year"],
}
You will need to perform this API call for the following fields:
-
budget_authority_unobligated_balance_brought_forward_fyb
- Balance brought forward (part 1) -
adjustments_to_unobligated_balance_brought_forward_cpe
- Balance brought forward (part 2) -
other_budgetary_resources_amount_cpe
- Other budgetary resources -
budget_authority_appropriated_amount_cpe
- New Appropriations -
gross_outlay_amount_by_tas_cpe
- Gross outlay -
budget_authority_available_amount_total_cpe
- Budget Authority -
obligations_incurred_total_by_tas_cpe
- Obligated balance -
unobligated_balance_cpe
- Unobligated amount
POST /tas/balances/quarters/total/
{
"filters": [{
"field": "treasury_account_identifier__federal_account_id",
"operation": "equals",
"value": 2357
}],
"group": ["submission__reporting_fiscal_year", "submission__reporting_fiscal_quarter"],
"field": "budget_authority_appropriated_amount_cpe",
"aggregate": "sum",
"order": ["submission__reporting_fiscal_year"]
}
You will need to perform this API call for the following fields:
-
budget_authority_unobligated_balance_brought_forward_fyb
- Balance brought forward (part 1) -
adjustments_to_unobligated_balance_brought_forward_cpe
- Balance brought forward (part 2) -
other_budgetary_resources_amount_cpe
- Other budgetary resources -
budget_authority_appropriated_amount_cpe
- New Appropriations -
gross_outlay_amount_by_tas_cpe
- Gross outlay -
budget_authority_available_amount_total_cpe
- Budget Authority -
obligations_incurred_total_by_tas_cpe
- Obligated balance -
unobligated_balance_cpe
- Unobligated amount
POST /tas/balances/total/
{
"filters": [{
"field": "submission__reporting_fiscal_year",
"operation": "in",
"value": ["2015"]
}, {
"field": "treasury_account_identifier__federal_account_id",
"operation": "equals",
"value": 2357
}],
"group": ["submission__reporting_fiscal_year"],
"field": "budget_authority_unobligated_balance_brought_forward_fyb",
"aggregate": "sum",
"order": ["submission__reporting_fiscal_year"]
}
You will need to perform this API call for the following fields:
-
budget_authority_unobligated_balance_brought_forward_fyb
- Balance brought forward (part 1) -
adjustments_to_unobligated_balance_brought_forward_cpe
- Balance brought forward (part 2) -
other_budgetary_resources_amount_cpe
- Other budgetary resources -
budget_authority_appropriated_amount_cpe
- New Appropriations -
gross_outlay_amount_by_tas_cpe
- Gross outlay -
budget_authority_available_amount_total_cpe
- Budget Authority -
obligations_incurred_total_by_tas_cpe
- Obligated balance -
unobligated_balance_cpe
- Unobligated amount
POST /tas/balances/quarters/total/
{
"filters": [{
"field": "submission__reporting_fiscal_year",
"operation": "in",
"value": ["2015"]
}, {
"field": "treasury_account_identifier__federal_account_id",
"operation": "equals",
"value": 2357
}],
"group": ["submission__reporting_fiscal_year", "submission__reporting_fiscal_quarter"],
"field": "other_budgetary_resources_amount_cpe",
"aggregate": "sum",
"order": ["submission__reporting_fiscal_year"]
}
You will need to perform this API call for the following fields:
-
budget_authority_unobligated_balance_brought_forward_fyb
- Balance brought forward (part 1) -
adjustments_to_unobligated_balance_brought_forward_cpe
- Balance brought forward (part 2) -
other_budgetary_resources_amount_cpe
- Other budgetary resources -
budget_authority_appropriated_amount_cpe
- New Appropriations -
gross_outlay_amount_by_tas_cpe
- Gross outlay -
budget_authority_available_amount_total_cpe
- Budget Authority -
obligations_incurred_total_by_tas_cpe
- Obligated balance -
unobligated_balance_cpe
- Unobligated amount
POST /tas/categories/total/
{
"filters": [{
"field": "treasury_account__federal_account_id",
"operation": "equals",
"value": 2357
}, {
"field": "object_class__major_object_class",
"operation": "in",
"value": ["30"]
}],
"group": ["submission__reporting_fiscal_year"],
"field": "gross_outlay_amount_by_program_object_class_cpe",
"aggregate": "sum",
"order": ["submission__reporting_fiscal_year"]
}
You will need to perform this API call for these fields:
-
obligations_incurred_by_program_object_class_cpe
- Obligated balance (that matches filter values) -
gross_outlay_amount_by_program_object_class_cpe
- Outlay
POST /tas/balances/total/
{
"filters": [{
"field": "treasury_account_identifier__federal_account_id",
"operation": "equals",
"value": 2357
}, {
"field": "treasury_account_identifier__program_balances__object_class__major_object_class",
"operation": "in",
"value": ["30"]
}],
"group": ["submission__reporting_fiscal_year"],
"field": "unobligated_balance_cpe",
"aggregate": "sum",
"order": ["submission__reporting_fiscal_year"]
}
You will need to perform this API call for these fields:
-
budget_authority_available_amount_total_cpe
- Budget Authority -
unobligated_balance_cpe
- Unobligated amount
Note: When obligation filters are selected, an additional Obligated Balance (Other) segment is displayed in the visualization. This value is calculated using:
Other Obligated = Budget Authority - Unobligated - Obligated Filtered
POST /tas/categories/quarters/total/
{
"filters": [{
"field": "treasury_account__federal_account_id",
"operation": "equals",
"value": 2357
}, {
"field": "object_class__major_object_class",
"operation": "in",
"value": ["30"]
}],
"group": ["submission__reporting_fiscal_year", "submission__reporting_fiscal_quarter"],
"field": "gross_outlay_amount_by_program_object_class_cpe",
"aggregate": "sum",
"order": ["submission__reporting_fiscal_year"]
}
You will need to perform this API call for these fields:
-
obligations_incurred_by_program_object_class_cpe
- Obligated balance (that matches filter values) -
gross_outlay_amount_by_program_object_class_cpe
- Outlay
POST /tas/balances/quarters/total/
{
"filters": [{
"field": "treasury_account_identifier__federal_account_id",
"operation": "equals",
"value": 2357
}, {
"field": "treasury_account_identifier__program_balances__object_class__major_object_class",
"operation": "in",
"value": ["30"]
}],
"group": ["submission__reporting_fiscal_year", "submission__reporting_fiscal_quarter"],
"field": "budget_authority_available_amount_total_cpe",
"aggregate": "sum",
"order": ["submission__reporting_fiscal_year"]
}
You will need to perform this API call for these fields:
-
budget_authority_available_amount_total_cpe
- Budget Authority -
unobligated_balance_cpe
- Unobligated amount
Note: When obligation filters are selected, an additional Obligated Balance (Other) segment is displayed in the visualization. This value is calculated using:
Other Obligated = Budget Authority - Unobligated - Obligated Filtered
POST /tas/categories/total/
{
"filters": [{
"field": "treasury_account__federal_account_id",
"operation": "equals",
"value": 2357
}, {
"field": "object_class__major_object_class",
"operation": "in",
"value": ["30"]
}],
"group": ["submission__reporting_fiscal_year"],
"field": "gross_outlay_amount_by_program_object_class_cpe",
"aggregate": "sum",
"order": ["submission__reporting_fiscal_year"]
}
You will need to perform this API call for these fields:
-
obligations_incurred_by_program_object_class_cpe
- Obligated balance (that matches filter values) -
gross_outlay_amount_by_program_object_class_cpe
- Outlay
POST /tas/balances/total/
{
"filters": [{
"field": "treasury_account_identifier__federal_account_id",
"operation": "equals",
"value": 2357
}, {
"field": "treasury_account_identifier__program_balances__object_class__major_object_class",
"operation": "in",
"value": ["30"]
}],
"group": ["submission__reporting_fiscal_year"],
"field": "unobligated_balance_cpe",
"aggregate": "sum",
"order": ["submission__reporting_fiscal_year"]
}
You will need to perform this API call for these fields:
-
budget_authority_available_amount_total_cpe
- Budget Authority -
unobligated_balance_cpe
- Unobligated amount
Note: When obligation filters are selected, an additional Obligated Balance (Other) segment is displayed in the visualization. This value is calculated using:
Other Obligated = Budget Authority - Unobligated - Obligated Filtered
POST /tas/categories/quarters/total/
{
"filters": [{
"field": "treasury_account__federal_account_id",
"operation": "equals",
"value": 2357
}, {
"field": "object_class__major_object_class",
"operation": "in",
"value": ["30"]
}],
"group": ["submission__reporting_fiscal_year", "submission__reporting_fiscal_quarter"],
"field": "gross_outlay_amount_by_program_object_class_cpe",
"aggregate": "sum",
"order": ["submission__reporting_fiscal_year"]
}
You will need to perform this API call for these fields:
-
obligations_incurred_by_program_object_class_cpe
- Obligated balance (that matches filter values) -
gross_outlay_amount_by_program_object_class_cpe
- Outlay
POST /tas/balances/quarters/total/
{
"filters": [{
"field": "treasury_account_identifier__federal_account_id",
"operation": "equals",
"value": 2357
}, {
"field": "treasury_account_identifier__program_balances__object_class__major_object_class",
"operation": "in",
"value": ["30"]
}],
"group": ["submission__reporting_fiscal_year", "submission__reporting_fiscal_quarter"],
"field": "budget_authority_available_amount_total_cpe",
"aggregate": "sum",
"order": ["submission__reporting_fiscal_year"]
}
You will need to perform this API call for these fields:
-
budget_authority_available_amount_total_cpe
- Budget Authority -
unobligated_balance_cpe
- Unobligated amount
Note: When obligation filters are selected, an additional Obligated Balance (Other) segment is displayed in the visualization. This value is calculated using:
Other Obligated = Budget Authority - Unobligated - Obligated Filtered
POST /tas/categories/total/
{
"group": "program_activity__program_activity_name",
"field": "obligations_incurred_by_program_object_class_cpe",
"aggregate": "sum",
"order": ["-aggregate"],
"filters": [{
"field": "treasury_account__federal_account",
"operation": "equals",
"value": 2357
}],
"page": 1,
"limit": 5
}
Group values:
-
program_activity__program_activity_name
- Program Activity -
object_class__object_class_name
- Object class -
treasury_account__tas_rendering_label
- TAS
POST /awards/
{
"page": 1,
"fields": ["id", "piid", "fain", "uri", "recipient", "period_of_performance_start_date", "period_of_performance_current_end_date", "total_obligation", "type_description", "funding_agency"],
"filters": [{
"field": "type",
"operation": "in",
"value": ["A", "B", "C", "D"]
}, {
"field": "financial_set__treasury_account__federal_account",
"operation": "equals",
"value": 2357
}],
"order": ["-total_obligation"],
"limit": 60
}