GnistAI GnistAI
Log in

USASpending

U.S. federal spending data — contracts, grants, and agency budgets.

Overview   |   MCP Docs   |   API Docs   |   OpenAPI   |   Playground   |   Tutorial   |   Toolkits   |   Home
status: healthy status status healthy healthy tools: 6 tools tools 6 6 Economics

Data source: USASpending.gov

MCP MCP Protocol

Endpoint https://context.gnist.ai/mcp/usaspending/
claude_desktop_config.json
{
  "mcpServers": {
    "gnist-usaspending": {
      "url": "https://context.gnist.ai/mcp/usaspending/",
      "headers": {
        "Gnist-API-Key": "YOUR_API_KEY"
      }
    }
  }
}
Shell
curl -X POST "https://context.gnist.ai/mcp/usaspending/" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "search_awards", "arguments": {"query": "example"}}}'

API REST API

API Root https://context.gnist.ai/rest/usaspending/

6 endpoints available:

Shell
curl "https://context.gnist.ai/rest/usaspending/search_awards?query=example" \
  -H "Gnist-API-Key: YOUR_API_KEY"
Python
import httpx

resp = httpx.get(
    "https://context.gnist.ai/rest/usaspending/search_awards",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    params={
        "query": "example"
},
)
print(resp.json())

OpenAPI Spec  ·  Full API Docs

CLI Command Line

Command gc usaspending

CLI documentation will be available when the GnistAI SDK is published.

Install
pip install gnistai

Available Tools (6)

search_awards
Search USASpending.gov for federal awards (contracts, grants, loans, direct payments).
ParameterTypeRequiredDescription
querystringrequiredKeywords to search for (e.g. "Lockheed Martin", "cybersecurity", "COVID-19 relief").
award_typeanyoptionalFilter by award category. Values: "contracts" (default), "grants", "loans", "direct_payments".
agencyanyoptionalFilter by awarding agency name (e.g. "Department of Defense", "Department of Health and Human Services").
date_fromanyoptionalOnly include awards starting on or after this date (YYYY-MM-DD).
date_toanyoptionalOnly include awards starting on or before this date (YYYY-MM-DD).
limitintegeroptionalNumber of results to return (1–50, default 10). Sorted by award amount descending. (default: 10)
get_award
Fetch detailed information for a specific federal award.
ParameterTypeRequiredDescription
award_idstringrequiredThe generated_unique_award_id or generated_internal_id from search results.
get_recipient
Search for or fetch a federal award recipient (contractor, grantee, etc.).
ParameterTypeRequiredDescription
keywordanyoptionalRecipient name or keyword to search (e.g. "Raytheon", "Johns Hopkins").
recipient_idanyoptionalSpecific recipient hash ID for full profile lookup (e.g. "6cf5fb1b-4988-d087-5dc1-70939d8fc6c4-C").
limitintegeroptionalNumber of search results (1–50, default 10). Ignored when using recipient_id. (default: 10)
get_agency_spending
Fetch budgetary resources for a US federal agency.
ParameterTypeRequiredDescription
agency_codestringrequiredThree-digit toptier agency code (e.g. "097" for DoD).
fiscal_yearanyoptionalFederal fiscal year (Oct–Sep). Omit for most recent available.
spending_by_geography
Aggregate federal spending by geographic area (state, county, or congressional district).
ParameterTypeRequiredDescription
keywordslist[string]requiredSearch terms to filter spending (e.g. ["cybersecurity"], ["COVID-19", "relief"]).
geo_layerstringoptionalGeographic granularity. Values: "state", "county", "district" (congressional district). Default "state". (default: "state")
scopestringoptionalWhat location to aggregate by. Values: "place_of_performance" (where work happens), "recipient_location" (where recipient is based). Default "place_of_performance". (default: "place_of_performance")
award_typeanyoptionalFilter by category: "contracts", "grants", "loans", "direct_payments". Omit for all types.
date_fromanyoptionalStart date filter (YYYY-MM-DD).
date_toanyoptionalEnd date filter (YYYY-MM-DD).
report_feedback
Report a bug, feature request, or general feedback for this data source.
ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (default: "general")

Related