# searchAwards

**Identifier:** `usaspending_searchAwards`

**Provider:** [USAspending](https://kirha.com/providers/usaspending.md)

Search US federal awards (contracts, grants, loans...) by keyword, recipient name or UEI, NAICS code, awarding agency and action date. Returns award amount, dates, agency, NAICS/PSC and recipient for each. Use it to list a company's federal contracts, screen awards in an industry, or find what changed recently (sortBy lastModified). Use getAwardDetails with an awardId for competition and parent contract data.

## Run it with the CLI

```bash
kirha tools run usaspending_searchAwards \
  --input '{}'
```

`--input` takes a JSON object that matches the input schema. Pass `--input -` to read it from stdin.

## Call it over HTTP

```bash
curl https://api.kirha.com/tools/v1/execute \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: **********' \
  --data '{
  "tool_name": "usaspending_searchAwards",
  "input": {}
}'
```

Replace the stars with an API key from https://app.kirha.com/api-keys.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "agency": {
      "description": "Awarding toptier agency name or abbreviation, e.g., DOD, NASA, HHS",
      "type": "string"
    },
    "awardCategory": {
      "default": "contracts",
      "enum": [
        "contracts",
        "idvs",
        "grants",
        "directPayments",
        "loans",
        "other"
      ],
      "type": "string"
    },
    "endDate": {
      "description": "YYYY-MM-DD",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "type": "string"
    },
    "keywords": {
      "description": "Free text over award descriptions, e.g., 'large language model'",
      "type": "string"
    },
    "limit": {
      "default": 10,
      "maximum": 50,
      "minimum": 1,
      "type": "integer"
    },
    "naicsCodes": {
      "description": "e.g., 541511, or a prefix like 5415",
      "items": {
        "pattern": "^\\d{2,6}$",
        "type": "string"
      },
      "maxItems": 10,
      "type": "array"
    },
    "page": {
      "default": 1,
      "maximum": 100,
      "minimum": 1,
      "type": "integer"
    },
    "recipient": {
      "description": "Recipient name, or its UEI for an exact match that also covers its subsidiaries",
      "type": "string"
    },
    "sortBy": {
      "default": "amount",
      "enum": [
        "amount",
        "startDate",
        "lastModified"
      ],
      "type": "string"
    },
    "startDate": {
      "description": "YYYY-MM-DD, earliest action date (2007-10-01 at the earliest)",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "type": "string"
    }
  },
  "type": "object"
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "awardIds": {
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "awards": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "amountUsd": {
            "type": "number"
          },
          "awardId": {
            "type": "string"
          },
          "awardingAgency": {
            "type": "string"
          },
          "awardingSubAgency": {
            "type": "string"
          },
          "cfdaNumber": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "endDate": {
            "type": "string"
          },
          "lastModified": {
            "type": "string"
          },
          "naics": {
            "type": "string"
          },
          "outlaysUsd": {
            "type": "number"
          },
          "piid": {
            "type": "string"
          },
          "psc": {
            "type": "string"
          },
          "recipientId": {
            "type": "string"
          },
          "recipientName": {
            "type": "string"
          },
          "recipientUei": {
            "type": "string"
          },
          "startDate": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "awardId"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "context": {
      "type": "string"
    },
    "hasNext": {
      "type": "boolean"
    }
  },
  "required": [
    "context",
    "hasNext",
    "awards",
    "awardIds"
  ],
  "type": "object"
}
```

## Related tools

Other USAspending tools that this tool refers to, or that refer to it.

- [`searchRecipients`](https://kirha.com/providers/usaspending/searchRecipients.md)
- [`getAwardDetails`](https://kirha.com/providers/usaspending/getAwardDetails.md)

-----

[All USAspending tools](https://kirha.com/providers/usaspending.md) · [< Back to tools list](https://kirha.com/tools.md)