# US Government Spending API
> US federal government spending as an API, live from the official USAspending.gov (US Treasury). Search federal awards — contracts, grants, loans and direct payments — by keyword, recipient, award type and fiscal year, ranked by amount, with the recipient name, dollar amount, awarding agency, description and award dates. Rank the top recipients of federal money for any search, and list and inspect the 100+ top-tier federal agencies with their budgetary resources. Ideal for government-transparency, investigative journalism, contractor intelligence, grants research, GovCon and policy-analysis applications. Public-domain US Treasury data.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/usaspending-api/..."
```

## Pricing
- **Free** (Free) — 3,200 calls/Mo, 2 req/s
- **Starter** ($7/Mo) — 47,000 calls/Mo, 8 req/s
- **Pro** ($18/Mo) — 235,000 calls/Mo, 20 req/s
- **Mega** ($45/Mo) — 1,150,000 calls/Mo, 50 req/s

## Endpoints

### Spending

#### `GET /v1/agencies` — Top-tier federal agencies + budgets

**Parameters:**
- `q` (query, optional, string) — Filter agencies by name Example: `energy`
- `limit` (query, optional, string) — Max results (1-200, default 150) Example: `150`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/usaspending-api/v1/agencies?q=energy&limit=150"
```

**Response:**
```json
{
    "data": {
        "count": 1,
        "total": 1,
        "agencies": [
            {
                "active_fy": "2026",
                "agency_id": 930,
                "agency_name": "Department of Energy",
                "abbreviation": "DOE",
                "toptier_code": "089",
                "outlay_amount": null,
                "obligated_amount": 39942740030.98,
                "budget_authority_amount": 136221703606.55,
                "congressional_justification_url": "https://energy.gov/cj"
            }
        ]
    },
    "meta": {
        "timestamp": "2026-05-31T08:04:59.370Z",
        "request_id": "4eecfc66-2f63-4bc5-9fa5-6a47823f879a"
    },
    "status": "ok",
    "message": "Agencies retrieved",
    "success": true
}
```

#### `GET /v1/agency` — One agency overview

**Parameters:**
- `code` (query, required, string) — Toptier code (3-4 digits), e.g. 086 (HUD) Example: `086`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/usaspending-api/v1/agency?code=086"
```

**Response:**
```json
{
    "data": {
        "agency": {
            "name": "Department of Housing and Urban Development",
            "mission": "HUD's mission is to create strong, sustainable, inclusive communities and quality affordable homes for all. HUD is working to strengthen the housing market to bolster the economy and protect consumers; meet the need for quality affordable rental homes; utilize housing as a platform for improving quality of life; build inclusive and sustainable communities free from discrimination, and transform the way HUD does business.",
            "website": "https://www.hud.gov/",
            "fiscal_year": 2026,
            "abbreviation": "HUD",
            "toptier_code": "086",
            "subtier_agency_count": 12,
            "total_budgetary_resources": null
        }
    },
    "meta": {
        "timestamp": "2026-05-31T08:04:59.619Z",
        "request_id": "4f302f9a-3381-47f7-aafa-dc9c00a6a693"
    },
    "status": "ok",
    "message": "Agency retrieved",
    "success": true
}
```

#### `GET /v1/awards` — Search federal awards

**Parameters:**
- `keyword` (query, optional, string) — Full-text search term Example: `solar`
- `type` (query, optional, string) — contracts | grants | loans | direct_payments | other
- `recipient` (query, optional, string) — Recipient name search
- `fiscal_year` (query, optional, string) — Fiscal year, e.g. 2024
- `limit` (query, optional, string) — Results per page (1-100, default 20) Example: `20`
- `page` (query, optional, string) — Page number Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/usaspending-api/v1/awards?keyword=solar&limit=20&page=1"
```

