What It Returns
{
"caption": "A black leather sneaker with white rubber sole and lace-up design",
"alt_text": "Black leather lace-up sneaker on white background",
"tags": ["sneaker", "black", "leather", "shoes", "footwear", "lace-up", "casual"],
"structured": {
"short_description": "Black leather sneaker with white rubber sole",
"seo_title": "Black Leather Lace-Up Sneaker | Premium Footwear",
"meta_description": "Shop our black leather sneaker with white rubber sole and lace-up design. Perfect for casual and street wear."
},
"mode": "full",
"style": "product"
}
Python Example
import requests, time
API_KEY = "YOUR_API_KEY"
BASE = "https://api.pixelapi.dev"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}
def caption_product(image_path: str, mode: str = "full") -> dict:
"""Generate caption, tags, and alt text for a product image."""
with open(image_path, "rb") as f:
r = requests.post(
f"{BASE}/v1/image/caption",
headers=HEADERS,
files={"image": f},
data={"mode": mode, "style": "product", "max_tags": 15}
)
r.raise_for_status()
gen_id = r.json()["generation_id"]
# Wait for result
for _ in range(30):
status = requests.get(f"{BASE}/v1/generation/{gen_id}", headers=HEADERS).json()
if status["status"] == "completed":
result = requests.get(status["output_url"]).json()
return result
time.sleep(1)
# Example: Auto-fill product listing
result = caption_product("product.jpg")
print("📝 Description:", result["caption"])
print("🔍 Alt Text:", result["alt_text"])
print("🏷️ SEO Tags:", ", ".join(result["tags"]))
print("📄 SEO Title:", result["structured"]["seo_title"])
# Bulk: Auto-describe entire catalog
from pathlib import Path
import concurrent.futures
images = list(Path("catalog/").glob("*.jpg"))
def process(img):
data = caption_product(str(img))
return {"file": img.name, "caption": data["caption"], "tags": data["tags"]}
with concurrent.futures.ThreadPoolExecutor(max_workers=5) as pool:
all_results = list(pool.map(process, images))
# Export to CSV for Shopify/WooCommerce import
import csv
with open("product_descriptions.csv", "w", newline="") as csvf:
writer = csv.DictWriter(csvf, fieldnames=["file","caption","tags"])
writer.writeheader()
writer.writerows(all_results)
print(f"✅ Generated descriptions for {len(all_results)} products")
print(f" Cost: ${len(all_results) * 0.005:.2f}")
💡 Use case: Meesho / Flipkart / Amazon sellers can use this to auto-fill product listings when uploading new inventory. Upload 500 product photos → get 500 ready-to-publish descriptions and tags in minutes, for $2.50.
Auto-Tag Your Entire Product Catalog
100 free credits on signup. No credit card required.
Start Free →