{
  "openapi": "3.0.1",
  "info": {
    "title": "TTB COLA Registry Scraper",
    "description": "Scrape the US Treasury's TTB public COLA registry - approved beer, wine and spirits label applications. Search by brand/fanciful name, category, origin, permit, or date; fetch by TTB ID. Get applicant details, formulas, and label images.",
    "version": "1.0",
    "x-build-id": "sagRbByp6UfbGQEmi"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~ttb-cola-registry-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-ttb-cola-registry-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/crawlerbros~ttb-cola-registry-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-ttb-cola-registry-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/crawlerbros~ttb-cola-registry-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-ttb-cola-registry-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "byTtbId"
            ],
            "type": "string",
            "description": "What to fetch.",
            "default": "search"
          },
          "productOrFancifulName": {
            "title": "Product / brand / fanciful name (mode=search)",
            "type": "string",
            "description": "Free-text match against the label's brand name and/or fanciful name. Substring matching is automatic (no need to add % wildcards yourself).",
            "default": "whiskey"
          },
          "productNameSearchType": {
            "title": "Match name against",
            "enum": [
              "E",
              "B",
              "F"
            ],
            "type": "string",
            "description": "Which name field `productOrFancifulName` should match.",
            "default": "E"
          },
          "dateCompletedFrom": {
            "title": "Date completed — from (MM/DD/YYYY)",
            "type": "string",
            "description": "Start of the COLA completion-date range. TTB requires a date range for every search except a direct TTB ID lookup, and rejects any span greater than 15 years.",
            "default": "01/01/2015"
          },
          "dateCompletedTo": {
            "title": "Date completed — to (MM/DD/YYYY)",
            "type": "string",
            "description": "End of the COLA completion-date range (<= 15 years after `dateCompletedFrom`).",
            "default": "12/31/2024"
          },
          "productCategory": {
            "title": "Product category",
            "enum": [
              "",
              "WINE",
              "WHISKY",
              "GIN",
              "VODKA",
              "RUM",
              "BRANDY",
              "CORDIALS_AND_LIQUEURS",
              "COCKTAILS_AND_MIXED_DRINKS",
              "MALT_BEVERAGES_DOMESTIC",
              "MALT_BEVERAGES_IMPORTED",
              "OTHER_SPIRITS_DOMESTIC",
              "TEQUILA_MEZCAL_AND_OTHER_IMPORTED_SPIRITS"
            ],
            "type": "string",
            "description": "Curated beverage category, mapped internally to the matching TTB class/type code range. Leave blank for any category, or use `classTypeCode` below for an exact 3-digit TTB code.",
            "default": ""
          },
          "classTypeCode": {
            "title": "Exact TTB class/type code (advanced)",
            "type": "string",
            "description": "Exact 3-digit TTB class/type code (e.g. `101` = Straight Bourbon Whisky). Overrides `productCategory` when set. Full code list: ttbonline.gov COLAs Online > Advanced Search > Lookup Class Type."
          },
          "originCode": {
            "title": "Origin (US state or country)",
            "enum": [
              "",
              "ZY",
              "10",
              "4E",
              "60",
              "61",
              "00",
              "7Q",
              "4Y",
              "62",
              "11",
              "12",
              "6A",
              "4P",
              "63",
              "64",
              "6B",
              "4G",
              "4H",
              "6C",
              "65",
              "7D",
              "8K",
              "4C",
              "9I",
              "66",
              "8E",
              "9U",
              "67",
              "68",
              "9B",
              "4X",
              "01",
              "4N",
              "7L",
              "69",
              "9A",
              "70",
              "96",
              "71",
              "13",
              "14",
              "6Z",
              "6Y",
              "4I",
              "72",
              "5Y",
              "73",
              "15",
              "9C",
              "55",
              "4K",
              "DO",
              "4D",
              "7A",
              "98",
              "74",
              "5A",
              "6P",
              "4M",
              "6D",
              "9S",
              "5Q",
              "FI",
              "4W",
              "97",
              "16",
              "51",
              "9G",
              "08",
              "6E",
              "53",
              "7H",
              "4U",
              "57",
              "5T",
              "7R",
              "9Q",
              "5M",
              "9K",
              "5P",
              "5N",
              "17",
              "6U",
              "5L",
              "75",
              "5H",
              "18",
              "04",
              "5I",
              "19",
              "7B",
              "20",
              "9T",
              "5E",
              "56",
              "50",
              "5W",
              "5J",
              "59",
              "77",
              "21",
              "6F",
              "22",
              "4J",
              "4L",
              "6G",
              "8C",
              "6H",
              "5F",
              "78",
              "8L",
              "6I",
              "23",
              "79",
              "9E",
              "24",
              "9M",
              "80",
              "7F",
              "25",
              "26",
              "8H",
              "81",
              "06",
              "27",
              "28",
              "29",
              "6J",
              "3A",
              "7Y",
              "30",
              "9N",
              "82",
              "MC",
              "7Z",
              "8D",
              "31",
              "7V",
              "83",
              "32",
              "33",
              "03",
              "34",
              "02",
              "84",
              "4F",
              "5V",
              "35",
              "36",
              "7G",
              "6W",
              "5C",
              "09",
              "37",
              "38",
              "6V",
              "9P",
              "7E",
              "8F",
              "39",
              "85",
              "5S",
              "99",
              "54",
              "4A",
              "7C",
              "8M",
              "9R",
              "7X",
              "40",
              "86",
              "RW",
              "7W",
              "7M",
              "9H",
              "6T",
              "5K",
              "9D",
              "7P",
              "8N",
              "5R",
              "8I",
              "5O",
              "6X",
              "7J",
              "91",
              "41",
              "42",
              "5D",
              "52",
              "7U",
              "3B",
              "8B",
              "9F",
              "5B",
              "87",
              "SY",
              "4V",
              "8A",
              "6L",
              "4R",
              "43",
              "44",
              "5G",
              "6R",
              "6S",
              "4Z",
              "TZ",
              "7K",
              "89",
              "90",
              "6M",
              "4S",
              "6N",
              "92",
              "93",
              "45",
              "6O",
              "95",
              "46",
              "5Z",
              "4B",
              "05",
              "6Q",
              "07",
              "8J",
              "7T",
              "47",
              "48",
              "49",
              "58",
              "8G",
              "5U"
            ],
            "type": "string",
            "description": "Restrict results to labels originating from a specific US state or country.",
            "default": ""
          },
          "permitId": {
            "title": "Plant registry / basic permit number",
            "type": "string",
            "description": "Restrict results to a specific producer's permit/plant number (e.g. `DSP-CO-20073`)."
          },
          "vendorCode": {
            "title": "Vendor code",
            "type": "string",
            "description": "Restrict results to a specific TTB vendor code."
          },
          "ttbIdFrom": {
            "title": "TTB ID range — from",
            "type": "string",
            "description": "Lower bound of a TTB ID range (14-digit COLA identifier)."
          },
          "ttbIdTo": {
            "title": "TTB ID range — to",
            "type": "string",
            "description": "Upper bound of a TTB ID range."
          },
          "serialNumFrom": {
            "title": "Serial number range — from",
            "type": "string",
            "description": "Lower bound of the applicant's internal serial-number range."
          },
          "serialNumTo": {
            "title": "Serial number range — to",
            "type": "string",
            "description": "Upper bound of the applicant's internal serial-number range."
          },
          "statusFilter": {
            "title": "COLA status",
            "enum": [
              "",
              "APPROVED",
              "DENIED",
              "SURRENDERED/REVOKED"
            ],
            "type": "string",
            "description": "Only emit COLAs with this status (client-side filter, applied after fetching detail data).",
            "default": ""
          },
          "ttbIds": {
            "title": "TTB IDs (mode=byTtbId)",
            "type": "array",
            "description": "One or more 14-digit TTB IDs to fetch directly, e.g. `24159001000118`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeApplicantDetails": {
            "title": "Include applicant/detail fields",
            "type": "boolean",
            "description": "Fetch each COLA's detail page for status, applicant name/address, contact info, formula, and qualifications. Adds one extra request per record.",
            "default": true
          },
          "includeLabelImages": {
            "title": "Include label images",
            "type": "boolean",
            "description": "Fetch each COLA's approved label image(s) and re-host them in this run's key-value store. Adds one extra request per record plus one per image.",
            "default": true
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Hard cap on emitted records. TTB's own search results window shows at most 1000 matches per query.",
            "default": 20
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}