{
  "openapi": "3.0.1",
  "info": {
    "title": "Federal Contracts & Grants by Company (USAspending)",
    "description": "Get the federal contracts, grants and loans any US company won, from official USAspending.gov data. Search by company name or UEI, agency, NAICS, PSC, state or keyword. Returns award rows plus a company summary: total obligated, top agencies and NAICS. Misses are free.",
    "version": "0.1",
    "x-build-id": "QKFFHVj5VELpshCXh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/swillz~federal-awards-by-company/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-swillz-federal-awards-by-company",
        "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/swillz~federal-awards-by-company/runs": {
      "post": {
        "operationId": "runs-sync-swillz-federal-awards-by-company",
        "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/swillz~federal-awards-by-company/run-sync": {
      "post": {
        "operationId": "run-sync-swillz-federal-awards-by-company",
        "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": {
          "companies": {
            "title": "Companies (names or UEIs)",
            "type": "array",
            "description": "Company names (e.g. \"Booz Allen Hamilton\", \"Palantir\") or 12-character SAM.gov UEIs (e.g. \"JCBMLGPE6Z71\"). Names are matched strictly: every word must appear in the recipient name, so all subsidiaries that share the name are included. Leave empty to search by filters only.",
            "items": {
              "type": "string"
            }
          },
          "awardTypes": {
            "title": "Award types",
            "type": "array",
            "description": "Which awards to return: contracts (definitive contracts, purchase orders, delivery orders), idvs (GSA schedules, GWACs, IDIQs, BPAs), grants, loans. Default contracts.",
            "items": {
              "type": "string",
              "enum": [
                "contracts",
                "idvs",
                "grants",
                "loans"
              ],
              "enumTitles": [
                "Contracts",
                "IDVs (schedules, IDIQs, BPAs)",
                "Grants",
                "Loans"
              ]
            },
            "default": [
              "contracts"
            ]
          },
          "lookbackDays": {
            "title": "Look back (days)",
            "minimum": 1,
            "maximum": 7000,
            "type": "integer",
            "description": "Awards with activity in the last N days (default 365). Ignored when startDate is set.",
            "default": 365
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "Optional start of the period, YYYY-MM-DD (earliest 2007-10-01). Overrides lookbackDays."
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "Optional end of the period, YYYY-MM-DD. Default today."
          },
          "maxAwardsPerCompany": {
            "title": "Max awards per company",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Most award rows per company (or for a filters-only search), 1-5000, default 100. Each row is one charged record.",
            "default": 100
          },
          "sortBy": {
            "title": "Sort awards by",
            "enum": [
              "amount",
              "newest"
            ],
            "type": "string",
            "description": "Return the largest awards first (default) or the newest first.",
            "default": "amount"
          },
          "includeSummary": {
            "title": "Add a company summary row",
            "type": "boolean",
            "description": "Add one company_summary row per company: matched recipient names and UEIs, total obligated in the period, top awarding agencies and top NAICS codes. Counts as one record. Default true.",
            "default": true
          },
          "strictNameMatch": {
            "title": "Strict name matching",
            "type": "boolean",
            "description": "Keep only recipients whose name contains every word of your query (default true). USAspending's own name search is fuzzy and returns unrelated companies; turn this off only to see everything it returns.",
            "default": true
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Optional: only awards whose description or fields match these words, e.g. \"cybersecurity\", \"cloud migration\" (3+ characters each).",
            "items": {
              "type": "string"
            }
          },
          "agencies": {
            "title": "Awarding agencies",
            "type": "array",
            "description": "Optional top-tier awarding agency names exactly as USAspending writes them, e.g. \"Department of Defense\", \"Department of Veterans Affairs\", \"General Services Administration\".",
            "items": {
              "type": "string"
            }
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "Optional NAICS codes or prefixes (2-6 digits), e.g. \"541512\" or \"5415\".",
            "items": {
              "type": "string"
            }
          },
          "pscCodes": {
            "title": "PSC codes",
            "type": "array",
            "description": "Optional Product and Service Codes, e.g. \"DA01\" or \"R425\" (contracts and IDVs only).",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "Place of performance states",
            "type": "array",
            "description": "Optional 2-letter US state codes for where the work is done, e.g. \"VA\", \"CA\".",
            "items": {
              "type": "string"
            }
          },
          "minAmount": {
            "title": "Minimum award amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional: skip awards smaller than this amount."
          },
          "maxCompanies": {
            "title": "Max companies per run",
            "minimum": 1,
            "type": "integer",
            "description": "Safety cap on companies processed in one run (default 200).",
            "default": 200
          },
          "datasetId": {
            "title": "Dataset ID",
            "type": "string",
            "description": "Optional: read company names from another Actor's dataset (e.g. a lead list). The name field is auto-detected (companyName, company, organization, legalName, name, uei) or set companyField."
          },
          "companyField": {
            "title": "Company field",
            "type": "string",
            "description": "Field in that dataset holding the company name or UEI. Dot paths work (e.g. company.name)."
          },
          "datasetMaxItems": {
            "title": "Max companies from dataset",
            "minimum": 1,
            "type": "integer",
            "description": "Most companies read from the dataset (default 100).",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}