**Response:**
```json
{
    "data": {
        "page": 1,
        "count": 20,
        "limit": 20,
        "results": [
            {
                "amount": 2947426627.98,
                "award_id": "80NM0018F0615",
                "end_date": "2028-09-30",
                "recipient": "CALIFORNIA INSTITUTE OF TECHNOLOGY",
                "start_date": "2018-10-01",
                "description": "EUROPA CLIPPER PROJECT  THE CONTRACT IS THE SPONSORING AGREEMENT BETWEEN THE NATIONAL AERONAUTICS AND SPACE ADMINISTRATION NASA AND THE CALIFORNIA INSTITUTE OF TECHNOLOGY-CONTRACTOR, A PRIVATE NONPROFIT EDUCATIONAL INSTITUTION, WHICH ESTABLISHES THE RELATIONSHIP FOR THE OPERATION OF THE FEDERALLY FUNDED RESEARCH AND DEVELOPMENT CENTER-FFRDC KNOWN AS THE JET PROPULSION LABORATORY. THE CONTRACTOR, JPL, IS REQUIRED TO PERFORM WORK THAT IS DESIGNATED IN TASK ORDERS ISSUED BY THE NASA MANAGEMENT OFFICE-NMO CONTRACTING OFFICERS. NASA-SPONSORED WORK: JPLS PRIMARY MISSION IS TO SUPPORT THE NASA SCIENCE MISSION DIRECTORATE-SMD IN CARRYING OUT THE SPECIFIC OBJECTIVES IDENTIFIED IN THE SMD SCIENCE PLAN.  THE FOUR BROAD SCIENTIFIC AREAS ARE: EARTH SCIENCE, PLANETARY SCIENCE, HELIOPHYSICS, AND ASTROPHYSICS.  IN PERFORMANCE OF THIS CONTRACT, JPL SHALL: 1. SUPPLY A BROAD BASE OF SCIENTIFIC AND TECHNICAL CAPABILITIES RELEVANT TO NASA PROGRAM AND PROJECT RESPONSIBILITIES AND ASSIGNMENTS. 2. FOSTER ITS UNIQUE RELATIONSHIP WITH A TOP-TIER UNIVERSITY TO FACILITATE THE INVOLVEMENT OF SCIENTISTS, ENGINEERS, AND STUDENTS F
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/recipients` — Top recipients by spending

**Parameters:**
- `keyword` (query, optional, string) — Full-text search term Example: `solar`
- `type` (query, optional, string) — contracts | grants | loans | direct_payments | other
- `fiscal_year` (query, optional, string) — Fiscal year, e.g. 2024
- `limit` (query, optional, string) — Max recipients (1-100, default 20) Example: `20`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/usaspending-api/v1/recipients?keyword=solar&limit=20"
```

**Response:**
```json
{
    "data": {
        "count": 20,
        "results": [
            {
                "code": "095633152",
                "name": "CALIFORNIA INSTITUTE OF TECHNOLOGY",
                "amount": 14905292765.12,
                "recipient_id": "6e76fa33-2d96-c636-941c-bca1997db076-C"
            },
            {
                "code": "926784042",
                "name": "LOCKHEED MARTIN CORP",
                "amount": 2239648042.69,
                "recipient_id": "6e7a895c-aa57-8600-2a8a-4e237f6213f6-C"
            },
            {
                "code": "040549461",
                "name": "THE JOHNS HOPKINS UNIVERSITY APPLIED PHYSICS LABORATORY LLC",
                "amount": 941923401.5,
                "recipient_id": "4eae43e5-e1f1-0e77-b2fe-09a12a9a552c-C"
            },
            {
                "code": "121371538",
                "name": "LOCKHEED MARTIN CORPORATION",
                "amount": 638473081.38,
                "recipient_id": "4de935fd-7eb9-654c-bd76-c9bd3a6943db-C"
            },
            {
                "code": "945910586",
                "name": "ORBITAL SCIENCES LLC",
                "amount": 576428473.12,
                "recipient_id": "bbede84e-0bef-9d5b-c701-c96faf95b8ef-C"
            },
            {
                "code": "117513046",
                "name": "NORTHROP GRUMMAN SYSTEMS CORPORATION",
                "amount": 481818557.51,
                "recipient_id": "d6601efc-adc3-1030-5904-be323dc49433-C"
            },
  
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Source & award types

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/usaspending-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "Live US federal spending: contracts, grants, loans and direct payments. Search awards or top recipients by keyword/recipient/fiscal-year and award type; list and inspect federal agencies and their budgets.",
        "source": "USAspending.gov (US Treasury)",
        "filters": [
            "keyword",
            "recipient",
            "fiscal_year",
            "type"
        ],
        "endpoints": [
            "/v1/agencies",
            "/v1/agency",
            "/v1/awards",
            "/v1/recipients",
            "/v1/meta"
        ],
        "award_types": [
            "contracts",
            "grants",
            "loans",
            "direct_payments",
            "other"
        ]
    },
    "meta": {
        "timestamp": "2026-05-31T08:05:00.220Z",
        "request_id": "2aa8d99d-67e8-4468-a03c-cf28ddcaee26"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/usaspending-api
OpenAPI spec: https://www.oanor.com/api/usaspending-api/openapi.json
