DEV Community

linderroger-eng
linderroger-eng

Posted on

How to Find $10M+ Government Contracts Before Your Competitors Do

How to Find $10M+ Government Contracts Before Your Competitors Do

The U.S. federal government awards over $700 billion in contracts every year. That's more than the GDP of most countries — and it's all publicly available data. The problem? Most businesses never see these opportunities until they're already over, or they find out too late to position themselves competitively.

In this guide, we'll show you how to use the Government Contracts API to monitor federal procurement activity, identify major contracts by agency, and build an automated intelligence pipeline that puts you ahead of your competition.


The $700 Billion Opportunity Most Businesses Ignore

Whether you're a tech company, a staffing firm, a construction contractor, or a consultant, the federal government may be your biggest untapped customer. Here's what most people don't realize:

  • Prime contracts cascade into subcontracts: A $50M DoD prime contract typically generates 20–40% in subcontracting opportunities
  • Re-compete windows are predictable: Most multi-year contracts come up for renewal on a fixed schedule
  • Agency patterns reveal priorities: If HHS is awarding lots of IT modernization contracts, that sector is heating up
  • Incumbents can be displaced: Even large contracts change hands — and the window to challenge an incumbent opens at re-compete time

The companies that win federal business consistently aren't necessarily the biggest — they're the best informed.


Introducing the Government Contracts API

The Government Contracts API provides clean, structured access to USASpending.gov and SAM.gov data. Instead of wrestling with the government's own data portals (which are notoriously clunky), you get a modern REST API with:

  • /contracts — Search and filter recent federal awards
  • /agencies — Get procurement data by federal agency
  • /opportunities — Active solicitations (open bids)
  • /vendors — Top contractors by agency and category

The base URL is: https://government-data-api.onrender.com

Free tier: 100 requests/month — no credit card required, plenty to build a weekly intelligence report.


Your First API Call: Finding Large Recent Contracts

Let's start with the core use case: finding large contracts awarded recently. Here's a basic curl call:

curl -X GET "https://government-data-api.onrender.com/contracts?min_value=10000000&limit=10" \
  -H "Accept: application/json"
Enter fullscreen mode Exit fullscreen mode

This returns the 10 most recent contracts worth $10M or more. Here's what the response looks like:

{
  "contracts": [
    {
      "contract_id": "HHSN316201200006W",
      "award_date": "2025-05-20",
      "agency": "Department of Health and Human Services",
      "agency_code": "HHS",
      "recipient_name": "Acme Technology Solutions LLC",
      "recipient_duns": "123456789",
      "award_amount": 47500000,
      "description": "IT Modernization and Cloud Migration Services",
      "naics_code": "541512",
      "naics_description": "Computer Systems Design Services",
      "place_of_performance": "Washington, DC",
      "period_of_performance_start": "2025-06-01",
      "period_of_performance_end": "2030-05-31",
      "contract_type": "Cost Plus Fixed Fee",
      "set_aside": "None",
      "solicitation_number": "HHSN316-25-R-00012"
    }
  ],
  "total_results": 2847,
  "page": 1,
  "per_page": 10
}
Enter fullscreen mode Exit fullscreen mode

Every field here is actionable intelligence:

  • recipient_name — Who won? Are they a competitor?
  • award_amount — How big is this deal?
  • naics_code — What's the procurement category?
  • period_of_performance_end — When does this contract expire (re-compete window)?
  • set_aside — Is this a small business set-aside? Women-owned? 8(a)?

Advanced Filtering: Finding Your Opportunities

The API supports powerful filtering. Here are the most useful queries:

Filter by agency:

curl -X GET "https://government-data-api.onrender.com/contracts?agency=DOD&min_value=5000000&limit=20" \
  -H "Accept: application/json"
Enter fullscreen mode Exit fullscreen mode

Filter by NAICS code (your industry):

# NAICS 541512 = Computer Systems Design
curl -X GET "https://government-data-api.onrender.com/contracts?naics=541512&min_value=1000000&limit=25" \
  -H "Accept: application/json"
Enter fullscreen mode Exit fullscreen mode

Filter by place of performance (your geography):

curl -X GET "https://government-data-api.onrender.com/contracts?state=VA&min_value=5000000&limit=20" \
  -H "Accept: application/json"
Enter fullscreen mode Exit fullscreen mode

Find contracts expiring in the next 12 months (re-compete opportunities):

curl -X GET "https://government-data-api.onrender.com/contracts?expiring_within_days=365&min_value=10000000" \
  -H "Accept: application/json"
Enter fullscreen mode Exit fullscreen mode

Building a Procurement Intelligence Dashboard in Python

Here's a complete Python script that generates a weekly procurement intelligence report:

import requests
import json
from datetime import datetime, timedelta
from collections import defaultdict

# Configuration
BASE_URL = "https://government-data-api.onrender.com"
API_KEY = "your_api_key_here"   # Get from RapidAPI

