Skip to main content

Documentation

Foglift Documentation

Everything you need to integrate Foglift, whether you're a developer building a pipeline, an AI agent scanning autonomously, or a team adding AI Readiness checks to CI/CD.

Quick Start

Three ways to use Foglift. Pick the one that fits your workflow.

For Humans (CLI)

foglift scan mysite.com

Colored output in terminal

For Code (API)

GET /api/v1/scan?url=...

Structured JSON response

For AI Agents (MCP)

npx foglift-mcp

Claude Code, Cursor, Windsurf

CLI Tool

Scan any website from your terminal. No signup, no API key required for basic scans.

Basic Usage

Terminal
# Scan a website (colored output with scores and issues)
foglift scan https://example.com

# Output as JSON (for scripting)
foglift scan https://example.com --json

# Verbose mode (show all issues, not just top 5)
foglift scan https://example.com --verbose

# Fail CI if score below threshold
foglift scan https://example.com --threshold 80

Example Output

Terminal
$ foglift scan https://example.com

  Foglift Technical Audit

  URL: https://example.com
  Scanned: 2026-03-15 14:30:00 (12 seconds)

  ┌──────────────────────────────────────────────┐
  │  Overall: B (74/100)                         │
  ├──────────────────────────────────────────────┤
  │  SEO:           █████████░  85/100  A        │
  │  AI Readiness:  █████░░░░░  52/100  D        │
  │  Performance:   ████████░░  78/100  C        │
  │  Security:      ██████░░░░  60/100  C        │
  │  Accessibility: █████████░  91/100  A        │
  └──────────────────────────────────────────────┘

  Issues Found: 8 (2 critical, 3 warnings, 3 info)

  [AI Readiness] AI crawlers blocked by robots.txt
  [AI Readiness] Missing FAQ schema markup
  [Security] No Content-Security-Policy header
  [SEO] Missing Open Graph image tag
  [Security] No Permissions-Policy header

  Full report → https://foglift.io/scan/abc123

CLI Flags

FlagDescription
--jsonOutput raw JSON (for piping to jq, scripts, etc.)
--verboseShow all issues (not just top 5)
--no-colorDisable colored output
--threshold=NExit with code 1 if overall score is below N (CI/CD use)
--workspace-idTarget a specific brand (multi-brand accounts). Get UUIDs at /dashboard/developer

Exit Codes

CodeMeaning
0Scan completed successfully (or score above threshold)
1Score below --threshold, or scan error
2Invalid URL or network error

Advanced Commands (API key required)

Set FOGLIFT_API_KEY to unlock AI visibility monitoring, prompt management, and analytics.

CommandDescription
foglift scan batch <urls...>Batch scan up to 10 URLs at once
foglift scan ai-checkRun AI visibility check across models
foglift scan resultsGet historical AI visibility results
foglift scan prompts listList saved monitoring prompts
foglift scan prompts add "text"Add a new monitoring prompt
foglift scan prompts remove <id>Delete a monitoring prompt
foglift scan modelsShow enabled AI models and frequency
foglift scan sentimentGet sentiment analysis trends
foglift scan referrersGet AI-engine referrer visits by engine, path, and day
foglift scan usageShow API usage and token balance
foglift scan history <url>View scan history for a URL
Terminal
# Run AI visibility check with specific prompts and models
export FOGLIFT_API_KEY=sk_fog_your_key_here
foglift scan ai-check --prompt "best seo tools" --models chatgpt,perplexity

# View results from the last 7 days
foglift scan results --days 7 --model chatgpt --json

# Show AI-engine referrals by engine, path, and day
foglift scan referrers --days 30 --domain example.com

# Manage monitoring prompts
foglift scan prompts list
foglift scan prompts add "best alternatives to semrush"

# Check token usage
foglift scan usage

REST API

The Foglift REST API provides programmatic access to website intelligence. Free, no auth required for basic scans.

Base URL

https://foglift.io/api/v1

GET /api/v1/scan

Scan a website and return Technical Audit results: SEO, AI Readiness, performance, security, and accessibility.

