{
  "openapi": "3.0.1",
  "info": {
    "title": "Federal Contracts Spending Scraper - USAspending.gov",
    "description": "Federal award and contract spending data: awards, transactions, subawards, funding, recipient profiles and spending breakdowns by agency, industry, product/service code, state and fiscal year. Export to CSV, Excel, JSON.",
    "version": "0.1",
    "x-build-id": "duurR2CoLb5mvPER0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/punkrecordsdata~federal-contracts-spending-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-punkrecordsdata-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/punkrecordsdata~federal-contracts-spending-scraper/runs": {
      "post": {
        "operationId": "runs-sync-punkrecordsdata-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/punkrecordsdata~federal-contracts-spending-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-punkrecordsdata-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 (e.g. \"Lockheed Martin\"). Matched against USAspending.gov's own recipient names."
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of award-record rows to deliver. Free users: limited to 10 (preview). Paid users: optional, max 1,000,000."
          },
          "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. 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. 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. 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
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}