Federal government contracting — awards won by a company and the companies ranked by total contract dollars. Awards come from USAspending.gov, and both endpoints cover a trailing one-year window by default that you can widen with `startDate` and `endDate`. Both responses echo the resolved window plus `latestActionDate` — the newest action date stored across the whole dataset — so an empty result is distinguishable from a coverage gap (`latestActionDate` is `null` only when no contract data is loaded at all).

## /v1/stocks/{ticker}/government-contracts

Lists the federal contract awards a public company has won over the selected date window, largest award first. `amount` is the total award ceiling (obligated + potential, including unexercised options), `totalOutlays` is dollars actually disbursed to date, and `actionDate` is the date the base award was signed/first obligated; `endDate` is the period-of-performance end and `recipientName` the USAspending awardee legal name (useful when the award went to a subsidiary).

**Parameters:** `{ticker}` (path, e.g. `LMT` — class shares accept both `BRK-B` and `BRK.B`); `startDate`, `endDate` (optional `YYYY-MM-DD` window, default the trailing year); `limit` (default 50, max 500) and `offset` for paging.

```bash
curl "https://api.equibles.com/v1/stocks/LMT/government-contracts?startDate=2019-09-01&endDate=2020-08-31&limit=2" \
  -H "Authorization: Bearer eq_your_api_key"
```

```python
import requests
r = requests.get(
    "https://api.equibles.com/v1/stocks/LMT/government-contracts?startDate=2019-09-01&endDate=2020-08-31&limit=2",
    headers={"Authorization": "Bearer eq_your_api_key"},
)
print(r.json())
```

```javascript
const res = await fetch("https://api.equibles.com/v1/stocks/LMT/government-contracts?startDate=2019-09-01&endDate=2020-08-31&limit=2", {
  headers: { Authorization: "Bearer eq_your_api_key" },
});
console.log(await res.json());
```

```json
{
    "startDate": "2019-09-01",
    "endDate": "2020-08-31",
    "latestActionDate": "2020-08-31",
    "data": [
        {
            "actionDate": "2019-11-26",
            "endDate": "2028-06-01",
            "awardingAgency": "Department of Defense",
            "awardType": "Definitive Contract",
            "amount": 30140182630.06,
            "totalOutlays": 0.0,
            "recipientName": "LOCKHEED MARTIN CORPORATION",
            "awardId": "N0001920C0009",
            "description": "THE PURPOSE OF THIS MODIFICATION IS TO AWARD F-35A LRIP 15 USAF  AIRCRAFT* LONG LEAD FUNDING"
        },
        {
            "actionDate": "2020-04-30",
            "endDate": "2033-09-30",
            "awardingAgency": "Department of Defense",
            "awardType": "Definitive Contract",
            "amount": 10478694385.9,
            "totalOutlays": 0.0,
            "recipientName": "LOCKHEED MARTIN CORPORATION",
            "awardId": "W31P4Q20C0023",
            "description": "THE CONTRACT AWARD IS FOR THE FY21/FY22/FY23 BASE AND OPTION PRICING FOR PHASE ARRAY TRACKING RADAR TO INTERCEPT ON TARGET (PATRIOT) ADVANCED CAPABILITY-3 (PAC-3) PRODUCTION REQUIREMENTS FOR THE UNITED STATES (US) AND FOREIGN MILITARY SALES (FMS)"
        }
    ],
    "meta": {
        "limit": 2,
        "offset": 0,
        "count": 2,
        "hasMore": true
    }
}
```

## /v1/government-contracts/top

Ranks public companies by their total federal contract dollars over the selected date window, largest total first. Totals sum award ceilings (obligated + potential), not dollars disbursed.

**Parameters:** `startDate`, `endDate` (optional `YYYY-MM-DD` window, default the trailing year); `limit` (default 25, max 500). The resolved window is echoed back as `startDate`/`endDate`, `total` is how many companies the window ranks, and `latestActionDate` is the newest contract action date in the whole dataset — a freshness marker, not the end of your window; this ranking is not paged, so it carries no `meta`.

```bash
curl "https://api.equibles.com/v1/government-contracts/top?startDate=2019-09-01&endDate=2020-08-31&limit=2" \
  -H "Authorization: Bearer eq_your_api_key"
```

```python
import requests
r = requests.get(
    "https://api.equibles.com/v1/government-contracts/top?startDate=2019-09-01&endDate=2020-08-31&limit=2",
    headers={"Authorization": "Bearer eq_your_api_key"},
)
print(r.json())
```

```javascript
const res = await fetch("https://api.equibles.com/v1/government-contracts/top?startDate=2019-09-01&endDate=2020-08-31&limit=2", {
  headers: { Authorization: "Bearer eq_your_api_key" },
});
console.log(await res.json());
```

```json
{
    "startDate": "2019-09-01",
    "endDate": "2020-08-31",
    "latestActionDate": "2026-08-07",
    "data": [
        {
            "rank": 1,
            "ticker": "LMT",
            "name": "Lockheed Martin Corp",
            "totalAwarded": 71990975308.91,
            "awardCount": 517
        },
        {
            "rank": 2,
            "ticker": "BA",
            "name": "Boeing Co",
            "totalAwarded": 15269417584.61,
            "awardCount": 353
        }
    ],
    "total": 216
}
```