ParameterTypeRequiredDescription
urlstringYesFull URL to scan (include https://)
formatstringNo"json" (default) or "text"

Examples

cURL
curl "https://foglift.io/api/v1/scan?url=https://example.com"
JavaScript
const response = await fetch(
  "https://foglift.io/api/v1/scan?url=https://example.com"
);
const data = await response.json();

console.log(data.scores);
// { overall: 72, seo: 85, geo: 65, performance: 78, security: 60, accessibility: 70 }

console.log(data.issues);
// [{ category: "GEO", severity: "critical", title: "AI crawlers blocked", description: "..." }]

console.log(data.aiSummary);
// "This site has strong SEO fundamentals but needs AI Readiness improvements..."
Python
import requests

response = requests.get(
    "https://foglift.io/api/v1/scan",
    params={"url": "https://example.com"}
)
data = response.json()

print(f"Overall: {data['scores']['overall']}/100")
for issue in data["issues"]:
    print(f"  [{issue['severity']}] {issue['title']}")

Response Schema

JSON Response
{
  "url": "https://example.com",
  "scanId": "scan_abc123",
  "scannedAt": "2026-03-15T12:00:00Z",
  "scores": {
    "overall": 72,          // Weighted average (0-100)
    "seo": 85,              // Traditional SEO health (0-100)
    "geo": 65,              // AI Readiness score, legacy field name (0-100)
    "performance": 78,      // Page speed & Core Web Vitals (0-100)
    "security": 60,         // HTTP security headers (0-100)
    "accessibility": 70     // WCAG compliance (0-100)
  },
  "letterGrade": "B",       // A (90+), B (80+), C (60+), D (40+), F (<40)
  "issues": [
    {
      "category": "GEO",         // "GEO" | "AEO" | "SEO" | "Performance" | "Security" | "Accessibility"; legacy label for AI Readiness issues
      "severity": "critical",    // "critical" | "warning" | "info"
      "title": "AI crawlers blocked by robots.txt",
      "description": "GPTBot and ClaudeBot are blocked. Add User-agent: GPTBot\nAllow: / to robots.txt"
    }
  ],
  "aiSummary": "This site has strong SEO fundamentals but needs AI Readiness improvements...",
  "totalIssues": 12,          // Total issue count (some may be hidden on free tier)
  "tier": "free",             // "free" | "launch" | "growth" | "enterprise"
  "gated": true               // true = some issues hidden (free tier)
}

Issue Severity Levels

SeverityImpactAction
criticalDirectly hurts rankings or blocks AI indexingFix immediately
warningSuboptimal, reduces visibility over timeFix within a week
infoBest practice recommendationConsider implementing

Score Methodology

Each category score is calculated from multiple weighted checks. The overall score is a weighted average:

overall = (seo × 0.25) + (geo × 0.25) + (performance × 0.20) + (security × 0.15) + (accessibility × 0.15)

SEO Score (25% of overall)

Traditional search engine optimization health. Based on Google Lighthouse SEO audit + custom checks.

  • Title tag: present, 30-60 chars, unique, contains target keywords
  • Meta description: present, 120-160 chars, compelling copy
  • Heading hierarchy: single H1, logical H2-H6 nesting
  • Open Graph tags: og:title, og:description, og:image for social sharing
  • Twitter Card: twitter:card, twitter:title, twitter:image
  • Canonical URL: present and self-referencing
  • Image alt text: all images have descriptive alt attributes
  • Language attribute: html lang="en" set for screen readers
  • Robots directives: no accidental noindex/nofollow
  • Sitemap.xml: discoverable at /sitemap.xml
  • Robots.txt: present and not blocking important pages

AI Readiness Score (25% of overall)

AI search readiness measures how well structured your content is for ChatGPT, Perplexity, Google AI Overviews, and Claude.

  • AI crawler access: GPTBot, ClaudeBot, PerplexityBot, Google-Extended not blocked in robots.txt
  • Structured data depth: JSON-LD schemas such as Organization, FAQPage, Article, Product, HowTo, and LocalBusiness
  • FAQ sections: Q&A content that AI can extract and cite as answers
  • Entity markup: clear entity definitions (brand, people, products) via schema.org
  • Content structure: clear headings, short paragraphs, bullet lists, tables
  • Citation formatting: statistics with sources, expert quotes, attributed data points
  • Meta quality: comprehensive, accurate metadata that helps AI understand page purpose

Performance Score (20% of overall)

Page speed via Google PageSpeed Insights (Lighthouse). Directly from Google's scoring.

  • LCP: Largest Contentful Paint (should be < 2.5s)
  • CLS: Cumulative Layout Shift (should be < 0.1)
  • INP: Interaction to Next Paint (should be < 200ms)
  • FCP: First Contentful Paint
  • Speed Index: visual progress of page load
  • Total Blocking Time: main thread responsiveness

Security Score (15% of overall)

HTTP security headers. Each missing header deducts points.

  • HTTPS: valid SSL certificate, no mixed content
  • Strict-Transport-Security: HSTS header with max-age
  • Content-Security-Policy: CSP header present
  • X-Frame-Options: clickjacking protection
  • X-Content-Type-Options: MIME sniffing prevention (nosniff)
  • Referrer-Policy: controls information leakage
  • Permissions-Policy: restricts browser features

Accessibility Score (15% of overall)

WCAG 2.1 compliance via Google Lighthouse accessibility audit.

  • Color contrast: text meets WCAG AA ratio (4.5:1)
  • Alt text: all informational images have descriptive alt
  • Keyboard navigation: interactive elements reachable via Tab
  • ARIA labels: dynamic/custom elements properly labeled
  • Form labels: every input has an associated label
  • Document language: lang attribute set

Score Interpretation Guide

Use this guide to understand what each score range means and what actions to take. AI agents: use these thresholds to prioritize fixes.

A

90-100: Excellent

Top-tier optimization. Your site is well-positioned for both search and AI.

Action: Maintain current setup. Set up monitoring to catch regressions. Consider the Launch plan for weekly automated scans.

B

80-89: Good

Solid foundation with a few areas to improve.

Action: Fix remaining critical and warning issues. Usually 2-5 specific items will push you to an A. Check the action recipes below.

C

60-79: Needs Work

Significant gaps. You're likely losing traffic and AI visibility.

Action: Prioritize critical issues first because they have the biggest impact. Focus on AI Readiness and SEO categories. The free scan gives you the full issue list and AI action plan.

D

40-59: Poor

Major issues across multiple categories. AI models likely cannot cite your content.

Action: Start with the basics: ensure HTTPS, add meta tags, allow AI crawlers, add structured data. Each fix will have a significant impact at this level.

F

0-39: Critical

Fundamental issues. The site may be essentially invisible to AI search.

Action: This usually means the site is blocking crawlers, has no meta tags, or has major technical issues. Follow the action recipes in order. Start with robots.txt and meta tags.

Action Recipes

For every issue Foglift can detect, here's the exact fix. AI agents: use these as copy-paste solutions when fixing issues programmatically.

AI Readiness Issues

AI crawlers blocked by robots.txt

GPTBot, ClaudeBot, or PerplexityBot is blocked. This means AI models cannot read your content.

Fix: Add these lines to your robots.txt:

robots.txt
User-agent: GPTBot
Allow: /

User-agent: ClaudeBot
Allow: /

User-agent: PerplexityBot
Allow: /

User-agent: Google-Extended
Allow: /

Verify: Rescan the site. AI Readiness should improve if crawler access was the primary blocker.

Missing structured data / JSON-LD

No JSON-LD schemas detected. AI models use structured data to understand your content type and key facts.

Fix: Add JSON-LD to your page's <head>:

HTML
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "Your Company",
  "url": "https://yoursite.com",
  "description": "What your company does in one sentence.",
  "logo": "https://yoursite.com/logo.png",
  "sameAs": [
    "https://twitter.com/yourcompany",
    "https://linkedin.com/company/yourcompany"
  ]
}
</script>

