{
  "openapi": "3.0.1",
  "info": {
    "title": "USAspending Scraper - Federal Contracts and Expiring Contracts",
    "description": "Extract federal contract awards from USAspending.gov with recipient, agency, NAICS, PSC, amounts, end dates and option ceilings. Find contracts ending soon for recompete leads. Official data, no API key needed.",
    "version": "0.1",
    "x-build-id": "8O2gk1khFgpUVZq53"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/publicrecords101~usaspending-contracts-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-publicrecords101-usaspending-contracts-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/publicrecords101~usaspending-contracts-scraper/runs": {
      "post": {
        "operationId": "runs-sync-publicrecords101-usaspending-contracts-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/publicrecords101~usaspending-contracts-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-publicrecords101-usaspending-contracts-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": {
          "endingWithinDays": {
            "title": "Ending within (days)",
            "minimum": 1,
            "type": "integer",
            "description": "Only contracts whose current period of performance ends between today and this many days from now, earliest first. Use it to find contracts coming up for recompete. Leave empty for all contracts."
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "Only contracts under these NAICS industry codes (2 to 6 digits; shorter codes include everything below them), e.g. 541511 custom programming, 5415 computer systems design. Leave empty for all industries.",
            "items": {
              "type": "string"
            }
          },
          "pscCodes": {
            "title": "Product or service (PSC) codes",
            "type": "array",
            "description": "Only contracts with these product and service codes, e.g. D301 or R425. Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Words searched across award descriptions and other text fields, e.g. cybersecurity, janitorial. Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "awardingAgencies": {
            "title": "Awarding agencies",
            "type": "array",
            "description": "Only contracts awarded by these departments, written exactly as USAspending names them, e.g. Department of Defense, Department of Veterans Affairs, General Services Administration. Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "placeOfPerformanceStates": {
            "title": "Place of performance (states)",
            "type": "array",
            "description": "Only contracts performed in these US states, as two-letter codes, e.g. VA, TX. Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "recipientSearch": {
            "title": "Recipient (contractor)",
            "type": "string",
            "description": "Only contracts whose recipient name, UEI or DUNS matches this text, e.g. Booz Allen."
          },
          "minAmount": {
            "title": "Minimum obligated amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only contracts with at least this much obligated."
          },
          "actionDateFrom": {
            "title": "Actions since",
            "type": "string",
            "description": "Only contracts with an award or modification on or after this date (YYYY-MM-DD). USAspending search covers 2007-10-01 onwards."
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "amount",
              "lastModified",
              "endDate",
              "startDate"
            ],
            "type": "string",
            "description": "Order of results when 'Ending within' is empty. 'Ending within' always sorts by end date, earliest first.",
            "default": "amount"
          },
          "includeDetails": {
            "title": "Include award details",
            "type": "boolean",
            "description": "Fetch each contract's full record: value with all options (ceiling), potential end date, set-aside, competition, number of offers, solicitation id, parent contract vehicle and recipient UEI. Turn off for a faster list.",
            "default": true
          },
          "onlyNew": {
            "title": "Only new or updated",
            "type": "boolean",
            "description": "Skip contracts your earlier runs with the same filters already returned, unless USAspending recorded a change since. Use with a schedule for alerts.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many contracts.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}