Generate visibility tracking prompts for products.
Standalone endpoint for manual use only. The cron job does NOT call this endpoint directly.
Instead, discover-products calls generate_prompts_for_product internally for new products.
Use this endpoint for:
- Manual prompt regeneration for specific products
- Debugging and testing prompt generation
- Backfilling prompts for products that were created without them
How It Works
Request Body
| Field | Type | Required | Description |
|---|
business_id | string | Yes | Clerk org ID |
products | array | Yes | Products from discover-products output |
products Array
| Field | Type | Description |
|---|
name | string | Product name |
entity_id | string | Product entity UUID |
url | string | Product URL |
Response
{
"status": "success",
"products_processed": 3,
"prompts_generated": 30
}
Prompt Generation
For each product, Gemini generates 10 search queries that users might use to find this product:
Product: AI Teddy Bear
URL: https://example.com/products/teddy
Generated prompts:
1. "best talking teddy bear for kids"
2. "AI stuffed animals with voice recognition"
3. "interactive plush toys that respond"
...
Configuration
| Constant | Value | Description |
|---|
PROMPTS_PER_PRODUCT | 10 | Prompts generated per product |
Database Updates
| Table | Action |
|---|
entity_prompts_tracker | Insert 10 prompts per product |
Code Location
src/app/apis/cron/generate_product_prompts/routes.py