Missing FAQ schema

No FAQPage schema detected. FAQ schemas are one of the highest-impact AI Readiness fixes because they give AI systems direct Q&A content to cite.

Fix:

HTML
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "What does your product do?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Our product does X, Y, and Z for [target audience]."
      }
    },
    {
      "@type": "Question",
      "name": "How much does it cost?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Free to start. Paid plans from $X/month."
      }
    }
  ]
}
</script>

SEO Issues

Missing or poor meta description

No meta description, or it's too short/long. This is the snippet shown in Google search results.

Fix: Add to <head>:

HTML
<meta name="description" content="120-160 characters describing what this page offers. Include your primary keyword naturally. Make it compelling because this is your ad copy in search results.">

Missing Open Graph tags

No og:title, og:description, or og:image. Links shared on social media will look blank.

Fix:

HTML
<meta property="og:title" content="Page Title | Brand Name">
<meta property="og:description" content="Compelling description for social sharing.">
<meta property="og:image" content="https://yoursite.com/og-image.png">
<meta property="og:url" content="https://yoursite.com/this-page">
<meta property="og:type" content="website">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Page Title | Brand Name">
<meta name="twitter:description" content="Compelling description for Twitter.">
<meta name="twitter:image" content="https://yoursite.com/og-image.png">

Security Issues

Missing security headers

Missing HSTS, CSP, X-Frame-Options, or other security headers. Affects both security and SEO ranking.

Fix (Next.js next.config.js):

