Skip to main content

Installation

pip install colacloud
Requires Python 3.9+.

Quick Start

from colacloud import ColaCloud

client = ColaCloud(api_key="cola_xxxx")

# Search COLAs
results = client.colas.list(
    brand_name="Tito's",
    product_type="distilled spirits",
    per_page=10
)

for cola in results.data:
    print(f"{cola.brand_name} - {cola.product_name}")

# Get a specific COLA with images and barcodes
cola = client.colas.get("24001001000001")
print(cola.images[0].image_url)

# Barcode lookup
matches = client.barcode.lookup("012345678901")
print(f"Found {matches.total_colas} COLAs")

Auto-Pagination

Iterate through all matching results without managing pages:
for cola in client.colas.iterate(q="bourbon"):
    print(f"{cola.ttb_id}: {cola.brand_name}")

for permittee in client.permittees.iterate(state="CA"):
    print(f"{permittee.company_name}: {permittee.colas} COLAs")

Permittees

# Search permittees
results = client.permittees.list(state="NY", is_active=True)
for p in results.data:
    print(f"{p.company_name} ({p.permit_number})")

# Get a single permittee with recent COLAs
permittee = client.permittees.get("NY-I-12345")
print(f"Recent COLAs: {len(permittee.recent_colas)}")

Usage Stats

usage = client.get_usage()
print(f"{usage.requests_used} / {usage.monthly_limit} requests used")

Rate Limit Info

Access rate limit info from the most recent API response:
results = client.colas.list(q="wine")
rl = client.rate_limit_info
print(f"Remaining: {rl.remaining}")

Async Support

import asyncio
from colacloud import AsyncColaCloud

async def main():
    client = AsyncColaCloud(api_key="cola_xxxx")
    results = await client.colas.list(brand_name="Maker's Mark")
    print(f"Found {results.pagination.total} results")

    # Async iteration
    async for cola in client.colas.iterate(q="bourbon"):
        print(cola.brand_name)

asyncio.run(main())

Authentication

Pass your API key directly to the client:
client = ColaCloud(api_key="cola_xxxx")