Skip to content

Use Case: Automated Video Ad Generation

Fresh

Scenario

You have an e-commerce site with hundreds of product pages. You want to automatically generate video ads for each product to use in social media advertising campaigns.

Architecture

Implementation Steps

1. Extract Product URLs

Pull product URLs from your catalog, CMS, or sitemap.

For each URL, create a link object to scrape product data:

  • POST /api/links/ for each product URL
  • Validate scraped data (title, description, media)
  • Use /api/links/with_params/ for products with poor scrape results

3. Generate Video Previews

Create URL-to-video tasks in parallel batches:

  • Start with 5-10 concurrent tasks
  • Use preview mode (1 credit/30s) for cost efficiency
  • Poll all tasks in a unified loop

4. Quality Selection

For each preview batch:

  • Review generated previews (manual or automated)
  • Select best preview per product
  • Flag products needing regeneration

5. Render Final Videos

Render selected previews at full quality:

  • POST /{id}/render/ for each selected preview
  • 4 credits/30s per render
  • Poll for completion

6. Distribute to Ad Platforms

Upload completed videos to advertising platforms with appropriate metadata.

Cost Estimate

ProductsDurationPreview CostRender CostTotal
1030s each10 credits40 credits50
5030s each50 credits200 credits250
10030s each100 credits400 credits500
50030s each500 credits2000 credits2500

Best Practices

TIP

  1. Preview first -- Always generate previews before rendering to catch issues early
  2. Batch wisely -- Process 10-20 products at a time to manage costs and quality
  3. Aspect ratios -- Generate 9:16 for TikTok/Reels and 16:9 for YouTube
  4. Credit budget -- Set a per-product credit limit and monitor usage
  5. Retry failed -- Some URLs may fail; retry with with_params and manual data

See Also