# USAspending spending by category

Rank federal spending in a date range by recipient, awarding agency or sub-agency, NAICS, PSC, assistance listing (CFDA), state or district, optionally. Needs category, start date and end date. Served by USAspending.gov.

Rank federal spending in a date range by recipient, awarding agency or sub-agency, NAICS, PSC, assistance listing (CFDA), state or district, optionally filtered by keywords, recipients, NAICS and award family. Use it for top contractors in a market or top buying agencies.

- Tool ID: `usaspending/spending-by-category`
- Provider: [USAspending.gov](/providers/usaspending.md)
- Capability: [B2B data](/tools/b2b-data.md)
- Price: no charge per call
- Authentication: an authorised Agentik workspace is required for execution, including zero-price tools.

## Pricing contract

No charge per call. A workspace is still needed so your agent can call it.


```json
{
  "model": "per_call",
  "amountUsd": 0
}
```

## Complete input schema


```json
{
  "type": "object",
  "properties": {
    "category": {
      "type": "string",
      "enum": [
        "recipient",
        "awarding_agency",
        "awarding_subagency",
        "funding_agency",
        "naics",
        "psc",
        "cfda",
        "state_territory",
        "country",
        "district",
        "county"
      ],
      "description": "What to rank, e.g. 'recipient' or 'awarding_agency'"
    },
    "start_date": {
      "type": "string",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
      "description": "Action date from (YYYY-MM-DD, not before 2007-10-01), e.g. '2024-10-01'"
    },
    "end_date": {
      "type": "string",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
      "description": "Action date to (YYYY-MM-DD), e.g. '2025-09-30'"
    },
    "award_type": {
      "type": "string",
      "enum": [
        "contracts",
        "idvs",
        "grants",
        "direct_payments",
        "other"
      ],
      "description": "Award family: contracts, idvs (indefinite delivery vehicles), grants, direct_payments or other (insurance and other assistance). Example: 'contracts'"
    },
    "keywords": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 3,
        "maxLength": 100
      },
      "minItems": 1,
      "maxItems": 5,
      "description": "Keywords matched in award text, e.g. ['cybersecurity']"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 2,
        "maxLength": 100
      },
      "minItems": 1,
      "maxItems": 5,
      "description": "Recipient names, UEIs or DUNS, e.g. ['Booz Allen']"
    },
    "naics_codes": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[0-9]{2,6}$"
      },
      "minItems": 1,
      "maxItems": 10,
      "description": "NAICS codes (2-6 digits), e.g. ['541512']"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 50,
      "default": 10,
      "description": "Rows per page (1-50), e.g. 10"
    },
    "page": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "default": 1,
      "description": "Page number, e.g. 1"
    }
  },
  "required": [
    "category",
    "start_date",
    "end_date"
  ],
  "additionalProperties": false
}
```

## Published example

This is the provider tool’s published example. Replace example values with the user’s requested inputs, respecting the schema; do not execute an example merely to test a connection.


```json
{
  "tool_id": "usaspending/spending-by-category",
  "input": {
    "category": "recipient",
    "start_date": "2024-10-01",
    "end_date": "2025-09-30",
    "award_type": "contracts",
    "naics_codes": [
      "541512"
    ],
    "limit": 3
  }
}
```

## Execute and retrieve

Inspect again before execution, explain the price and obtain the required authority. Use MCP run_tool or POST /v1/run with this tool ID, valid input and an idempotency key. Save the returned run ID and follow the actual state. If Agentik answers that the tool is temporarily unavailable, do not retry it blindly; use discovery to propose an alternative.

A partial or uncertain result can still have consumed provider resources. Consult [billing](/docs/billing.md), [idempotency](/docs/idempotency.md) and [asynchronous results](/docs/async.md).

Licence: Public domain (U.S. Government work).

Attribution: Data from USAspending.gov (U.S. Department of the Treasury, Bureau of the Fiscal Service).

[Provider documentation](https://api.usaspending.gov/docs/endpoints)

[REST inspection](https://api.agentik.cc/v1/tools/usaspending/spending-by-category) · [OpenAPI](/openapi.json) · [Connection guide](/connect.md)

---

[HTML page](/providers/usaspending/spending-by-category) · [Agent index](/llms.txt)
