{
  "openapi": "3.0.1",
  "info": {
    "title": "US Federal Contractor Profile",
    "description": "Look up a US federal contractor by company name, UEI, or CAGE code. Returns the USAspending recipient and award-history summary. SAM.gov registration and exclusion checks are coming later (no key yet).",
    "version": "0.1",
    "x-build-id": "2KBNHKua9PKjWUesO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mikee368~us-contractor-profile/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mikee368-us-contractor-profile",
        "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/mikee368~us-contractor-profile/runs": {
      "post": {
        "operationId": "runs-sync-mikee368-us-contractor-profile",
        "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/mikee368~us-contractor-profile/run-sync": {
      "post": {
        "operationId": "run-sync-mikee368-us-contractor-profile",
        "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": {
          "companies": {
            "title": "Company name, UEI, or CAGE",
            "type": "array",
            "description": "One company per line. A 12-character UEI (letters and digits, no I or O) is looked up as a UEI. A 5-character token is looked up as a CAGE code. Anything else is a company name. A CAGE code can be resolved only when SAM_GOV_API_KEY is set.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "names": {
            "title": "Company names",
            "type": "array",
            "description": "Company names to look up on USAspending. Use this when chaining from us-federal-tender-monitor (awardee name), sec-edgar-filings-watch (companyName), or fmcsa-carrier-watch (legalName).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "ueis": {
            "title": "UEIs",
            "type": "array",
            "description": "12-character Unique Entity IDs. Same value this Actor writes as uei and ueiSAM.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "cageCodes": {
            "title": "CAGE codes",
            "type": "array",
            "description": "5-character CAGE codes. Resolved through SAM.gov when SAM_GOV_API_KEY is set, then enriched from USAspending.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "lookup",
              "watch"
            ],
            "type": "string",
            "description": "lookup returns one profile per company. watch does the same and also emits an alert when a registration expires within Expiry window days, is already expired, or a new exclusion appears. The same alert is not repeated on the next run with the same Watchlist ID.",
            "default": "lookup"
          },
          "expiryWithinDays": {
            "title": "Expiry window (days)",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Flag registrationExpiring when the SAM.gov registration expiration date is within this many days. Already-expired registrations are flagged as registrationExpired. Used in both modes; watch mode also emits an alert row.",
            "default": 90
          },
          "watchlistId": {
            "title": "Watchlist ID",
            "type": "string",
            "description": "Name of the saved watch snapshot. Use one ID per list. State is one gzipped record in the named key-value store us-contractor-profile-state.",
            "default": "default"
          },
          "awardFiscalYears": {
            "title": "Award history window (fiscal years)",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many federal fiscal years of USAspending award history to summarize, counting the current fiscal year. 3 on 5 Oct 2026 covers FY2025 through FY2027.",
            "default": 3
          },
          "maxAwards": {
            "title": "Top awards to include",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Largest awards to list in topAwards, inside the fiscal-year window. 0 skips that request.",
            "default": 5
          },
          "includeExclusions": {
            "title": "Check SAM.gov exclusions",
            "type": "boolean",
            "description": "When a SAM.gov key is set, one batched exclusions request covers every company in the run. Turn off to spend that request only on registration.",
            "default": true
          },
          "maxCompanies": {
            "title": "Max companies",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum companies looked up in this run (1-100). Extra lines are counted and skipped.",
            "default": 25
          },
          "samGovApiKey": {
            "title": "SAM.gov API key",
            "type": "string",
            "description": "Optional. Leave empty to use the SAM_GOV_API_KEY environment variable or Apify secret. When neither is set, SAM.gov registration and exclusions are not checked and USAspending data is still returned."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}