next.config.js
const securityHeaders = [
  { key: 'Strict-Transport-Security', value: 'max-age=63072000; includeSubDomains; preload' },
  { key: 'X-Content-Type-Options', value: 'nosniff' },
  { key: 'X-Frame-Options', value: 'DENY' },
  { key: 'X-XSS-Protection', value: '1; mode=block' },
  { key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
  { key: 'Permissions-Policy', value: 'camera=(), microphone=(), geolocation=()' },
];

module.exports = {
  async headers() {
    return [{ source: '/(.*)', headers: securityHeaders }];
  },
};

Fix (Vercel vercel.json):

vercel.json
{
  "headers": [
    {
      "source": "/(.*)",
      "headers": [
        { "key": "Strict-Transport-Security", "value": "max-age=63072000; includeSubDomains; preload" },
        { "key": "X-Content-Type-Options", "value": "nosniff" },
        { "key": "X-Frame-Options", "value": "DENY" },
        { "key": "Referrer-Policy", "value": "strict-origin-when-cross-origin" },
        { "key": "Permissions-Policy", "value": "camera=(), microphone=(), geolocation=()" }
      ]
    }
  ]
}

MCP Server (AI Agents)

Foglift is available as an MCP (Model Context Protocol) server. AI coding assistants like Claude Code, Cursor, and Windsurf can scan websites and fix issues directly from your IDE.

Connecting from Claude.ai (web)

Add Foglift as a custom connector at claude.ai/customize:

  1. Click Add custom connector
  2. URL: https://foglift.io/api/mcp
  3. Click Connect, then sign in to Foglift when the consent screen appears. That's it — OAuth handles the rest.

Prefer an API key instead of OAuth? Open Advanced while adding the connector and set an Authorization header to Bearer sk_fog_… (create a key in Settings). https://mcp.foglift.io/api/mcp is an equivalent alternate endpoint — both hosts support OAuth and API-key headers.

Installation (Claude Code CLI / IDEs)

Terminal
npm install -g foglift-mcp

Claude Code Setup

Add to ~/.claude/mcp.json:

~/.claude/mcp.json
{
  "mcpServers": {
    "foglift": {
      "command": "npx",
      "args": ["foglift-mcp"]
    }
  }
}

Cursor Setup

Add to .cursor/mcp.json in your project root:

.cursor/mcp.json
{
  "mcpServers": {
    "foglift": {
      "command": "npx",
      "args": ["foglift-mcp"]
    }
  }
}

Windsurf Setup

Add to ~/.windsurf/mcp.json:

~/.windsurf/mcp.json
{
  "mcpServers": {
    "foglift": {
      "command": "npx",
      "args": ["foglift-mcp"]
    }
  }
}

Available MCP Tools

ToolDescriptionParameters
scan_websiteRun a full Technical Auditurl (required)
batch_scanScan multiple URLs at onceurls (required, array)
run_ai_visibilityCheck AI visibility across enginesdomain (required), brand_id, prompts, models, use_saved_prompts
get_ai_resultsRetrieve AI visibility resultsbrand_id
get_promptsList saved monitoring promptsbrand_id
add_promptAdd a prompt to monitorbrand_id, prompt
delete_promptRemove a promptbrand_id, prompt_id
get_modelsGet AI model preferences (account-level)none
set_modelsConfigure which AI models to track (account-level)enabled_models, monitoring_frequency
get_sentimentGet AI sentiment analysisbrand_id
get_usageCheck API usage and limitsnone
get_scan_historyView past scan resultsurl (required)
get_geo_monitorGet AI Visibility monitoring statusbrand_id
get_referrer_analyticsGet AI-engine referral traffic by engine, path, and daybrand_id, days
estimate_costPre-flight token cost before running AI visibility scansbrand_id, prompts, models
get_recommendationsGet source-tagged recommendations, diagnostics, and an agent reasoning recipe without Foglift generation spendbrand_id
submit_recommendationStore an agent-generated recommendation as customer_agentbrand_id, title, description, rationale, expected_impact
apply_recommendationReturn the precise change-set or next action for a stored recommendationbrand_id, recommendation_id
generate_content_briefGenerate a brand-aware content brief for a recommendation target pagebrand_id, url, recTitle
report_issueSubmit a structured bug, question, or feature request for Foglift triagebrand_id, summary, type, tool_or_endpoint, agent_hypothesis
whoamiGet account identity, plan, and token balancenone
recommend_setupCalculate optimal prompt count for your plan budgetbrand_count, scan_frequency, plan, engines
apply_setup_recommendationCreate categorized prompts from a setup recommendationbrand_id, brand_name, competitors, industry, recommendation
Multi-brand accounts: Tools that accept brand_id (get_ai_results, get_prompts, add_prompt, delete_prompt, get_sentiment, get_geo_monitor, get_referrer_analytics, estimate_cost, get_recommendations, submit_recommendation, apply_recommendation, generate_content_brief, report_issue, apply_setup_recommendation) require it when your account has more than one brand. workspace_id is accepted as a legacy alias. If omitted on a multi-brand account, the tool returns a structured error with your brand list instead of silently falling back. Get your brand UUIDs at /dashboard/developer.
Multi-brand disambiguation error
{
  "error": "Account has multiple brands. Pass brand_id to disambiguate.",
  "code": "multi_brand_disambiguation_required",
  "docs_url": "https://foglift.io/docs/api-errors#multi_brand_disambiguation_required",
  "request_id": "req_m3k7x9...",
  "details": {
    "brands": [
      { "id": "8f4c2a10-6c2f-4b2e-b2a1-4c5e7f8a9b10", "name": "Brand A", "domain": "branda.com" },
      { "id": "1f2e3d4c-5b6a-4789-8abc-0def12345678", "name": "Brand B", "domain": "brandb.com" }
    ]
  }
}

Example MCP Tool Response

scan_website response
{
  "url": "https://example.com",
  "scores": { "overall": 72, "seo": 85, "geo": 52, "performance": 78, "security": 60, "accessibility": 91 },
  "issues": [
    { "category": "GEO", "severity": "critical", "title": "AI crawlers blocked by robots.txt", "description": "..." },
    { "category": "GEO", "severity": "critical", "title": "No FAQ schema markup", "description": "..." },
    { "category": "Security", "severity": "warning", "title": "Missing CSP header", "description": "..." }
  ],
  "aiSummary": "Strong SEO but weak AI Readiness. AI crawlers are blocked and no structured data is present..."
}

Agent Workflows

Complete workflows for AI agents using Foglift. Copy these patterns to build autonomous Technical Audit fix pipelines.

Workflow: Scan and Fix All Issues

The most common agent workflow: scan a site, then fix every issue found.

  1. Scan the site: Call scan_website with the URL. Read the full response.
  2. Prioritize by severity: Fix critical issues first, then warnings, then info.
  3. For each issue, look up the action recipe: Match the issue title to the recipes in this docs page.
  4. Apply the fix: Edit the relevant file (robots.txt, HTML head, config, etc.).
  5. Rescan to verify: Run scan_website again. Score should improve.
  6. Commit and deploy: Push changes and redeploy the site.

Workflow: CI/CD Quality Gate

Block deploys when Technical Audit scores drop below a threshold.

  1. After deploy to staging: Scan the staging URL.
  2. Check overall score: If below threshold (e.g., 70), fail the build.
  3. Check for new critical issues: Compare with previous scan. Any new critical = fail.
  4. Report results: Post scores as a PR comment or CI artifact.

Workflow: New Site Setup

You just deployed a new Next.js/React site. Use Foglift to get it optimized from day one.

  1. Scan the deployed URL: Get baseline scores.
  2. Fix robots.txt: Allow all search engines and AI crawlers.
  3. Add meta tags: title, description, OG tags, Twitter card to every page.
  4. Add JSON-LD structured data: Organization + FAQPage at minimum.
  5. Add security headers: HSTS, CSP, X-Frame-Options, etc.
  6. Generate sitemap.xml: List all public pages.
  7. Submit to Google Search Console: Verify domain, submit sitemap.
  8. Rescan: Verify all scores are 80+.

Public API Reference

The full programmatic surface: scan websites, run AI visibility checks, manage monitoring prompts, pull sentiment and history, verify crawler-tracker installs. Everything the CLI can do, your code and AI agents can do too.

Authentication

Authenticated endpoints require an API key in the X-API-Key header (or Authorization: Bearer <key> for batch endpoints). Keys look like sk_fog_…. Generate and rotate keys at Dashboard → Developer. Keys are hashed with SHA-256 server-side and shown only once at creation.

One API key is scoped to one account; if you have multiple brands under that account, pass brand_id where the endpoint supports it. Single-brand accounts auto-resolve without it. workspace_id is accepted as a legacy alias.

Multi-brand customers: always pass brand_id explicitly.

If omitted, per-brand endpoints return 400 with a multi_brand_disambiguation_required error and your brand list. Single-brand accounts auto-resolve without it. workspace_id is accepted as a legacy alias. Get your brand UUIDs at /dashboard/developer.

Endpoint Index

Every API-key-authenticated v1 endpoint currently live in production. Tier column lists the minimum paid tier required; Public means no auth needed.

MethodEndpointTierDescription
GET/api/v1/scanPublicRun a technical audit. Free for 10 scans/day per IP; higher per-plan limits with an API key.
POST/api/v1/scan/batchLaunch+Scan up to 10 URLs in one request.
POST/api/v1/scan/sitemapGrowth+Fetch sitemap.xml and scan up to 25 of its URLs.
POST/api/v1/ai-visibilityLaunch+Query ChatGPT, Perplexity, Claude, Gemini, and Google AI Overview for saved or custom prompts. Debits tokens per model.
GET/api/v1/ai-visibility/resultsLaunch+Historical AI visibility results with filters and pagination.
GET/api/v1/promptsLaunch+List tracked monitoring prompts for the workspace.
POST/api/v1/promptsLaunch+Add one or more monitoring prompts.
DELETE/api/v1/promptsLaunch+Remove a monitoring prompt by id.
GET/api/v1/modelsLaunch+Get enabled AI models and monitoring frequency.
POST/api/v1/modelsLaunch+Update enabled models and monitoring frequency.
GET/api/v1/sentimentLaunch+Net Sentiment Score, daily trend, and per-engine breakdown.
GET/api/v1/historyLaunch+Paginated AI Visibility monitoring result rows for a workspace.
GET/api/v1/monitorLaunch+Visibility scores, citations, and prompts over a 7/14/30-day window.
GET/api/v1/tracker/verifyLaunch+Validate an API key and report how many AI crawler visits have been logged in the last 30 days (used by the @foglift/tracker install wizard).
POST/api/v1/crawler-analyticsLaunch+Log a single AI crawler visit. Called by the @foglift/tracker middleware; 60 req/min per IP rate limit.
GET/api/v1/referrer-analyticsLaunch+Read AI-engine referrer visits (humans clicking through from ChatGPT, Claude, Perplexity, Gemini, Copilot, NotebookLM). Pairs with trackAITraffic in @foglift/tracker v1.2.0+.

Tier naming: Launch+ means Launch ($49/mo), Growth ($129/mo), or Enterprise ($299/mo). Growth+ means Growth or Enterprise. See pricing.

POST /api/v1/ai-visibility

Run an AI visibility check across specified AI models. Debits tokens per model queried.

Multi-brand accounts: pass brand_id explicitly. If omitted on a multi-brand account, this endpoint returns a structured brand-disambiguation error instead of silently falling back.
cURL
curl -X POST https://foglift.io/api/v1/ai-visibility \
  -H "X-API-Key: sk_fog_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "brand_id": "WS_UUID",
    "prompts": ["best project management tools", "top CRM software 2026"],
    "models": ["chatgpt", "perplexity", "claude"]
  }'

