{
  "openapi": "3.0.1",
  "info": {
    "title": "Federal Contracts Spending Scraper - USAspending.gov",
    "description": "Scrape USAspending.gov federal contracts by company name: award amounts, agencies, dates, transactions, subawards, funding accounts, recipient profiles and spending by agency, NAICS, PSC, state and fiscal year. Export CSV, Excel, JSON. No login or API key. 10 record types.",
    "version": "0.1",
    "x-build-id": "UkhjxOVwe68iF4ZND"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/recordsdata~federal-contracts-spending-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-recordsdata-federal-contracts-spending-scraper",
        "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/recordsdata~federal-contracts-spending-scraper/runs": {
      "post": {
        "operationId": "runs-sync-recordsdata-federal-contracts-spending-scraper",
        "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/recordsdata~federal-contracts-spending-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-recordsdata-federal-contracts-spending-scraper",
        "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": {
          "companyName": {
            "title": "Company or recipient name",
            "type": "string",
            "description": "Name, UEI or DUNS of the company that received the awards. Example: Lockheed Martin, Boeing, Palantir. Leave empty to search only by keywords or filters."
          },
          "keywords": {
            "title": "Keywords in the award description",
            "type": "array",
            "description": "Words searched in award descriptions. An award matches if it contains any of them. Example: satellite, cybersecurity.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "awardTypes": {
            "title": "Award types",
            "type": "array",
            "description": "Which kinds of federal awards to return. Contracts is the default. Contract-only columns (NAICS, PSC) are empty for grants and loans.",
            "items": {
              "type": "string",
              "enum": [
                "contracts",
                "idvs",
                "grants",
                "direct_payments",
                "loans",
                "other"
              ],
              "enumTitles": [
                "Contracts (purchase orders, delivery orders, definitive contracts)",
                "IDVs (indefinite-delivery vehicles, GWACs, BPAs)",
                "Grants and cooperative agreements",
                "Direct payments",
                "Loans and loan guarantees",
                "Other financial assistance (insurance and similar)"
              ]
            },
            "default": [
              "contracts"
            ]
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Start of the range. Example: 2025-01-31, or relative values like 30d, 6m, 5y, ytd, last 90 days."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "End of the range, included. Same formats as Date from. Empty means today."
          },
          "dateType": {
            "title": "Which date to compare",
            "enum": [
              "date_signed",
              "action_date",
              "last_modified_date"
            ],
            "type": "string",
            "description": "Date signed finds new awards, Action date finds any transaction in the range, Last modified finds changed awards (best for monitoring).",
            "default": "date_signed"
          },
          "minAmount": {
            "title": "Minimum award amount (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Only awards worth at least this many dollars. Example: 1000000."
          },
          "maxAmount": {
            "title": "Maximum award amount (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Only awards worth at most this many dollars. Example: 50000000."
          },
          "awardingAgency": {
            "title": "Awarding agency",
            "type": "string",
            "description": "Agency that made the award. Example: Department of Defense, DOD, NASA, HHS or code 097."
          },
          "awardingSubAgency": {
            "title": "Awarding sub-agency",
            "type": "string",
            "description": "Bureau that made the award. Example: Department of the Navy, National Institutes of Health. Replaces the agency match when both are set."
          },
          "fundingAgency": {
            "title": "Funding agency",
            "type": "string",
            "description": "Agency that paid for the award (can differ from the awarding agency). Same formats as Awarding agency."
          },
          "naicsCodes": {
            "title": "Industry codes (NAICS)",
            "type": "array",
            "description": "Codes of 2 to 6 digits. A short code matches all codes starting with it. Example: 336411 (aircraft manufacturing), 5415 (computer systems design).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "pscCodes": {
            "title": "Product and service codes (PSC)",
            "type": "array",
            "description": "Codes of 1 to 4 characters. Example: 1510 (fixed-wing aircraft), R425 (engineering support), D3 (IT services).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "Place of performance (US states)",
            "type": "array",
            "description": "Two-letter codes or full names. Example: TX, CA, DC, Texas.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort results by",
            "enum": [
              "amount",
              "lastModified",
              "startDate"
            ],
            "type": "string",
            "description": "Amount lists biggest awards first; Last modified lists newest changes first (best with monitor mode); Start date lists by award start.",
            "default": "amount"
          },
          "sortOrder": {
            "title": "Sort direction",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "Descending (largest or newest first) or ascending.",
            "default": "desc"
          },
          "maxItems": {
            "title": "Max awards to return",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Stops after this many awards. Free plan capped at 10, paid up to 1,000,000. Example: 100.",
            "default": 10
          },
          "includeTransactions": {
            "title": "Add transaction history (+1 event per transaction)",
            "type": "boolean",
            "description": "Every modification on the award, with date, type and description.",
            "default": false
          },
          "maxTransactions": {
            "title": "Max transactions per award",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Used only when Transaction history is on. Newest first. Example: 20.",
            "default": 20
          },
          "includeSubawards": {
            "title": "Add subawards (+1 event per subaward)",
            "type": "boolean",
            "description": "Subcontractors paid out of the award, with name, amount and description.",
            "default": false
          },
          "maxSubawards": {
            "title": "Max subawards per award",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Used only when Subawards is on. Example: 20.",
            "default": 20
          },
          "includeFunding": {
            "title": "Add federal account funding (+1 event per account)",
            "type": "boolean",
            "description": "Federal accounts and agencies funding the award, with object class.",
            "default": false
          },
          "maxFundingRecords": {
            "title": "Max funding records per award",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Used only when Federal account funding is on. Example: 20.",
            "default": 20
          },
          "includeRecipientProfile": {
            "title": "Add recipient profile (+1 event per recipient)",
            "type": "boolean",
            "description": "The recipient's overall federal profile: UEI/DUNS, business types, location, total federal transaction amount and count. One row per unique recipient, billed as recipient-profile-record.",
            "default": false
          },
          "includeAgencyBreakdown": {
            "title": "Add spending by agency (+1 event per agency)",
            "type": "boolean",
            "description": "The recipient's total federal spending broken down by awarding agency (for the award types returned, whole history, not limited by the date or amount filters). Billed per agency as agency-breakdown-record.",
            "default": false
          },
          "includeNaicsBreakdown": {
            "title": "Add spending by industry, NAICS (+1 event per code)",
            "type": "boolean",
            "description": "The recipient's total federal spending broken down by NAICS industry code (contracts and IDVs). Billed per code as naics-breakdown-record.",
            "default": false
          },
          "includePscBreakdown": {
            "title": "Add spending by product/service, PSC (+1 event per code)",
            "type": "boolean",
            "description": "The recipient's total federal spending broken down by PSC product/service code (contracts and IDVs). Billed per code as psc-breakdown-record.",
            "default": false
          },
          "includeStateBreakdown": {
            "title": "Add spending by state (+1 event per state)",
            "type": "boolean",
            "description": "The recipient's total federal spending broken down by state/territory of performance. Billed per state as state-breakdown-record.",
            "default": false
          },
          "includeSpendingByYear": {
            "title": "Add spending by fiscal year (+1 event per year)",
            "type": "boolean",
            "description": "The recipient's total federal spending as a fiscal-year time series. Billed per year as spending-by-year-record.",
            "default": false
          },
          "onlyNew": {
            "title": "Only awards not delivered before",
            "type": "boolean",
            "description": "Skipped awards are not fetched and not billed. Pair with Sort by Last modified or a recent Date from.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor name",
            "type": "string",
            "description": "Optional label for separate memories with identical filters. Example: sales-team, legal-team.",
            "default": ""
          },
          "resetSeen": {
            "title": "Reset monitor memory before this run",
            "type": "boolean",
            "description": "Forget delivered awards and start over. Turn it off again after one run.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}