Government Contracts Dataset
Track federal government contract awards sourced from USAspending.gov and mapped to public company tickers. See which companies win government contracts, the awarding agencies, contract values, industry classifications, and contract periods.
What’s Included
Section titled “What’s Included”The Government Contracts dataset provides:
- Award Details: Award ID, amount, type, and contract award type
- Agency Information: Awarding agency and sub-agency
- Recipient Data: Recipient company name mapped to stock ticker
- Contract Period: Start and end dates for each award
- Industry Classification: NAICS codes and descriptions
- Contract Description: Plain-text description of the contract scope
Coverage
Section titled “Coverage”| Source | Description | Update Frequency |
|---|---|---|
| USAspending.gov | Federal contract awards mapped to stock tickers | Daily |
Quick Start
Section titled “Quick Start”from finbrain import FinBrainClient
fb = FinBrainClient(api_key="YOUR_API_KEY")
df = fb.government_contracts.ticker("LMT", as_dataframe=True)print(df)import requests
API_KEY = "YOUR_API_KEY"BASE_URL = "https://api.finbrain.tech/v2"
response = requests.get( f"{BASE_URL}/government-contracts/LMT", headers={"Authorization": f"Bearer {API_KEY}"})
data = response.json()for contract in data["data"]["contracts"]: print(f"{contract['startDate']}: ${contract['awardAmount']:,.0f} " f"from {contract['awardingAgency']} — {contract['description']}")For complete code examples in Python, JavaScript, C++, Rust, and cURL, see the API Reference.
Key Fields
Section titled “Key Fields”| Field | Description | Example |
|---|---|---|
awardId | Unique contract award identifier | CONT_AWD_0001 |
awardAmount | Total award value in USD | 50000000 |
awardType | Type of award | Contract |
awardingAgency | Federal agency issuing the contract | Department of Defense |
awardingSubAgency | Sub-agency within the awarding agency | Department of the Army |
recipientName | Company receiving the contract | Lockheed Martin Corporation |
startDate | Contract start date (YYYY-MM-DD) | 2025-06-01 |
endDate | Contract end date (YYYY-MM-DD) | 2026-06-01 |
description | Plain-text description of the contract | Aircraft maintenance services |
naicsCode | NAICS industry classification code | 336411 |
naicsDescription | Human-readable NAICS description | Aircraft Manufacturing |
contractAwardType | Specific contract award mechanism | Definitive Contract |
Use Cases
Section titled “Use Cases”Top Contract Recipients
Section titled “Top Contract Recipients”Scan defense tickers to find companies with the highest total contract value:
from finbrain import FinBrainClient
fb = FinBrainClient(api_key="YOUR_API_KEY")
def scan_contract_value(symbols): """Find companies with the highest government contract value""" results = []
for symbol in symbols: try: df = fb.government_contracts.ticker(symbol, as_dataframe=True)
total_value = df["awardAmount"].sum() results.append({ "symbol": symbol, "contracts": len(df), "total_value": total_value }) except Exception: continue
return sorted(results, key=lambda x: x["total_value"], reverse=True)
defense_symbols = ["LMT", "RTX", "GD", "NOC", "BA"]recipients = scan_contract_value(defense_symbols)
for r in recipients: print(f"{r['symbol']}: {r['contracts']} contracts, ${r['total_value']:,.0f} total value")Agency Breakdown
Section titled “Agency Breakdown”Analyze which federal agencies award contracts to a given company:
from finbrain import FinBrainClient
fb = FinBrainClient(api_key="YOUR_API_KEY")
def agency_breakdown(symbol): """Break down contracts by awarding agency""" df = fb.government_contracts.ticker(symbol, as_dataframe=True)
by_agency = df.groupby("awardingAgency").agg( contracts=("awardAmount", "count"), total_value=("awardAmount", "sum") ).sort_values("total_value", ascending=False)
return by_agency
agencies = agency_breakdown("LMT")for agency, row in agencies.iterrows(): print(f"{agency}: {row['contracts']} contracts, ${row['total_value']:,.0f}")Contract Size Analysis
Section titled “Contract Size Analysis”Categorize contracts by size to understand the award distribution:
import pandas as pdfrom finbrain import FinBrainClient
fb = FinBrainClient(api_key="YOUR_API_KEY")
def contract_size_distribution(symbol): """Categorize contracts by size buckets""" df = fb.government_contracts.ticker(symbol, as_dataframe=True)
bins = [0, 1_000_000, 10_000_000, 100_000_000, float("inf")] labels = ["Under $1M", "$1M–$10M", "$10M–$100M", "$100M+"]
df["size_bucket"] = pd.cut(df["awardAmount"], bins=bins, labels=labels)
distribution = df.groupby("size_bucket", observed=True).agg( contracts=("awardAmount", "count"), total_value=("awardAmount", "sum") )
return distribution
dist = contract_size_distribution("RTX")for bucket, row in dist.iterrows(): print(f"{bucket}: {row['contracts']} contracts, ${row['total_value']:,.0f}")Related Resources
Section titled “Related Resources”- Government Contracts API Reference - Endpoint details, parameters, and response schema
- Corporate Lobbying Dataset - Track corporate lobbying activity
- Insider Transactions Dataset - Track executive trades
- Senate Trades Dataset - Senate trading activity