Skip to content

AI Optimization API Fresh

DataForSEO AI Optimization API provides the infrastructure for AI search optimization (AIO) — the practice of improving how brands, products, and content appear in LLM-generated responses. It covers keyword discovery, conversational search analytics, LLM benchmarking, and brand mention tracking across AI platforms.

What It Covers

The AI Optimization API consists of four purpose-driven sub-APIs covering 33 total endpoints:

Sub-APIPlatformsEndpointsWhat it does
LLM Responses APIChatGPT, Claude, Gemini, Perplexity13Generate and retrieve structured responses from LLMs based on your input parameters
LLM Scraper APIChatGPT Search, Gemini Search12Retrieve actual scraped AI search results — what users see in the AI search interface
AI Keyword Data APIAll platforms2Search volume estimates and user intent insights based on keyword usage across AI tools
LLM Mentions APIAll platforms6Track how often a brand, domain, or keyword is mentioned in LLM responses

Use Cases

  • Brand visibility monitoring — Measure how often your brand appears when users ask AI tools about your category
  • Competitor benchmarking — Compare your AI mention count against competitors across platforms
  • Content optimization for AI — Identify what topics and phrases drive LLM citations for your domain
  • AI keyword research — Discover which terms your target audience uses in AI-powered searches
  • Conversational query testing — Test how different LLMs respond to queries about your products or services

All Endpoints (33 total)

LLM Mentions (6 endpoints)

EndpointMethodDescription
/v3/ai_optimization/llm_mentions/search/livePOSTSearch for brand/keyword mentions across all LLM platforms
/v3/ai_optimization/llm_mentions/livePOSTGet mention overview and stats
/v3/ai_optimization/llm_mentions/tasks_postPOSTQueue async mention tasks
/v3/ai_optimization/llm_mentions/tasks_readyGETGet completed mention tasks
/v3/ai_optimization/llm_mentions/tasks_fixedGETGet re-parsed mention tasks
/v3/ai_optimization/llm_mentions/task_get/{id}GETRetrieve mention task results

ChatGPT LLM Responses (4 endpoints)

EndpointMethod
/v3/ai_optimization/chatgpt/tasks_postPOST
/v3/ai_optimization/chatgpt/tasks_readyGET
/v3/ai_optimization/chatgpt/tasks_fixedGET
/v3/ai_optimization/chatgpt/task_get/{id}GET

ChatGPT LLM Scraper (6 endpoints)

EndpointMethod
/v3/ai_optimization/chatgpt/llm_scraper/task_postPOST
/v3/ai_optimization/chatgpt/llm_scraper/tasks_readyGET
/v3/ai_optimization/chatgpt/llm_scraper/tasks_fixedGET
/v3/ai_optimization/chatgpt/llm_scraper/task_get/{id}GET
/v3/ai_optimization/chatgpt/llm_scraper/livePOST
/v3/ai_optimization/chatgpt/llm_scraper/locationsGET

Claude LLM Responses (4 endpoints)

See Claude Responses — Standard method only.

EndpointMethod
/v3/ai_optimization/claude/tasks_postPOST
/v3/ai_optimization/claude/tasks_readyGET
/v3/ai_optimization/claude/tasks_fixedGET
/v3/ai_optimization/claude/task_get/{id}GET

Gemini LLM Responses (4 endpoints) + LLM Scraper (6 endpoints)

See Gemini Responses

Perplexity LLM Responses (1 endpoint)

See Perplexity Responses

EndpointMethod
/v3/ai_optimization/perplexity/livePOST

AI Keyword Data (2 endpoints)

See AI Keyword Data

EndpointMethod
/v3/ai_optimization/ai_keyword_data/livePOST
/v3/ai_optimization/ai_keyword_data/locationsGET

Supported Platforms

PlatformLLM ResponsesLLM ScraperLLM Mentions
ChatGPT (OpenAI)Yes (Standard)Yes (Live + Standard)Yes
Claude (Anthropic)Yes (Standard)NoYes
Gemini (Google)Yes (Standard)Yes (Live + Standard)Yes
PerplexityYes (Live only)NoYes

Methods

The AI Optimization API supports two retrieval methods depending on the sub-API:

Live method — Instant results in a single POST request. No separate GET request needed. Used by LLM Mentions API and AI Keyword Data API. Also available for LLM Responses on supported platforms.

Standard method — Asynchronous: POST to set task, GET to retrieve results. More affordable than Live. Supports pingback_url and postback_url for webhook-style delivery. Used by LLM Responses and LLM Scraper APIs on platforms where Live is not available.

Sub-APILiveStandard
LLM ResponsesYes (platform-dependent)Yes
LLM ScraperNoYes
AI Keyword DataYesNo
LLM MentionsYesNo

Execution Times

  • Live method: Up to 120 seconds per request (LLM response generation takes time)
  • Standard method: May take up to 72 hours to complete

Rate Limits

  • Up to 2,000 API calls per minute
  • Maximum 30 simultaneous Live requests per account per platform

Quick Authentication Example

bash
curl --request POST \
  --url https://api.dataforseo.com/v3/ai_optimization/llm_mentions/search/live \
  --header 'Authorization: Basic BASE64(login:password)' \
  --header 'Content-Type: application/json' \
  --data '[{"keyword": "your brand name", "location_code": 2840, "language_code": "en"}]'

Python Setup

python
import requests
from requests.auth import HTTPBasicAuth
import json

LOGIN = "your_login"
PASSWORD = "your_password"

def ai_optimization_request(path, payload):
    url = f"https://api.dataforseo.com/v3/ai_optimization/{path}"
    response = requests.post(
        url,
        auth=HTTPBasicAuth(LOGIN, PASSWORD),
        headers={"Content-Type": "application/json"},
        data=json.dumps(payload)
    )
    return response.json()

Sandbox Testing

DataForSEO Sandbox is available for free testing. Sandbox requests return mock data in the same schema as production and do not consume credits.

Pricing

Cost varies by sub-API and method. Live method requests are priced higher than Standard. Check your account dashboard for current per-request pricing and spending summaries.

Internal SOP reference — not affiliated with DataForSEO.