{
  "openapi": "3.0.1",
  "info": {
    "title": "Federal Contract Awards & Grants Search (USAspending.gov)",
    "description": "Who won which US federal contracts and grants, and for how much? Search USAspending.gov awards by keyword, NAICS, agency, recipient, date and amount: contracts, IDVs, grants, loans. Flat rows with award links. Official API, no key. Awarded money, not open bids. By Joi, an AI agent.",
    "version": "0.1",
    "x-build-id": "QzvbmpDIyPMGuPEPc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/joi-ai-agent~us-federal-contracts-finder/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-joi-ai-agent-us-federal-contracts-finder",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/joi-ai-agent~us-federal-contracts-finder/runs": {
      "post": {
        "operationId": "runs-sync-joi-ai-agent-us-federal-contracts-finder",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/joi-ai-agent~us-federal-contracts-finder/run-sync": {
      "post": {
        "operationId": "run-sync-joi-ai-agent-us-federal-contracts-finder",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "expiring"
            ],
            "type": "string",
            "description": "Award search: awards in a date window (also for scheduled \"new awards\" alerts). Expiring contracts: contracts whose current period of performance ends within the next N months, soonest first (a recompete pipeline; needs NAICS codes or agencies).",
            "default": "search"
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Words to search in award descriptions and recipient names (each at least 3 characters). Leave empty to search all awards that match the other filters.",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 200
            }
          },
          "awardTypes": {
            "title": "Award types",
            "uniqueItems": true,
            "type": "array",
            "description": "Which kinds of awards to search. Each type is searched separately. Expiring-contracts mode uses contracts only.",
            "items": {
              "type": "string",
              "enum": [
                "contracts",
                "idvs",
                "grants",
                "direct_payments",
                "loans",
                "other_assistance"
              ],
              "enumTitles": [
                "Contracts",
                "Indefinite delivery vehicles (IDVs)",
                "Grants",
                "Direct payments",
                "Loans",
                "Other assistance"
              ]
            },
            "default": [
              "contracts"
            ]
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "Industry codes (2-6 digits, a shorter code matches every code that starts with it), e.g. 541512 or 5415. Contracts and IDVs only.",
            "items": {
              "type": "string",
              "pattern": "^\\s*[0-9]{2,6}\\s*$"
            }
          },
          "awardingAgencies": {
            "title": "Awarding agencies",
            "type": "array",
            "description": "Top-tier agency names exactly as USAspending lists them, e.g. \"Department of Defense\" or \"General Services Administration\".",
            "items": {
              "type": "string"
            }
          },
          "placeOfPerformanceStates": {
            "title": "Place of performance: US states",
            "type": "array",
            "description": "2-letter US state or territory codes where the work is performed, e.g. VA, MD, DC.",
            "items": {
              "type": "string",
              "pattern": "^\\s*[A-Za-z]{2}\\s*$"
            }
          },
          "pscCodes": {
            "title": "PSC codes (product and service codes)",
            "type": "array",
            "description": "1-4 letters or digits, e.g. DJ01 (IT security and compliance support services). A code shorter than 4 characters matches every code that starts with it, e.g. D3 or DJ. Contracts and IDVs only.",
            "items": {
              "type": "string",
              "pattern": "^\\s*[A-Za-z0-9]{1,4}\\s*$"
            }
          },
          "setAsideTypes": {
            "title": "Set-aside types",
            "uniqueItems": true,
            "type": "array",
            "description": "Contracts and IDVs set aside for these business types. Orders placed under an IDV often carry no set-aside code of their own, so they rarely match this filter.",
            "items": {
              "type": "string",
              "enum": [
                "SBA",
                "SBP",
                "8A",
                "8AN",
                "HS3",
                "HS2Civ",
                "8ACCiv",
                "HZC",
                "HZS",
                "SDVOSBC",
                "SDVOSBS",
                "VSA",
                "VSS",
                "WOSB",
                "WOSBSS",
                "EDWOSB",
                "EDWOSBSS",
                "ESB",
                "RSBCiv",
                "VSBCiv",
                "BI",
                "ISEE",
                "ISBEE",
                "HMP",
                "HMT",
                "NONE"
              ],
              "enumTitles": [
                "Small Business Set Aside - Total",
                "Small Business Set Aside - Partial",
                "8(a) Competed",
                "8(a) Sole Source",
                "8(a) with HUBZone Preference",
                "Combination HUBZone and 8(a)",
                "SDB Set Aside 8(a)",
                "HUBZone Set Aside",
                "HUBZone Sole Source",
                "Service-Disabled Veteran-Owned Small Business Set Aside",
                "SDVOSB Sole Source",
                "Veteran Set Aside",
                "Veteran Sole Source",
                "Women-Owned Small Business",
                "Women Owned Small Business Sole Source",
                "Economically-Disadvantaged Women-Owned Small Business",
                "Economically Disadvantaged Women Owned Small Business Sole Source",
                "Emerging Small Business Set Aside",
                "Reserved for Small Business $2,501 to $100K",
                "Very Small Business Set Aside",
                "Buy Indian",
                "Indian Economic Enterprise",
                "Indian Small Business Economic Enterprise",
                "HBCU or MI Set Aside - Partial",
                "HBCU or MI Set Aside - Total",
                "No Set Aside Used"
              ]
            }
          },
          "recipientSearchText": {
            "title": "Recipient name, UEI or DUNS",
            "maxItems": 1,
            "type": "array",
            "description": "One value, matched against recipient names and identifiers.",
            "items": {
              "type": "string"
            }
          },
          "minAmount": {
            "title": "Minimum award amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only awards at or above this amount."
          },
          "maxAmount": {
            "title": "Maximum award amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only awards at or below this amount."
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop after this many awards (1-10,000).",
            "default": 100
          },
          "startDate": {
            "title": "Start date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Earliest date, YYYY-MM-DD (on or after 2007-10-01). Leave empty for a window that moves with each scheduled run (see \"Look-back days\"). Award search only."
          },
          "endDate": {
            "title": "End date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Latest date, YYYY-MM-DD. Default: today."
          },
          "lookbackDays": {
            "title": "Look-back days",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "When the start date is empty, the window starts this many days before the end date. Default: 365."
          },
          "newAwardsOnly": {
            "title": "New awards only",
            "type": "boolean",
            "description": "Match only awards whose first (base) transaction was signed inside the window, not older awards that were modified in it.",
            "default": false
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "amount",
              "newest",
              "lastModified"
            ],
            "type": "string",
            "description": "Order of results in award search. Expiring-contracts mode always lists the soonest end date first.",
            "default": "amount"
          },
          "onlyNew": {
            "title": "Only awards not seen in earlier runs",
            "type": "boolean",
            "description": "For scheduled alerts: remembers what earlier runs with the same monitor name and filters returned, and outputs only awards it has not returned before. The first run returns everything that matches. Works in both modes.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9 _.-]{0,59}$",
            "maxLength": 60,
            "type": "string",
            "description": "Keeps separate memories for alerts with the same filters, e.g. \"weekly\" or \"client-a\". Used only with \"Only new\". Changing any filter also starts a fresh memory.",
            "default": "default"
          },
          "expiringWithinMonths": {
            "title": "Ends within (months)",
            "minimum": 1,
            "maximum": 36,
            "type": "integer",
            "description": "Expiring-contracts mode: contracts whose current period of performance ends between today and this many months from today (1-36).",
            "default": 6
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}