# Define your company's focus areas
TARGET_NAICS = [
    "541512",  # Computer Systems Design
    "541511",  # Custom Computer Programming
    "541519",  # Other Computer Related Services
    "541611",  # Management Consulting
]

TARGET_AGENCIES = ["DOD", "HHS", "DHS", "VA", "NASA"]
MIN_CONTRACT_VALUE = 1_000_000   # $1M minimum
LARGE_CONTRACT_THRESHOLD = 10_000_000  # Flag contracts over $10M


def get_contracts(agency=None, naics=None, min_value=None, 
                  days_back=30, limit=100, expiring_days=None):
    """
    Fetch contracts from the Government Contracts API.
    """
    endpoint = f"{BASE_URL}/contracts"

    params = {
        "limit": limit,
        "days_back": days_back
    }

    if agency:
        params["agency"] = agency
    if naics:
        params["naics"] = naics
    if min_value:
        params["min_value"] = min_value
    if expiring_days:
        params["expiring_within_days"] = expiring_days

    headers = {
        "Accept": "application/json",
        "x-api-key": API_KEY
    }

    response = requests.get(endpoint, params=params, headers=headers)
    response.raise_for_status()

    return response.json().get("contracts", [])


def get_agency_summary(agency_code, days_back=30):
    """
    Get procurement summary for a specific agency.
    """
    endpoint = f"{BASE_URL}/agencies/{agency_code}/summary"

    headers = {"Accept": "application/json", "x-api-key": API_KEY}
    params = {"days_back": days_back}

    response = requests.get(endpoint, headers=headers, params=params)
    response.raise_for_status()

    return response.json()


def find_recompete_opportunities(target_naics_list, months_ahead=12):
    """
    Find contracts that are expiring soon in your target NAICS codes.
    These are the best opportunities to pursue.
    """
    days_ahead = months_ahead * 30
    recompetes = []

    for naics in target_naics_list:
        contracts = get_contracts(
            naics=naics,
            min_value=MIN_CONTRACT_VALUE,
            expiring_days=days_ahead,
            limit=50
        )

        for contract in contracts:
            contract["_naics_searched"] = naics
            recompetes.append(contract)

    # Sort by award amount descending
    recompetes.sort(key=lambda x: x.get("award_amount", 0), reverse=True)
    return recompetes


def analyze_agency_spending(agencies, days_back=90):
    """
    Analyze spending trends across target agencies.
    Returns insights on where agencies are spending most.
    """
    agency_data = {}

    for agency in agencies:
        contracts = get_contracts(agency=agency, days_back=days_back, limit=100)

        if not contracts:
            continue

        total_value = sum(c.get("award_amount", 0) for c in contracts)

        # Group by NAICS to find top categories
        by_naics = defaultdict(list)
        for c in contracts:
            by_naics[c.get("naics_code", "Unknown")].append(c)

        top_categories = sorted(
            [
                {
                    "naics": naics,
                    "description": contracts_list[0].get("naics_description", ""),
                    "count": len(contracts_list),
                    "total_value": sum(c.get("award_amount", 0) for c in contracts_list)
                }
                for naics, contracts_list in by_naics.items()
            ],
            key=lambda x: x["total_value"],
            reverse=True
        )[:5]

        agency_data[agency] = {
            "total_contracts": len(contracts),
            "total_value": total_value,
            "avg_contract_value": total_value / len(contracts) if contracts else 0,
            "top_categories": top_categories,
            "large_contracts": [c for c in contracts if c.get("award_amount", 0) >= LARGE_CONTRACT_THRESHOLD]
        }

    return agency_data


