REST API v2

Comprehensive API for AI Visibility, Sentiment, GEO Optimization, Content Generation, Web Analytics, and AI Commerce.

v2 — Current Version
v1 endpoints remain available for backward compatibility

Overview

The Opttab REST API v2 is designed for partners and users who want to integrate AI visibility analytics, sentiment analysis, GEO optimization, content generation, web analytics, and AI commerce features into their own platforms and workflows.

Key use cases:

  • Partner Dashboard Integration — Embed AI visibility and sentiment scores in your own dashboard (e.g., ProductsUp showing Opttab-powered metrics)
  • Automated Reporting — Generate visibility, sentiment, citation, and competitors-by-AI-model reports programmatically
  • Category Visibility Prompt Generation — Generate prompts from categories, brands, and intents; save them and receive AI model responses via API
  • GEO Optimization at Scale — Analyze hundreds of pages for AI-readiness and get recommendations
  • Content Generation — Create GEO-optimized blog posts, product descriptions, and marketing content via API
  • MCP Server Management — List and manage your Model Context Protocol servers
  • AI Commerce — Track campaigns, competitor analytics, and advertising metrics

Base URL

https://opttab.com/api/v2

Authentication

All v2 API requests require authentication. The API supports multiple authentication methods:

1. API Key (Recommended for server-to-server)

curl -H "X-API-Key: opttab_xxxxxxxxxxxxxxxxxxxx" \
     "https://opttab.com/api/v2/org/info"

2. OAuth Bearer Token

curl -H "Authorization: Bearer your_oauth_token" \
     "https://opttab.com/api/v2/org/info"

Generate API keys from your dashboard at Dashboard → Settings → API Keys. Each key is scoped to your organization and can have granular permissions.

Response Format

All API responses use a consistent JSON structure:

Success Response

{
  "success": true,
  "data": { ... },
  "meta": {
    "total_rows": 250,
    "limit": 100,
    "offset": 0
  },
  "info": {
    "api_version": "v2",
    "timestamp": "2026-02-09T12:00:00Z"
  }
}

Error Response

{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "The start_date field must be a valid date."
  },
  "info": {
    "api_version": "v2",
    "timestamp": "2026-02-09T12:00:00Z"
  }
}

Rate Limiting

Default rate limits: 600 requests per hour per API key.

Rate Limit Headers

X-RateLimit-Limit: 600
X-RateLimit-Remaining: 595
X-RateLimit-Reset: 1707480000

When the limit is exceeded, a 429 Too Many Requests response is returned with a Retry-After header. Contact support for higher limits.

Endpoints Overview

Method Endpoint Description
Organization
GET /v2/org/info Account & workspace info
GET /v2/org/prompts List tracked prompts (with visibility score overall & by AI model)
POST /v2/org/prompts Create a new prompt
GET /v2/org/tags List all tags with sub-tags
GET /v2/org/tags/{tag}/sub-tags List sub-tags for a specific tag
Prompt Generation (Category Visibility)
POST /v2/prompts/generate Generate prompts from categories, brands & intents
POST /v2/prompts/store Save prompts & start AI response generation
GET /v2/prompts/{id}/responses Get AI responses for a prompt
Reports
POST /v2/reports/visibility AI visibility scores report
POST /v2/reports/sentiment Sentiment analysis report
POST /v2/reports/competitors-by-model Competitors grouped by AI model (visibility per model)
POST /v2/reports/responses AI model responses with full text
POST /v2/reports/citations Citation/source data from AI responses
POST /v2/reports/web-analytics Web analytics (AI traffic, bot crawls)
GEO Optimization
POST /v2/geo/analyze Analyze a page for GEO score
POST /v2/geo/batch Batch analyze up to 10 URLs
Content Generation
GET /v2/content/documents List generated documents
POST /v2/content/generate Generate AI content (blog, product desc, etc.)
MCP Servers
GET /v2/mcp/servers List MCP servers
GET /v2/mcp/servers/{id} Get MCP server details with tools
AI Commerce
GET /v2/commerce/campaigns List AI ad campaigns
GET /v2/commerce/campaigns/{id}/metrics Campaign performance metrics
GET /v2/commerce/competitors Tracked competitors
Dashboard
GET /v2/dashboard/summary Complete summary for partner dashboards

