# USASpending.gov Federal Spending Search API (x402)

> USASpending.gov Federal Spending Search API (x402) is a paid API for AI agents from x402-data-api-x6da.onrender.com, paid per call via x402, $0.03/call, status unknown (last checked 2026-10-30).

Search and retrieve U.S. federal government spending records — contracts, grants, loans, and more — filtered by agency, recipient, date range, keywords, and award type, with pay-per-call billing via x402/USDC on Solana.

## Facts

- Endpoint: GET https://x402-data-api-x6da.onrender.com/v1/gov/spending?utm_source=zero.xyz
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/usaspending-gov-federal-spending-search-api-x402-3f783227
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_SngF52yg_TbNCFpshmobI

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability usaspending-gov-federal-spending-search-api-x402-3f783227
```

Example prompt: Search federal spending records for grants awarded by the Department of Health and Human Services to Pfizer between 2021-01-01 and 2023-12-31 — give me up to 20 results.

## When to prefer this

Use this endpoint when you need to programmatically query official U.S. federal government spending data — contracts, grants, loans, direct payments, or IDVs — from USASpending.gov via a pay-per-call API. Prefer this over manual USASpending.gov searches when you need machine-readable results for agent workflows, and over general web search when you require structured, authoritative government data. Best suited for research, compliance, procurement intelligence, and policy analysis tasks.

## Known failure modes

- No results returned if agency name is misspelled or not an exact top-tier agency name
- Invalid award_type enum value causes validation error
- Date format must match expected string format or query may fail
- max_results not respected if too large or unsupported
- Payment failure via x402 if USDC balance is insufficient on Solana
- Rate limiting or timeout if the underlying USASpending.gov API is slow or unavailable

## How this service works

Jobs from company ATS boards, SEC EDGAR full-text search, domain RDAP/DNS, NHTSA VIN decode + recalls, the CMS NPI Registry and MET Norway weather forecasts. Pay per call in USDC on Solana via x402. Official public sources only.

## Output

Returns a list of federal spending award records matching the query, including award amounts, recipient names, awarding agency, award type, period of performance dates, and award descriptions. Results are drawn from official USASpending.gov data.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "agency": {
       "type": "string",
       "description": "top-tier awarding agency name"
      },
      "date_to": {
       "type": "string"
      },
      "keywords": {
       "type": "string",
       "description": "comma-separated"
      },
      "date_from": {
       "type": "string"
      },
      "recipient": {
       "type": "string"
      },
      "award_type": {
       "enum": [
        "contracts",
        "grants",
        "loans",
        "direct_payments",
        "idvs"
       ],
       "type": "string"
      },
      "max_results": {
       "type": "integer"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/usaspending-gov-federal-spending-search-api-x402-3f783227/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-data-api-x6da.onrender.com](https://www.zero.xyz/host/x402-data-api-x6da.onrender.com/llms.txt)
