{
  "openapi": "3.0.1",
  "info": {
    "title": "US Federal Contract Awards API",
    "description": "Who won which US federal contracts: awards from the official USAspending.gov API with recipient, UEI, parent company, agency, NAICS, PSC, amount, set-aside and competition. Filter by keyword, NAICS, PSC, agency, recipient, date and amount. Grants optional. $1.50 per 1,000.",
    "version": "0.1",
    "x-build-id": "ffYLFef66SJm5qbXB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlwren~us-federal-awards/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlwren-us-federal-awards",
        "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/crawlwren~us-federal-awards/runs": {
      "post": {
        "operationId": "runs-sync-crawlwren-us-federal-awards",
        "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/crawlwren~us-federal-awards/run-sync": {
      "post": {
        "operationId": "run-sync-crawlwren-us-federal-awards",
        "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": {
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Awards whose description, recipient or other text matches ANY of these (USAspending full-text search, at least 3 characters each). Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "awardTypes": {
            "title": "Award types",
            "type": "array",
            "description": "Contracts (BPA calls, purchase orders, delivery orders, definitive contracts) are the default. Grants (block, formula, project grants and cooperative agreements) are optional.",
            "items": {
              "type": "string",
              "enum": [
                "contracts",
                "grants"
              ],
              "enumTitles": [
                "Contracts",
                "Grants and cooperative agreements"
              ]
            },
            "default": [
              "contracts"
            ]
          },
          "naicsCodes": {
            "title": "NAICS codes (contracts)",
            "type": "array",
            "description": "Prefix match, e.g. 5415 = computer systems design, 541512 = exactly that code. Applied by USAspending.",
            "items": {
              "type": "string"
            }
          },
          "pscCodes": {
            "title": "PSC codes (contracts)",
            "type": "array",
            "description": "Product/Service Code prefixes, e.g. D3 (IT and telecom) or DA01. Applied after the search, so use with keywords, NAICS or an agency to keep runs short.",
            "items": {
              "type": "string"
            }
          },
          "agencies": {
            "title": "Awarding agencies",
            "type": "array",
            "description": "Exact top-tier agency names as USAspending spells them, e.g. 'Department of Veterans Affairs', 'Department of Defense', 'General Services Administration'.",
            "items": {
              "type": "string"
            }
          },
          "recipients": {
            "title": "Recipients",
            "type": "array",
            "description": "Recipient name text or UEI, e.g. 'Leidos' or 'UER4AJLUB8D5'.",
            "items": {
              "type": "string"
            }
          },
          "dateType": {
            "title": "Date meaning",
            "enum": [
              "new_awards",
              "action_date",
              "last_modified"
            ],
            "type": "string",
            "description": "New awards: awards first signed in the window (best for alerts). Action date: any award with a transaction (new award or modification) in the window. Last modified: records updated in the window.",
            "default": "new_awards"
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Window size ending today (UTC). Ignored when 'From date' is set. USAspending usually lags a few days behind the signing date.",
            "default": 7
          },
          "dateFrom": {
            "title": "From date",
            "type": "string",
            "description": "Start of the window (YYYY-MM-DD, earliest 2007-10-01). Overrides 'Days back'."
          },
          "dateTo": {
            "title": "To date",
            "type": "string",
            "description": "End of the window (YYYY-MM-DD). Default: today."
          },
          "minAmount": {
            "title": "Minimum amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only awards with at least this obligated amount."
          },
          "maxAmount": {
            "title": "Maximum amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only awards up to this obligated amount."
          },
          "sortBy": {
            "title": "Order",
            "enum": [
              "newest",
              "amount"
            ],
            "type": "string",
            "description": "Which awards come first (and so which ones maxResults keeps).",
            "default": "newest"
          },
          "includeDetails": {
            "title": "Include award details",
            "type": "boolean",
            "description": "One extra request per award for the parent company, parent contract vehicle (IDV), set-aside, competition, number of offers, pricing type and potential value. Turn off for faster, larger pulls.",
            "default": true
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Stop after this many awards (you're charged per award delivered).",
            "default": 100
          },
          "maxPages": {
            "title": "Max search pages per award type",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Each page is 100 search rows. Safety cap on long runs.",
            "default": 10
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}