def generate_weekly_report():
    """
    Generate a comprehensive weekly procurement intelligence report.
    """
    report = []
    report.append("=" * 60)
    report.append(f"FEDERAL PROCUREMENT INTELLIGENCE REPORT")
    report.append(f"Generated: {datetime.now().strftime('%Y-%m-%d %H:%M')}")
    report.append("=" * 60)

    # Section 1: Recent Large Awards
    report.append("\n📋 SECTION 1: LARGEST AWARDS (Last 7 Days)")
    report.append("-" * 40)

    recent_large = get_contracts(min_value=LARGE_CONTRACT_THRESHOLD, days_back=7, limit=20)

    for i, contract in enumerate(recent_large[:10], 1):
        value_m = contract.get("award_amount", 0) / 1_000_000
        report.append(f"\n{i}. {contract.get('agency', 'N/A')} — ${value_m:.1f}M")
        report.append(f"   Winner: {contract.get('recipient_name', 'N/A')}")
        report.append(f"   Description: {contract.get('description', 'N/A')[:80]}...")
        report.append(f"   NAICS: {contract.get('naics_code')}{contract.get('naics_description', '')}")
        report.append(f"   Expires: {contract.get('period_of_performance_end', 'N/A')}")

    # Section 2: Re-Compete Opportunities
    report.append("\n\n🎯 SECTION 2: UPCOMING RE-COMPETE OPPORTUNITIES")
    report.append("-" * 40)
    report.append("(Contracts in your target NAICS expiring within 12 months)")

    recompetes = find_recompete_opportunities(TARGET_NAICS, months_ahead=12)

    for i, contract in enumerate(recompetes[:10], 1):
        value_m = contract.get("award_amount", 0) / 1_000_000
        report.append(f"\n{i}. {contract.get('agency', 'N/A')} — ${value_m:.1f}M")
        report.append(f"   Current Holder: {contract.get('recipient_name', 'N/A')}")
        report.append(f"   Expiring: {contract.get('period_of_performance_end', 'N/A')}")
        report.append(f"   Set-aside: {contract.get('set_aside', 'None')}")

    # Section 3: Agency Intelligence
    report.append("\n\n🏛️  SECTION 3: AGENCY SPENDING TRENDS (Last 90 Days)")
    report.append("-" * 40)

    agency_intel = analyze_agency_spending(TARGET_AGENCIES, days_back=90)

    for agency, data in agency_intel.items():
        total_m = data["total_value"] / 1_000_000
        avg_m = data["avg_contract_value"] / 1_000_000
        report.append(f"\n{agency}:")
        report.append(f"  Total: ${total_m:.1f}M across {data['total_contracts']} contracts")
        report.append(f"  Avg Award: ${avg_m:.1f}M")
        report.append(f"  Top Category: {data['top_categories'][0]['description'] if data['top_categories'] else 'N/A'}")
        report.append(f"  Large Awards (${LARGE_CONTRACT_THRESHOLD/1e6:.0f}M+): {len(data['large_contracts'])}")

    report.append("\n" + "=" * 60)
    report.append("END OF REPORT")
    report.append("=" * 60)

    return "\n".join(report)


if __name__ == "__main__":
    report = generate_weekly_report()
    print(report)

    # Optional: save to file
    filename = f"procurement_report_{datetime.now().strftime('%Y%m%d')}.txt"
    with open(filename, "w") as f:
        f.write(report)
    print(f"\n✅ Report saved to {filename}")
Enter fullscreen mode Exit fullscreen mode

How to Use This for Business Development

Here are five concrete strategies:

1. Identify Your Ideal Contract Size

The federal market ranges from micro-purchases ($10K) to mega-contracts ($1B+). Use the min_value and max_value parameters to find contracts in the range where you can actually compete. Many small businesses win in the $500K–$5M range as a prime, or $5M–$50M as a subcontractor.

2. Track Your Competitors

Search by recipient_name to see who's winning contracts in your space. How many awards has your top competitor won this year? From which agencies? This tells you where to focus your relationship-building efforts.

3. Ride the Re-Compete Wave

Contracts ending within 6–12 months are gold. The incumbent has the advantage, but they're not unbeatable. Start engaging the agency 9–12 months before re-compete. The API's expiring_within_days filter makes this easy to automate.

4. Set-Aside Targeting

If your firm qualifies as a small business, woman-owned, veteran-owned, or 8(a), filter specifically for those set-asides. Competition is dramatically reduced in set-aside awards.

5. Geographic Concentration

If you're a local or regional firm, the state filter lets you see exactly what's being awarded in your area. Federal buildings, military bases, and regional offices all have procurement needs.


Understanding the Data Sources

The Government Contracts API aggregates data from:

  • USASpending.gov — The official database of all federal spending, updated daily
  • SAM.gov — System for Award Management, the official vendor registration and contract opportunities portal
  • FPDS-NG — Federal Procurement Data System — Next Generation

The API normalizes and enriches this data, making it far easier to work with than the raw government feeds.


Free Tier and Pricing

Getting started is completely free:

  • Free tier: 100 requests/month
  • No credit card required
  • Access to all core endpoints
  • JSON responses with full contract details

For power users — BD teams running daily alerts, analysts building dashboards, or developers integrating into CRM systems — paid tiers offer higher volume and additional data enrichment features.


Get Started Now

The Government Contracts API is available on RapidAPI. Search for "government contracts API" on RapidAPI to find the listing and subscribe to the free tier in minutes.

Once you have your API key, drop it into the Python script above, customize your target NAICS codes and agencies, and run your first procurement intelligence report. The 100 free requests per month is more than enough to run a weekly report for your entire BD team.


Final Thoughts

Federal procurement data has always been public. The problem has never been availability — it's been accessibility. The raw data portals are complex, slow, and hard to automate against.

This API changes that. With a few lines of Python and a free API key, you can build a procurement intelligence system that would have cost a six-figure consulting engagement five years ago.

Your competitors are probably not doing this yet. That's your edge.

Start your free trial: Search for "government contracts API" on RapidAPI and subscribe today. 100 free requests per month, no credit card, cancel anytime.

Good luck out there. The contracts are waiting. 🏛️

Top comments (0)