Quick Start

1

Generate an API Key

Go to Dashboard → Settings → API Keys and generate a new key with v2 permissions.

2

Test Your Connection

Verify your API key works with a simple request:

curl -H "X-API-Key: opttab_xxxxxxxxxxxxxxxxxxxx" \
     "https://opttab.com/api/v2/org/info"
3

Get AI Visibility Data

Pull a visibility report:

curl -X POST \
     -H "X-API-Key: opttab_xxxxxxxxxxxxxxxxxxxx" \
     -H "Content-Type: application/json" \
     -d '{
       "start_date": "2026-01-01",
       "end_date": "2026-01-31",
       "group_by": "ai_model"
     }' \
     "https://opttab.com/api/v2/reports/visibility"
4

Get Dashboard Summary (Partner Integration)

Fetch everything in one call for your dashboard embed:

curl -H "X-API-Key: opttab_xxxxxxxxxxxxxxxxxxxx" \
     "https://opttab.com/api/v2/dashboard/summary?period=30d"
5

Filter by Tags & Sub-Tags

Categorize your prompts with tags and sub-tags, then use them to scope any report:

# List all available tags
curl -H "X-API-Key: opttab_xxxxxxxxxxxxxxxxxxxx" \
     "https://opttab.com/api/v2/org/tags"

# Filter visibility report by tags
curl -X POST \
     -H "X-API-Key: opttab_xxxxxxxxxxxxxxxxxxxx" \
     -H "Content-Type: application/json" \
     -d '{
       "start_date": "2026-01-01",
       "end_date": "2026-01-31",
       "tags": ["brand_monitoring"],
       "sub_tags": ["competitor_comparison"],
       "group_by": "ai_model"
     }' \
     "https://opttab.com/api/v2/reports/visibility"

Partner Integration

The v2 API is designed for partners like ProductsUp to display Opttab-powered AI visibility and GEO metrics on their own dashboards. The /v2/dashboard/summary endpoint provides a single-call summary including:

  • AI Visibility Score — Average visibility across all AI models
  • Sentiment Score — How positively AI models reference your brand (0-100)
  • Citations — How many AI responses cite your content
  • AI Model Breakdown — Per-model visibility and response counts
  • Prompt Tracking — Number of tracked prompts

Example: Dashboard Summary Response

{
  "success": true,
  "data": {
    "visibility": {
      "score": 72.5,
      "confidence": 0.85,
      "total_responses": 1250
    },
    "sentiment": {
      "score": 68.3,
      "mentions_count": 340
    },
    "citations": {
      "total": 89
    },
    "ai_models": [
      {
        "ai_model": "chatgpt",
        "response_count": 520,
        "avg_visibility": 74.2
      },
      {
        "ai_model": "gemini",
        "response_count": 380,
        "avg_visibility": 71.1
      },
      {
        "ai_model": "claude",
        "response_count": 350,
        "avg_visibility": 70.8
      }
    ],
    "prompts": {
      "total_tracked": 25
    }
  },
  "meta": {
    "period": "30d",
    "generated_at": "2026-02-09T12:00:00Z",
    "cache_ttl": 300
  }
}

SDKs & Client Libraries

Python

pip install opttab

from opttab import OpttabClient

client = OpttabClient(api_key="opttab_xxx")
summary = client.dashboard.summary(period="30d")
print(summary.visibility.score)

Coming soon

JavaScript / Node.js

npm install @opttab/sdk

import { OpttabClient } from '@opttab/sdk';

const client = new OpttabClient({ apiKey: 'opttab_xxx' });
const summary = await client.dashboard.summary({ period: '30d' });
console.log(summary.visibility.score);

Coming soon

Explore the API

Dive into the detailed endpoint documentation for each feature area.

Need Help?

For partner onboarding, custom integrations, or higher rate limits, contact our team.

Contact Support →