{
  "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": "EdafSiOUEdbBbShXs"
  },
  "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 / recipient name",
            "type": "string",
            "description": "Company or organization name to search on USAspending.gov (for example \"Lockheed Martin\", \"Boeing\", \"Palantir\"). Matched against official federal recipient names, UEI and DUNS numbers. Optional when another filter is set: leave it empty to search by agency, keywords, dates, amounts or codes only."
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Words or phrases searched in award descriptions and related text (for example \"satellite\", \"cybersecurity\"). An award matches when it contains any of the keywords.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "awardTypes": {
            "title": "Award types",
            "type": "array",
            "description": "Which kinds of federal awards to return. Contracts is the original behaviour. Each type is searched separately and results are merged by the chosen sort. Contract-only columns (NAICS, PSC, pricing, set-aside) are empty for grants, loans and payments; assistance columns (CFDA program) are empty for contracts.",
            "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 date range. Use YYYY-MM-DD (2025-01-31) or a relative value: today, yesterday, ytd, 30d, 12w, 6m, 5y, \"last 90 days\". Which date is compared is set by Date type. USAspending search starts on 2007-10-01."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "End of the date range (included). Same formats as Date from. Empty means today when Date from is set."
          },
          "dateType": {
            "title": "Date type",
            "enum": [
              "date_signed",
              "action_date",
              "last_modified_date"
            ],
            "type": "string",
            "description": "Which date the range is applied to: the date the award was signed (new awards), any transaction on the award inside the range (activity), or the date the record was last modified (changed awards, best for monitoring).",
            "default": "date_signed"
          },
          "awardingAgency": {
            "title": "Awarding agency",
            "type": "string",
            "description": "Federal top-tier agency that made the award: full name (\"Department of Defense\"), abbreviation (\"DOD\", \"NASA\", \"HHS\") or code (\"097\"). A misspelled agency stops the run before any request and lists the closest names."
          },
          "awardingSubAgency": {
            "title": "Awarding sub-agency",
            "type": "string",
            "description": "Sub-agency or bureau that made the award, for example \"Department of the Navy\", \"National Institutes of Health\", \"Defense Logistics Agency\". Replaces the agency match when both are set (the agency then only disambiguates the name)."
          },
          "fundingAgency": {
            "title": "Funding agency",
            "type": "string",
            "description": "Federal top-tier agency that paid for the award (can differ from the awarding agency). Same formats as Awarding agency."
          },
          "minAmount": {
            "title": "Minimum amount (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Only awards worth at least this many US dollars (for example 1000000). For loans the amount is the loan value."
          },
          "maxAmount": {
            "title": "Maximum amount (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Only awards worth at most this many US dollars (for example 50000000)."
          },
          "naicsCodes": {
            "title": "NAICS industry codes",
            "type": "array",
            "description": "NAICS codes of 2 to 6 digits, for example 336411 (aircraft manufacturing) or 5415 (computer systems design). A shorter code matches every code that starts with it. Assistance award types are skipped when this is set.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "pscCodes": {
            "title": "PSC product/service codes",
            "type": "array",
            "description": "Product and service codes of 1 to 4 characters, for example 1510 (fixed-wing aircraft), R425 (engineering support) or D3 (IT services). A shorter code matches every code that starts with it. Assistance award types are skipped when this is set.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "Place of performance (states)",
            "type": "array",
            "description": "Only awards performed in these US states or territories: two-letter codes (TX, CA, DC, PR) or full names (Texas).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "amount",
              "lastModified",
              "startDate"
            ],
            "type": "string",
            "description": "Order of the awards. Amount lists the biggest awards first. Last modified lists the most recently changed awards first (best with Only new awards). Start date lists by the start of the award (issue date for loans).",
            "default": "amount"
          },
          "sortOrder": {
            "title": "Sort order",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "Descending (largest or newest first) or ascending.",
            "default": "desc"
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of award rows to return in the chosen order (for example 10 or 100). Free users are limited to 10 (preview). Paid users can request up to 1,000,000. Each award row is billed as one award-record event.",
            "default": 10
          },
          "includeTransactions": {
            "title": "Transaction history",
            "type": "boolean",
            "description": "Every modification/transaction on the award, with date, type and description. Billed per transaction as transaction-record.",
            "default": false
          },
          "maxTransactions": {
            "title": "Max transactions per award",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many of the most recent transactions to pull per award when Transaction history is on.",
            "default": 20
          },
          "includeSubawards": {
            "title": "Subawards",
            "type": "boolean",
            "description": "Subcontractors paid out of the award, with name, amount and description. Billed per subaward as subaward-record.",
            "default": false
          },
          "maxSubawards": {
            "title": "Max subawards per award",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many subawards to pull per award when Subawards is on.",
            "default": 20
          },
          "includeFunding": {
            "title": "Federal account funding",
            "type": "boolean",
            "description": "Federal accounts and agencies funding the award, with object class. Billed per account record as federal-account-record.",
            "default": false
          },
          "maxFundingRecords": {
            "title": "Max funding records per award",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many federal account funding records to pull per award when Federal account funding is on.",
            "default": 20
          },
          "includeRecipientProfile": {
            "title": "Recipient profile",
            "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": "Spending by 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": "Spending by industry (NAICS)",
            "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": "Spending by product/service (PSC)",
            "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": "Spending by 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": "Spending by fiscal 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 new awards",
            "type": "boolean",
            "description": "Skip awards already delivered by earlier runs of the same search. Skipped awards are not fetched and not billed. Use Sort by Last modified (or a recent Date from) so new awards come first.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor name",
            "type": "string",
            "description": "Optional label that keeps separate memories for runs with identical filters (for example \"sales-team\" and \"legal-team\"). Leave empty to share one memory per search.",
            "default": ""
          },
          "resetSeen": {
            "title": "Reset monitor memory",
            "type": "boolean",
            "description": "Forget which awards were already delivered for this search 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}