Skip to content

puremetall/civiccontracts-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

civiccontracts-data

An open-source client for public U.S. contract award data — a friendly wrapper around the USAspending API, available for both Python and TypeScript.

civiccontracts-data makes it easy to pull federal contract awards, search by agency or NAICS code, and analyze government spending — without wrestling with raw API payloads. It is maintained by the team behind Civic AI, procurement intelligence for open solicitations (what to bid on) and contract awards (competitive intel) across federal, state, and local sources.

  • 🐍 Python client (civiccontracts_data)
  • 🟦 TypeScript / Node client (@puremetall/civiccontracts-data)
  • 📊 Built on the free, public USAspending API — no API key required
  • 🔎 Search awards by keyword, agency, NAICS, and time period

Why?

Federal spending data is public and free, but the APIs are verbose and the data model takes time to learn. This library gives you a small, well-typed surface for the most common questions:

  • "What did this agency spend on, and with whom?"
  • "Which awards match this keyword / NAICS code?"
  • "Who are the top recipients in my industry?"

If you want a finished product instead of raw award data, try Civic AI — it unifies open solicitations from SAM.gov and state portals with contract awards from USAspending, and lets you search both in plain English.

Install

Python

pip install civiccontracts-data

TypeScript / Node

npm install @puremetall/civiccontracts-data

Quickstart

Python

from civiccontracts_data import CivicContractsClient

client = CivicContractsClient()

# Search recent awards by keyword
awards = client.search_awards(keyword="cybersecurity", limit=10)
for award in awards:
    print(award["recipient_name"], award["award_amount"])

TypeScript

import { CivicContractsClient } from "@puremetall/civiccontracts-data";

const client = new CivicContractsClient();

const awards = await client.searchAwards({ keyword: "cybersecurity", limit: 10 });
for (const award of awards) {
  console.log(award.recipientName, award.awardAmount);
}

Examples

See the examples/ directory:

Data source & attribution

Data comes from USAspending.gov, the official source of U.S. federal spending data, via its public API. This project is not affiliated with or endorsed by the U.S. government.

Learn more

Contributing

Issues and pull requests are welcome. Please open an issue to discuss substantial changes first.

License

MIT © Civic AI

About

An open client for public U.S. government contract data (USAspending), for Python and TypeScript. Maintained by CivicContracts.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors