Tech With Galvan
Back to Articles
AutomationAug 24, 2029 • 5 min read

How to Generate Product Descriptions in Bulk With AI

Generate hundreds of product descriptions with AI — Python script, prompts, and quality control. For e-commerce stores and catalogs.

Galvan
Galvan

Founder & Creator

Introduction

Writing product descriptions for 500 products takes weeks. AI can do it in hours — with consistent quality, SEO optimization, and your brand voice. This post shows you how to generate bulk product descriptions with Python and AI.

Step 1: Prepare your product data

Create a CSV with product information:

product_name,category,features,price,brand
Wireless Mouse Pro,Electronics,"Ergonomic, Bluetooth 5.0, 6 buttons, USB-C charging",2499,Logitech
Cotton T-Shirt Men,Clothing,"100% cotton, slim fit, breathable, machine washable",599,H&M
Stainless Steel Water Bottle,Home,"500ml, insulated, leak-proof, BPA-free",899,Milton

The more detail you provide, the better the descriptions.

Step 2: AI generation script

import openai, os, csv, json
import pandas as pd

client = openai.OpenAI(api_key=os.environ["OPENAI_API_KEY"])

def generate_description(product):
    """Generate a product description using AI."""
    prompt = f"""Write a product description for an e-commerce store.

Product: {product['product_name']}
Category: {product['category']}
Features: {product['features']}
Price: ₹{product['price']}
Brand: {product['brand']}

Requirements:
- 100-150 words
- Engaging, persuasive tone
- Include key features naturally
- SEO-friendly (include product name and category)
- End with a call-to-action
- No false claims or exaggeration

Return ONLY the description text, no extra formatting."""
    
    response = client.chat.completions.create(
        model="gpt-4o-mini",
        messages=[{"role": "user", "content": prompt}],
        temperature=0.7,
        max_tokens=200,
    )
    return response.choices[0].message.content.strip()

def generate_bulk(csv_path, output_path):
    """Generate descriptions for all products in CSV."""
    df = pd.read_csv(csv_path)
    descriptions = []
    
    for i, row in df.iterrows():
        print(f"Generating {i+1}/{len(df)}: {row['product_name']}...")
        desc = generate_description(row.to_dict())
        descriptions.append(desc)
    
    df["description"] = descriptions
    df.to_csv(output_path, index=False)
    print(f"\nDone! Saved to {output_path}")
    return df

# Usage
df = generate_bulk("products.csv", "products_with_descriptions.csv")

Step 3: Generate multiple variants

For A/B testing, generate multiple descriptions per product:

def generate_variants(product, n=3):
    """Generate N description variants for A/B testing."""
    variants = []
    for i in range(n):
        desc = generate_description(product)
        variants.append(desc)
    return variants

# Add to CSV
for i, row in df.iterrows():
    variants = generate_variants(row.to_dict(), n=3)
    for j, v in enumerate(variants):
        df.at[i, f"description_v{j+1}"] = v

Step 4: SEO optimization

Add SEO keywords to the prompt:

prompt = f"""Write an SEO-optimized product description.

Product: {product['product_name']}
Category: {product['category']}
Features: {product['features']}
Price: ₹{product['price']}

SEO requirements:
- Include the product name in the first sentence
- Include 2-3 relevant keywords naturally
- 100-150 words
- Use bullet points for features
- End with a call-to-action

Return ONLY the description."""

Step 5: Quality control

AI-generated descriptions need review. Automate quality checks:

def quality_check(description, product):
    issues = []
    
    # Length check
    if len(description.split()) < 50:
        issues.append("Too short")
    if len(description.split()) > 200:
        issues.append("Too long")
    
    # Keyword check
    if product["product_name"].lower() not in description.lower():
        issues.append("Missing product name")
    
    # Repetition check
    words = description.lower().split()
    if len(set(words)) / len(words) < 0.5:
        issues.append("Too repetitive")
    
    # Placeholder check
    if "[placeholder]" in description or "TODO" in description:
        issues.append("Contains placeholder")
    
    return issues

# Apply to all descriptions
for i, row in df.iterrows():
    issues = quality_check(row["description"], row.to_dict())
    if issues:
        print(f"⚠️ {row['product_name']}: {', '.join(issues)}")

Step 6: Cost estimation

Model Cost per 1K tokens Cost per description (150 words) 1000 descriptions
GPT-4o-mini $0.15 input / $0.60 output ~$0.001 ~$1
GPT-4o $2.50 input / $10.00 output ~$0.01 ~$10
Claude 3.5 Sonnet $3.00 input / $15.00 output ~$0.015 ~$15

For 1000 products: ~$1-15 depending on model. Extremely cost-effective.

Step 7: Automate with cron

# Generate descriptions daily for new products
0 6 * * * cd /path/to/project && python generate_descriptions.py

Common mistakes

  • No quality control — AI can hallucinate features or make false claims. Always review.
  • Generic prompts — “Write a product description” produces generic output. Be specific about tone, length, and requirements.
  • No SEO keywords — include target keywords in the prompt
  • Not testing — generate 5 descriptions first, review, then scale
  • Ignoring brand voice — include brand guidelines in the prompt
  • Not handling errors — if one product fails, the script should continue

Key Concepts

  • Bulk generation = creating many items from data
  • Prompt engineering = crafting effective AI prompts
  • Quality control = automated checks for output quality
  • SEO optimization = including keywords naturally
  • A/B testing = comparing multiple variants

What to Try Next

FAQ

GPT-4o-mini vs GPT-4o — which to use?

GPT-4o-mini = 10x cheaper, good enough for most product descriptions. GPT-4o = better quality, more nuanced, but 10x more expensive. Start with mini; upgrade to 4o only if quality is insufficient.

Can AI write descriptions for 10,000+ products?

Yes — the script processes products in a loop. For 10,000+ products, use batch processing with rate limiting (sleep between requests) and multiprocessing. Expect 1-2 hours for 10,000 products with GPT-4o-mini.

How do I maintain brand voice?

Include brand guidelines in the prompt: “Write in a [tone] voice. Use [adjectives]. Avoid [words/phrases]. Target audience: [description].” Create a brand voice document and reference it in every prompt. See Automate Email Newsletter. See Auto-Post Blog to Social.