Both prompts and models are optional. Omit prompts to use your saved monitoring prompts. Omit models to use your enabled models from preferences.

Response
{
  "success": true,
  "summary": {
    "visibility_pct": 60,
    "total_queries": 6,
    "successful": 6,
    "brand_mentions": 4,
    "models_queried": ["chatgpt", "perplexity", "claude"],
    "prompts_checked": 2
  },
  "results": [
    {
      "model": "ChatGPT",
      "prompt": "best project management tools",
      "brand_mentioned": true,
      "position": 3,
      "sentiment": "positive",
      "response_text": "Here are the top project management...",
      "citations": ["https://yoursite.com/features"],
      "competitor_mentions": ["Asana", "Monday.com"]
    }
  ]
}

GET /api/v1/ai-visibility/results

Retrieve historical AI visibility results with filtering and pagination.

Multi-brand accounts: pass brand_id explicitly. If omitted, this endpoint returns multi_brand_disambiguation_required with your brand list. Single-brand accounts auto-resolve.
cURL
# Last 7 days, all models
curl -H "X-API-Key: sk_fog_YOUR_KEY" \
  "https://foglift.io/api/v1/ai-visibility/results?brand_id=WS_UUID&days=7"

# Filter by model and prompt
curl -H "X-API-Key: sk_fog_YOUR_KEY" \
  "https://foglift.io/api/v1/ai-visibility/results?brand_id=WS_UUID&days=30&model=chatgpt&limit=100"

GET/POST /api/v1/models

Account-level settings: read or update which AI models are enabled and the monitoring frequency for every brand on the account.

This endpoint is account-scoped. It does not accept a brand selector because model preferences apply to all brands on the account.
cURL
# Get current settings
curl -H "X-API-Key: sk_fog_YOUR_KEY" \
  "https://foglift.io/api/v1/models"

# Enable only ChatGPT and Perplexity, set weekly frequency
curl -X POST https://foglift.io/api/v1/models \
  -H "X-API-Key: sk_fog_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled_models": { "chatgpt": true, "perplexity": true, "claude": false, "gemini": false, "ai-overview": false },
    "monitoring_frequency": "weekly"
  }'

GET /api/v1/sentiment

Aggregated sentiment analysis. Returns a Net Sentiment Score (NSS, -100 to +100), daily trend, per-engine breakdown, and alerts. Accepts days (1-90, default 30).

Multi-brand accounts: pass brand_id explicitly. If omitted, this endpoint returns multi_brand_disambiguation_required with your brand list. Single-brand accounts auto-resolve.
cURL
curl -H "X-API-Key: sk_fog_YOUR_KEY" \
  "https://foglift.io/api/v1/sentiment?brand_id=WS_UUID&days=30"

GET/POST/DELETE /api/v1/prompts

Multi-brand accounts: pass brand_id explicitly. If omitted, this endpoint returns multi_brand_disambiguation_required with your brand list. Single-brand accounts auto-resolve.

Manage saved monitoring prompts. POST is server-side deduped (case-insensitive, against existing workspace prompts) and supports a Stripe-style Idempotency-Key header. Replays within 24h return the cached first response without re-inserting. Rate limits: 60 POSTs/minute and 1000 POSTs/day per account; over-limit responses return 429 with a Retry-After header.

cURL
# List prompts
curl -H "X-API-Key: sk_fog_YOUR_KEY" \
  "https://foglift.io/api/v1/prompts?brand_id=WS_UUID"

# Add prompts (one POST can add multiple). Response shape:
#   { "created": N, "inserted": N, "deduped": M, "prompts": [...] }
# Include Idempotency-Key for safe retry loops. Replays return the cached
# first response verbatim within a 24-hour window.
curl -X POST "https://foglift.io/api/v1/prompts" \
  -H "X-API-Key: sk_fog_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: req-2026-05-11-001" \
  -d '{"brand_id": "WS_UUID", "prompts": [{"text": "best AI search optimization tool"}, {"text": "tools to rank in ChatGPT"}]}'

# Remove a prompt by id
curl -X DELETE "https://foglift.io/api/v1/prompts" \
  -H "X-API-Key: sk_fog_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"brand_id": "WS_UUID", "prompt_id": "prompt_abc123"}'

GET /api/v1/history

Paginated historical AI Visibility result rows. Optional: limit (1-100, default 20), offset, prompt_id, model.

Multi-brand accounts: pass brand_id explicitly. If omitted, this endpoint returns multi_brand_disambiguation_required with your brand list. Single-brand accounts auto-resolve.
cURL
curl -H "X-API-Key: sk_fog_YOUR_KEY" \
  "https://foglift.io/api/v1/history?brand_id=WS_UUID&limit=50&model=chatgpt"

