Prompt AnalyticsTopic Metrics

Topic Metrics

Get one scorecard for each topic: prompts, answers, visibility, mentions, position, citations, sentiment and search volume.

curl --request GET \
  --url 'https://api.aiclicks.io/api/v1/topic-metrics?domain_id=8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3&days=30' \
  --header 'Authorization: Bearer ak_live_xxx'
{
  "data": {
    "items": [
      {
        "id": "d4c3b2a1-0000-4aaa-8bbb-000000000010",
        "name": "Inventory Software",
        "query_count": 25,
        "answers_count": 3480,
        "avg_visibility": 5,
        "total_mentions": 168,
        "avg_position": 6.2,
        "citation_count": 47078,
        "brand_citation_count": 149,
        "avg_sentiment": 0,
        "avg_volume": 11330
      },
      {
        "id": "d4c3b2a1-0000-4aaa-8bbb-000000000011",
        "name": "Warehouse Operations",
        "query_count": 12,
        "answers_count": 1669,
        "avg_visibility": 4,
        "total_mentions": 75,
        "avg_position": 4.0,
        "citation_count": 25005,
        "brand_citation_count": 132,
        "avg_sentiment": 0,
        "avg_volume": 5190
      }
    ]
  },
  "generated_at": "2026-11-09T05:50:44.151Z",
  "domain_id": "8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3",
  "days": 30,
  "model": "all"
}

This endpoint returns one scorecard for each topic of a domain. A scorecard adds up the metrics of all the prompts in the topic for the window.

Use this endpoint to find the topics where your brand is strong or weak. To compare groups of prompts by tag, use GET /api/v1/tag-metrics. To see each prompt, use GET /api/v1/prompt-metrics.

The domain_id parameter is required. To get domain IDs, use GET /api/v1/domains.

Authorizations

header
Authorizationstring
Required

Your API key in the format Bearer ak_live_<your-key>. To make a key, go to Settings → Developers in the dashboard.

header
X-Request-Idstring

An optional UUID to find the request in logs. If you do not send one, the server makes one and returns it.

Query parameters

query
domain_idstring
Required

The UUID of the domain. To get it, use GET /api/v1/domains.

query
modelstring

One AI channel by its generic name, or all. Examples: ChatGPT, Perplexity, Gemini, AI Overviews, AI Mode, Claude, Microsoft Copilot, Grok. The default is all.

query
daysinteger

The number of days to look back from today, from 1 to 365. The server uses the exact value. The default is 30.

query
start_datestring

The first day of a fixed window, in the format YYYY-MM-DD. Send it with end_date. Together, they replace days. The maximum range is 365 days.

query
end_datestring

The last day of a fixed window, in the format YYYY-MM-DD. The window includes this day. Send it with start_date.

query
freshboolean

If true, the server does not use the cache and calculates the result again. The default is false.

Response

dataobject
Required

The topic scorecards.

itemsarray
Required

One scorecard for each topic of the domain.

domain_idstring
Required

The domain that you requested.

daysinteger
Required

The window that you requested.

modelstring
Required

The model filter that you requested. If you did not send one, the value is all.

generated_atstring
Required

The ISO-8601 time when the server made or cached this response.

Response headers

HeaderDescription
X-CacheHIT or MISS. If you send fresh=true, the value is REFRESH.
X-Request-IdThe unique ID of the request. If you sent one, the server returns the same value.
X-RateLimit-LimitThe maximum number of requests each minute for this key.
X-RateLimit-RemainingThe number of requests that remain in the current minute.
X-RateLimit-ResetThe Unix time in seconds when the window starts again.

Caching

The server keeps each response in the cache for 1 hour. The cache key includes the domain, model and the dates of the window. A new topic shows after the cache expires. To get it at once, send fresh=true.

Errors

400 Bad Requesterror

A date is not in the format YYYY-MM-DD, start_date is after end_date, or the range is longer than 365 days.

401 Unauthorizederror

The API key is missing, not correct, or revoked.

403 Forbiddenerror

API access is off for the team, or the domain is in a team that your key cannot access.

404 Not Founderror

The domain_id is not valid, does not exist, or is not in your team.

422 Unprocessable Entityerror

domain_id is missing, or days is out of range.

429 Too Many Requestserror

You sent too many requests. Read the Retry-After header to know how long to wait.

Empty result

If the domain has no topics, the server returns 200 with an empty list:

{
  "data": { "items": [] },
  "generated_at": "2026-11-09T05:50:44.151Z",
  "domain_id": "8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3",
  "days": 30,
  "model": "all"
}