Skip to main content
POST
https://searchcompany-main.up.railway.app
/
api
/
generate-prompts
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"]
}
Triggers a two-step pipeline that runs in the background:
  1. Generate Prompts - Creates ~100 AI search prompts tailored to your business
  2. 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

  1. Crawls the business website using Firecrawl (up to 50 pages)
  2. Uses Claude to create 100 diverse, business-specific queries
  3. Saves prompts to business_prompts table

Step 2: Analyze Visibility

  1. Checks each prompt against 8 AI platforms (ChatGPT, Claude, Gemini, Perplexity, Copilot, DeepSeek, Grok, Google AI)
  2. Saves per-prompt results to visibility_tracker table
  3. Updates aggregated score in visibility_scores table
  4. Appends historical data to visibility_scores_history table

Request Body

url
string
required
The business website URL to analyze
org_slug
string
required
Clerk organization slug (used as business_id)
item_id
string
Optional product/item ID for product-specific tracking
max_pages
integer
default:"50"
Maximum pages to crawl from the website
force_refresh
boolean
default:"false"
Regenerate prompts even if they already exist

Response

status
string
"accepted" - pipeline started in background
message
string
Confirmation message
pipeline
array
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