GET /api/v1/monitor

Rolled-up monitoring snapshot: visibility scores, recent citations, and active prompts over a period of 7d (default), 14d, or 30d.

Multi-brand accounts: pass brand_id explicitly. If omitted, this endpoint returns multi_brand_disambiguation_required with your brand list. Single-brand accounts auto-resolve.
cURL
curl -H "X-API-Key: sk_fog_YOUR_KEY" \
  "https://foglift.io/api/v1/monitor?brand_id=WS_UUID&period=30d"

POST /api/v1/scan/batch

Scan up to 10 URLs in one request. Launch+ tier. Counts against your plan's daily scan limit.

cURL
curl -X POST "https://foglift.io/api/v1/scan/batch" \
  -H "X-API-Key: sk_fog_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://site-a.com", "https://site-b.com", "https://site-c.com"]}'

POST /api/v1/scan/sitemap

Fetch the target site's sitemap.xml and scan up to 25 URLs from it. Growth+ tier. Auth via Authorization: Bearer sk_fog_… header.

cURL
curl -X POST "https://foglift.io/api/v1/scan/sitemap" \
  -H "Authorization: Bearer sk_fog_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "limit": 25}'

GET /api/v1/tracker/verify

Validate an API key and return setup status for the @foglift/tracker package. The response includes valid, tier, and crawlers_tracked (30-day count).

cURL
curl -H "X-API-Key: sk_fog_YOUR_KEY" \
  "https://foglift.io/api/v1/tracker/verify"

POST /api/v1/crawler-analytics

Log a single AI crawler hit (GPTBot, ClaudeBot, PerplexityBot, Google-Extended, etc.). Used by the @foglift/tracker middleware to record visits from bots. Rate-limited to 60 requests/minute per IP. Body: { path, userAgent, hostname, brand_id, timestamp }.

Authenticated multi-brand tracker posts can pass brand_id in the JSON body or query string. workspace_id is accepted as a legacy alias. If omitted, Foglift uses hostname when it matches one of your brands; otherwise it returns multi_brand_disambiguation_required with your brand list.
cURL
curl -X POST "https://foglift.io/api/v1/crawler-analytics" \
  -H "X-API-Key: sk_fog_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "path": "/pricing",
    "userAgent": "Mozilla/5.0 (compatible; GPTBot/1.0)",
    "hostname": "example.com",
    "brand_id": "WS_UUID"
  }'

GET /api/v1/referrer-analytics

Read AI-engine referrer visits: humans who clicked through from ChatGPT, Claude, Perplexity, Gemini, Copilot, or NotebookLM. The crawler-tracker counterpart for human traffic. Pairs with @foglift/tracker v1.2.0+ which dispatches both signals (UA-detected bot crawls and Referer-detected human visits) from one install. Optional days (1-365, default 30).

Multi-brand accounts: pass brand_id explicitly. If omitted, this endpoint returns multi_brand_disambiguation_required with your brand list. Single-brand accounts auto-resolve.
cURL
curl -H "X-API-Key: sk_fog_YOUR_KEY" \
  "https://foglift.io/api/v1/referrer-analytics?brand_id=WS_UUID&days=30"

Underlying tables for direct read access (also queryable from the Foglift SQL console): referrer_visits_daily (per-engine daily counts) and referrer_visits_paths_daily (per-path per-engine counts).

Tracker SDK: trackAITraffic (v1.2.0)

The @foglift/tracker npm package ships one unified middleware function, trackAITraffic, that handles both signals in a single install: AI bot crawls (User-Agent matches GPTBot, ClaudeBot, PerplexityBot, etc.) and AI engine referrals (Referer header matches chatgpt.com, claude.ai, perplexity.ai, gemini.google.com, copilot.microsoft.com, notebooklm.google.com). Both classes of visit are POSTed to /api/v1/crawler-analytics with a source field of "crawler" or "referrer". Read aggregated referrer counts back via /api/v1/referrer-analytics (above).

Next.js (middleware.ts)
import { trackAITraffic } from "@foglift/tracker/nextjs";

export const middleware = trackAITraffic({
  apiKey: process.env.FOGLIFT_API_KEY!,
});

export const config = {
  matcher: ["/((?!_next/static|_next/image|favicon.ico).*)"],
};
Express
import express from "express";
import { trackAITraffic } from "@foglift/tracker/express";

const app = express();
app.use(trackAITraffic({ apiKey: process.env.FOGLIFT_API_KEY! }));

Migration note for v1.0.0 customers: replace the import of trackAICrawlers with trackAITraffic. No other code changes are required. Referrer-visit reporting starts automatically the moment the v1.2.0 middleware is mounted. trackAICrawlers remains a back-compat alias that forwards to trackAITraffic.

Dashboard-Internal Endpoints

Foglift also exposes ~30 additional v1 endpoints that authenticate via the dashboard session cookie rather than an API key. These back the web dashboard and aren't meant for scripted use. From a server or automation, prefer the API-key endpoints above.

You can still call them from an authenticated browser context (e.g. a logged-in Foglift tab's DevTools console, or a Chrome extension running with the user's cookies). They are documented here for completeness and because AI agents sometimes need to reference them.

