DEV Community

Cover image for How I Built a Federal Contract Search API with Win Rate Prediction (and You Can Too)
CleanDataDev
CleanDataDev

Posted on

How I Built a Federal Contract Search API with Win Rate Prediction (and You Can Too)

If you've ever tried to do business with the US federal government, you know the data situation is... complicated.
Every year, the US government awards over $700 billion in contracts. Every single one is public record — but actually using that data? That's another story.

Search Federal Contracts and Predict Win Rates with GovMatch API

I built a free API that lets you search US federal contract awards by company name and get a win‑rate prediction based on historical data. No signup, no credit card – just plain JSON.

👉 Live demo: https://govmatch-frontend.onrender.com

👉 API docs (Swagger): https://govmatch-api.onrender.com/docs


🔍 Example: Search for “SAFEWARE INC”

Enter a company name, and the tool shows:

  • Contract history – award ID, amount, start date
  • Win‑rate score – how competitive the company is
  • Confidence level – based on the number of contracts found

Here is a real search result for SAFEWARE INC:

📊 Win‑rate prediction panel

Metric Value
Total Contracts 0*
Total Amount $0.00
Avg Amount $0.00
Recent Activity No
Win Rate Score 0
Confidence Low (no data)

*The prediction panel shows 0 because the sample size is very small (only 2 contracts in the test set). The win‑rate algorithm works best with 5+ contracts.

📋 Contracts found

Award ID Recipient Name Amount ($) Start Date
15DDHQ26F00000181 SAFEWARE INC 94,794.82 2027-03-31
15DDHQ26F00000342 SAFEWARE INC 5,784.58 2027-03-31

⚙️ How it works

  1. Data sourceUSAspending.gov official API.
  2. Backend – FastAPI + PostgreSQL, deployed on Render.
  3. Win‑rate logic – counts recent contracts, groups by agency, normalises by lookback days, and returns a score from 0–100.

The entire stack is open source. You can clone it, modify it, or just use the hosted API.

📦 GitHub repo: https://github.com/xdz199110-lang/Govmatch


🚀 Try it now

No installation, no API key – just paste this into your browser:


bash
curl "https://govmatch-api.onrender.com/contracts/search?recipient_name=SAFEWARE&limit=5"

Or visit the interactive Swagger docs to play with the parameters.

If you find a bug, want a new feature, or just like the project – let me know in the comments or open an issue on GitHub.

Happy contracting!
Enter fullscreen mode Exit fullscreen mode

Top comments (0)