Sentiment AnalysisSentiment Overview

Sentiment Overview

Positive vs. negative sentiment split for how AI answers talk about a tracked domain.

curl --request GET \
  --url 'https://api.aiclicks.io/api/v1/sentiment/overview?domain_id=8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3&days=30' \
  --header 'Authorization: Bearer ak_live_xxx'
{
  "data": {
    "positive_percent": 75.0,
    "negative_percent": 25.0,
    "total_mentions": 80
  },
  "domain_id": "8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3",
  "days": 30,
  "model": "all",
  "generated_at": "2026-06-17T10:00:11.218Z"
}

How LLMs feel about your brand right now, as a single split. Every sentiment theme extracted from AI answers in the window is tagged positive or negative; this endpoint returns the share of each plus the total number of mentions those themes cover.

Unlike the time-series endpoints, data here is a flat object — not a list.

domain_id is a required query parameter. Use GET /api/v1/domains to discover which domains the calling key can access.

Sentiment is a paid feature. The endpoint returns 403 unless the domain's team is on a Pro, Business, or Enterprise plan — in addition to the usual API-access requirement.

Authorizations

header
Authorizationstring
Required

Your API key formatted as Bearer ak_live_<your-key>. Create one in the dashboard under Settings → Developers.

header
X-Request-Idstring

Optional UUID for log correlation. If omitted, we generate one and echo it back in the response.

Query parameters

query
domain_idstring
Required

UUID of the domain. Find domains via GET /api/v1/domains. Omitting this returns 400.

query
daysinteger

Look-back window in days, 1–365. Defaults to 30. Counted as an exact window (today - days + 1), not snapped to buckets.

query
modelstring

Restrict to a single AI channel by generic nameChatGPT, Perplexity, Gemini, AI Overviews, Claude, Grok, Microsoft Copilot. Defaults to all (every channel). Raw model identifiers (e.g. gpt-4o-search) are also accepted for backwards compatibility. See Models.

Response

dataobject
Required

The sentiment split. A flat object — no items array.

positive_percentnumber
Required

Share of themes tagged positive, 0–100, rounded to one decimal. positive_count / (positive_count + negative_count) * 100.

negative_percentnumber
Required

Share of themes tagged negative, 0–100, rounded to one decimal. positive_percent + negative_percent sums to 100 (barring rounding) whenever any themes exist.

total_mentionsinteger
Required

Total occurrences across all themes in the window — the sum of each theme's occurrences. Not the theme count; a single theme can carry many mentions.

domain_idstring
Required

Echo of the requested domain.

daysinteger
Required

Echo of the requested window.

modelstring
Required

Echo of the requested model filter (all when unset).

generated_atstring
Required

ISO-8601 timestamp of when the server produced (or cached) this response.

Response headers

HeaderDescription
X-CacheHIT or MISS. Indicates whether the response came from cache.
X-Request-IdUnique request id. Echoes incoming if you set one.
X-RateLimit-LimitMax requests per minute for this key.
X-RateLimit-RemainingRequests remaining in current minute.
X-RateLimit-ResetUnix epoch seconds when the window resets.

Caching

Cached for 1 hour per (domain_id, days, model). Newly completed analyses appear after the TTL expires.

How sentiment is computed

Sentiment is derived from themes, not individual responses:

  1. During analysis, recurring topics in the AI answers about your brand are clustered into named themes.
  2. Each theme is classified positive or negative, and carries an occurrences count.
  3. This endpoint counts positive vs. negative themes in the window and expresses each as a percentage; total_mentions sums the occurrences.

To see the themes themselves, use GET /api/v1/sentiment/themes. For the day-by-day trend, use GET /api/v1/sentiment/time-series.

Errors

400 Bad Requesterror

domain_id query parameter missing. Body points you at /api/v1/domains.

401 Unauthorizederror

Missing, malformed, or revoked API key.

403 Forbiddenerror

Team's developer_access flag is off, the domain belongs to a team your API key is not scoped to, your allowed_domains allowlist excludes it, or the team's plan doesn't include sentiment (requires Pro, Business, or Enterprise).

404 Not Founderror

domain_id is malformed, does not exist, or your user is not a member of its team.

429 Too Many Requestserror

Rate limit exceeded. Inspect the Retry-After header for how long to wait.

Empty result

If no sentiment themes exist in the window, the response is a successful 200 with zeroes:

{
  "data": { "positive_percent": 0.0, "negative_percent": 0.0, "total_mentions": 0 },
  "domain_id": "8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3",
  "days": 30,
  "model": "all",
  "generated_at": "2026-06-17T10:00:11.218Z"
}