AreaEndpoints
Scans & timelineGET /api/v1/scan-history, GET /api/v1/scan-diff, GET /api/v1/scan-timeline, GET/POST /api/v1/scheduled-scans
AI Readiness scoringGET /api/v1/aeo-score, GET /api/v1/aeo-history, GET /api/v1/workspace-aeo
Content briefs & recommendationsGET /api/v1/content-brief, GET /api/v1/content-recommendations, GET /api/v1/workspace-briefs
Competitive intelGET /api/v1/competitor-suggestions, GET /api/v1/competitor-trends, GET /api/v1/competitors/per-engine
Crawler analytics (dashboard read)GET /api/v1/crawler-analytics
Account & workspaceGET/POST /api/v1/brands, GET/POST/PATCH/DELETE /api/v1/team, GET/POST/DELETE /api/v1/keys, GET/PATCH /api/v1/preferences, GET/POST/PATCH/DELETE /api/v1/client-portal
Tokens & usageGET /api/v1/tokens/balance, GET /api/v1/tokens/usage, GET /api/v1/usage
Notifications & webhooksGET/PATCH /api/v1/notifications, GET/POST /api/v1/webhooks, GET /api/v1/webhook-logs
IntegrationsGET/POST/DELETE /api/v1/integrations/slack, …/discord, …/teams
Search Console & exportGET /api/v1/search-console, GET /api/v1/search-console/sites, GET /api/v1/export, POST /api/v1/export/pdf
MiscGET /api/v1/geo-monitor, GET/POST /api/v1/email-templates, POST/GET /api/v1/onboarding-analytics

If you need one of these programmatically, open a support request: we can promote it to API-key auth or surface the same data through an existing public endpoint.

Rate Limits & Authentication

TierAuthScans/DayResponse
FreeNone5 (web) / 10 (API)All issues + AI action plan + PDF
Launch ($49/mo)API Key50 scans/day, 1,000/moDaily AI Visibility monitoring, 4,000 tokens/mo, all 5 AI engines, 3 brands, batch scans
Growth ($129/mo)API Key200 scans/day, 5,000/moTwice-daily monitoring, 11,500 tokens/mo, 10 brands, batch + sitemap scans
Enterprise ($299/mo)API Key1,000 scans/day, 25,000/moHourly monitoring, 27,000 tokens/mo, unlimited brands

For authenticated AI Visibility API requests, include: X-API-Key: sk_fog_YOUR_KEY

Error Handling

HTTPErrorMeaningAction
400invalid_urlURL missing or malformedInclude full URL with https://
429rate_limitedDaily limit exceededWait 24 hours or upgrade plan
500scan_failedTarget unreachableVerify URL is accessible
503service_unavailableFoglift temporarily downRetry in a few minutes
Error Response Format
{
  "error": "Too many requests. Please retry after the rate limit window resets.",
  "code": "rate_limited",
  "docs_url": "https://foglift.io/docs/api-errors#rate_limited",
  "request_id": "req_m3k7x9..."
}

Every error includes a machine-readable code, a docs_url linking to recovery steps, and a request_id for support correlation. See the full API Error Reference for all 16 error codes with example requests, responses, and recovery steps.

CI/CD Integration

Add Foglift scans to your deployment pipeline to catch SEO and AI Readiness regressions before they ship.

GitHub Actions (Official Action)

Use the official Foglift GitHub Action for the simplest setup. Generates a Job Summary with scores and a link to the full report.

.github/workflows/foglift.yml
name: Website Health Check
on:
  push:
    branches: [main]
  schedule:
    - cron: '0 9 * * 1' # Weekly on Monday

jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: banant2/Foglift@main
        id: foglift
        with:
          url: 'https://yoursite.com'
          threshold: '70' # Fail if overall score < 70

      # Optional: Use outputs in subsequent steps
      - run: echo "Score: ${{ steps.foglift.outputs.overall }}/100 (${{ steps.foglift.outputs.grade }})"
InputRequiredDescription
urlYesURL to scan
thresholdNoMinimum score (action fails if below)
categoriesNoCategories to check (seo,geo,performance,security,accessibility)

Outputs: overall, seo, geo, performance, security, accessibility, issues, grade, report_url. Use them in subsequent steps. The geo output is the legacy field name for AI Readiness.

GitLab CI

.gitlab-ci.yml
foglift-scan:
  stage: test
  script:
    - RESULT=$(curl -s "https://foglift.io/api/v1/scan?url=$SITE_URL")
    - SCORE=$(echo $RESULT | jq '.scores.overall')
    - echo "Foglift Score: $SCORE/100"
    - '[ "$SCORE" -ge 60 ] || (echo "Score below threshold" && exit 1)'

Shell Script

check-seo.sh
#!/bin/bash
URL=${1:-"https://yoursite.com"}
THRESHOLD=${2:-70}

RESULT=$(curl -s "https://foglift.io/api/v1/scan?url=$URL")
SCORE=$(echo $RESULT | jq '.scores.overall')

echo "Foglift score for $URL: $SCORE/100"

if [ "$SCORE" -lt "$THRESHOLD" ]; then
  echo "FAIL: Score $SCORE is below threshold $THRESHOLD"
  echo $RESULT | jq '.issues[] | select(.severity == "critical") | .title'
  exit 1
fi

echo "PASS: Score meets threshold"
exit 0

Integrations

Connect Foglift to your existing tools and workflows. Use the REST API as the foundation for any integration.

GitHub Actions

Available

Official action: uses: banant2/Foglift@main. See CI/CD section above.

#

Slack Notifications

Via Webhook

Send scan results to a Slack channel using incoming webhooks. Trigger from CI/CD or a cron job.

Z

Zapier / Make

Via Webhook

Use Foglift's API as a webhook trigger in Zapier or Make to automate scan-report-act workflows.

G

Google Sheets

Via API

Use Apps Script + Foglift API to log scan results to a spreadsheet. Great for client reports.

BI

BI Tools (Looker, Tableau)

Via REST API

Connect the REST API as a data source. Build dashboards with Technical Audit and AI Visibility trend data over time.

W

Webhooks

Available

Get notified when scores change. Subscribe to events for automated workflows and alerting.

Slack Integration Example

slack-notify.sh
#!/bin/bash
# Scan and send results to Slack
RESULT=$(curl -s "https://foglift.io/api/v1/scan?url=https://yoursite.com")
SCORE=$(echo $RESULT | jq -r '.scores.overall')
GRADE=$(echo $RESULT | jq -r '.grade')

