Triggers a two-step pipeline that runs in the background:
- Generate Prompts - Creates ~100 AI search prompts tailored to your business
- Analyze Visibility - Immediately checks each prompt against 8 AI platforms
This endpoint returns immediately. By the time you reach the dashboard, you’ll have both prompts and visibility data ready.
Pipeline Steps
Step 1: Generate Prompts
- Crawls the business website using Firecrawl (up to 50 pages)
- Uses Claude to create 100 diverse, business-specific queries
- Saves prompts to
business_prompts table
Step 2: Analyze Visibility
- Checks each prompt against 8 AI platforms (ChatGPT, Claude, Gemini, Perplexity, Copilot, DeepSeek, Grok, Google AI)
- Saves per-prompt results to
visibility_tracker table
- Updates aggregated score in
visibility_scores table
- Appends historical data to
visibility_scores_history table
Request Body
The business website URL to analyze
Clerk organization slug (used as business_id)
Optional product/item ID for product-specific tracking
Maximum pages to crawl from the website
Regenerate prompts even if they already exist
Response
"accepted" - pipeline started in background
List of operations being performed: ["generate_prompts", "analyze_visibility"]
curl -X POST https://searchcompany-main.up.railway.app/api/generate-prompts \
-H "Content-Type: application/json" \
-d '{
"url": "https://nike.com",
"org_slug": "nike"
}'
{
"status": "accepted",
"message": "Prompt generation and visibility analysis started",
"pipeline": ["generate_prompts", "analyze_visibility"]
}
Notes
- Called during onboarding (Step 3 - Analysis Phase)
- Full pipeline takes 3-8 minutes to complete
- Prompts are one sentence each and highly relevant to the business
- Example prompts: “What are the best Nike running shoes for marathons?”
- After completion, dashboard will show visibility score and tracked queries