curl -X POST "$SLACK_WEBHOOK_URL" \
  -H "Content-Type: application/json" \
  -d "{
    \"text\": \"Foglift Scan: $GRADE ($SCORE/100) for yoursite.com\",
    \"blocks\": [{
      \"type\": \"section\",
      \"text\": { \"type\": \"mrkdwn\", \"text\": \"*Foglift Score:* $GRADE ($SCORE/100)\\nSEO: $(echo $RESULT | jq '.scores.seo') | AI Readiness: $(echo $RESULT | jq '.scores.geo') | Perf: $(echo $RESULT | jq '.scores.performance')\\n<https://foglift.io|View full report>\" }
    }]
  }"

Google Sheets Integration

Apps Script
function scanWithFoglift() {
  const url = "https://yoursite.com";
  const response = UrlFetchApp.fetch(
    "https://foglift.io/api/v1/scan?url=" + encodeURIComponent(url)
  );
  const data = JSON.parse(response.getContentText());

  const sheet = SpreadsheetApp.getActiveSheet();
  sheet.appendRow([
    new Date(),
    url,
    data.scores.overall,
    data.scores.seo,
    data.scores.geo,
    data.scores.performance,
    data.scores.security,
    data.grade
  ]);
}

Frequently asked questions

Common developer questions about authentication, rate limits, scoring, and integration patterns. For account-level help see the general FAQ.

Do I need an API key to scan a website?

No. The unauthenticated GET /api/v1/scan endpoint allows up to 10 scans per day from a single IP. That is useful for local testing, quick checks from a script, or running the CLI without signing up. An API key (sk_fog_ prefix, generated at /dashboard/developer) is required for the AI Visibility endpoints, batch scans, prompt management, sentiment, history, and any request that needs your tier's higher daily allowance. Pass it as an X-API-Key request header.

Should I use the CLI, REST API, or MCP server?

Pick by who is making the call. The CLI (foglift scan <url>) is the right surface for terminals and CI/CD pipelines because it supports --threshold to fail builds and --json for piping into other tools. The REST API is for application backends and serverless functions where your code drives the request and parses JSON. The MCP server (Model Context Protocol, the open standard introduced by Anthropic in November 2024) is for AI coding agents like Claude Code, Cursor, and Windsurf. It lets the assistant invoke Foglift autonomously as a tool while it works on your codebase. All three sit on the same v1 API underneath, so switching surfaces never costs you data parity.

What's the difference between AI Readiness and AI Visibility?

AI Readiness is a structural readiness score for a single page, computed across 8 weighted dimensions: Structured Data Richness (20%), Heading Clarity (15%), FAQ Quality (15%), Content Depth (15%), Entity Identity (10%), Citation Formatting (10%), AI Crawler Access (10%), and Topical Authority (5%). It is fully derivable from the HTML at scan time and updates the moment you ship a fix. AI Visibility is an outcome metric. It queries real AI engines (ChatGPT, Perplexity, Claude, Gemini, AI Overview) with prompts you care about, then measures how often your domain is cited in the answers. AI Readiness is the input you control directly. AI Visibility is the result you measure once those inputs propagate into the engines' training and retrieval data.

Which AI engines does the AI Visibility check query, and how are tokens billed?

The check fans out across five engines: ChatGPT, Perplexity, Claude, Gemini, and Google AI Overview. Each query consumes monthly tokens at different rates because the underlying providers price differently: Gemini costs 1 token, ChatGPT and AI Overview cost 3 each, and Claude and Perplexity (both with live web search enabled) cost 5. Choose the engines you want via POST /api/v1/models. Most users disable the more expensive ones until a campaign warrants the spend. Gartner's 2024 forecast projected traditional search engine volume would drop 25% by 2026 as users move queries to AI assistants (Gartner press release, Feb 2024).

What rate limits apply, and what happens when I hit one?

Limits are per UTC day and per calendar month, scoped to your account. Free tier: 10 scans/day via API (5 via the website), 100/month. Launch ($49/mo): 50/day, 1,000/month, plus 4,000 AI Visibility tokens/month. Growth ($129/mo): 200/day, 5,000/month, 11,500 tokens/month. Enterprise ($299/mo): 1,000/day, 25,000/month, 27,000 tokens/month. When you exceed the daily ceiling the API returns HTTP 429 with a JSON body { "error": "rate_limited", "limitReached": true }. The reset clock ticks at 00:00 UTC. Cache scan results in your own store if you re-render reports across a day to avoid burning quota on identical inputs.

Can Foglift run inside a CI/CD pipeline as a quality gate?

Yes. That is the intended workflow for the CLI. Run `foglift scan https://your-staging-url --threshold 80` and the process exits with a non-zero code when overall score falls below 80, which fails the build. Pair it with --json to write the report to an artifact your team can inspect from the CI run. For GitHub Actions specifically, the official action `uses: banant2/Foglift@main` posts a Job Summary with scores and a link to the full report. Drop it in alongside Lighthouse CI or axe-core to catch SEO and AI Readiness regressions before they ship to production.

How do I track a competitor's AI visibility?

Add the queries you want to monitor with POST /api/v1/prompts (for example, "best AI search optimization tool" or "how to rank in ChatGPT"), then call POST /api/v1/ai-visibility to fan the queries across your enabled engines. The structured response includes a `mentions` array per engine, so any cited domain shows up there, yours or a competitor's. Tier caps how many brand workspaces you can track simultaneously: Launch supports 3 brands, Growth supports 10, Enterprise is unlimited. Run the check on a daily/twice-daily/hourly cadence by tier and compare deltas via GET /api/v1/ai-visibility/results.

Are scan results cached, or do they run live every time?

GET /api/v1/scan runs live on every request. A single scan typically completes in 8 to 15 seconds and includes a full HTML fetch, AI Readiness analysis, Lighthouse-derived performance metrics, security-header inspection, and a robots.txt check for AI crawler access (GPTBot, ClaudeBot, PerplexityBot, etc.). All scan results are persisted to the geo_results table. Pull historical scores via GET /api/v1/scan/history?url=... to trend a domain over time without spending a fresh quota slot. If you need the same domain re-scanned multiple times in a session, prefer caching the response in your application layer over hammering the endpoint.

Ready to integrate?

Start scanning with no API key required for basic scans.