Skip to main content
POST
/
api
/
v1
/
analytics
/
visibility
/
timeseries
Per-entity visibility/position timeseries
curl --request POST \
  --url https://api.mentionlab.io/api/v1/analytics/visibility/timeseries \
  --header 'Content-Type: application/json' \
  --header 'x-project-id: <x-project-id>' \
  --data '
{
  "bucketSize": "day",
  "startDate": "2025-01-01",
  "endDate": "2025-02-01",
  "countries": [
    "BE",
    "FR"
  ],
  "languages": [
    "en",
    "fr"
  ],
  "models": [
    "gpt-4o",
    "claude-3-5-sonnet"
  ],
  "queryIds": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ],
  "queryTagIds": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ],
  "execTagIds": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ],
  "queryTagMode": "or",
  "execTagMode": "or",
  "timezone": "Europe/Brussels",
  "groupByEntityGroup": false,
  "entityTypes": [
    "owned",
    "primary",
    "competitor"
  ],
  "entityIds": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ],
  "metric": "visibility"
}
'
[
  {
    "bucket": "2025-01-01T00:00:00.000Z",
    "displayKey": "550e8400-e29b-41d4-a716-446655440000",
    "displayName": "Acme Corp",
    "isOwned": true,
    "isPrimary": true,
    "isCompetitor": false,
    "totalResponses": 150,
    "presentIn": 42,
    "visibilityPct": 28,
    "avgPositionRank": 2.5
  }
]

Headers

x-project-id
string
required

Project ID to specify the project context

Body

application/json
bucketSize
enum<string>
required

Time bucket granularity

Available options:
day,
week,
month
Example:

"day"

startDate
string

Start date (inclusive)

Example:

"2025-01-01"

endDate
string

End date (exclusive)

Example:

"2025-02-01"

countries
string[]

Filter by country codes

Example:
["BE", "FR"]
languages
string[]

Filter by language codes

Example:
["en", "fr"]
models
string[]

Filter by AI models

Example:
["gpt-4o", "claude-3-5-sonnet"]
queryIds
string[]

Filter by query IDs

Example:
["3fa85f64-5717-4562-b3fc-2c963f66afa6"]
hasSources
enum<string>

Filter by source presence: "sources" (only with sources), "no_sources" (only without), "all" (no filter). Legacy true/false values are still accepted.

Available options:
all,
sources,
no_sources
hasShopping
enum<string>

Filter by shopping presence: "shopping" (only with shopping), "no_shopping" (only without), "all" (no filter). Legacy true/false values are still accepted.

Available options:
all,
shopping,
no_shopping
queryTagIds
string[]

Filter by query tag IDs

Example:
["3fa85f64-5717-4562-b3fc-2c963f66afa6"]
execTagIds
string[]

Filter by execution tag IDs

Example:
["3fa85f64-5717-4562-b3fc-2c963f66afa6"]
queryTagMode
enum<string>
default:or

Query tag matching mode: "or" matches ANY tag (default), "and" matches ALL tags.

Available options:
and,
or
execTagMode
enum<string>
default:or

Execution tag matching mode: "or" matches ANY tag (default), "and" matches ALL tags.

Available options:
and,
or
timezone
string
default:UTC

IANA timezone for date bucketing and filtering (e.g. "Europe/Brussels"). Defaults to UTC.

Example:

"Europe/Brussels"

groupByEntityGroup
boolean
default:false

When true, entities in the same group are collapsed into one row, counted once per response.

Example:

false

entityTypes
enum<string>[]

Filter which entity types to include in results. Accepted values: "owned", "primary", "competitor". Defaults to all types when omitted.

Available options:
owned,
primary,
competitor
Example:
["owned", "primary", "competitor"]
entityIds
string[]

Restrict results to these entity IDs.

Example:
["3fa85f64-5717-4562-b3fc-2c963f66afa6"]
metric
enum<string>
default:visibility

Optional metric hint (visibility | position). Every response row always includes both visibilityPct and avgPositionRank regardless of this value.

Available options:
visibility,
position

Response

bucket
string
required

Start of the time bucket (ISO 8601). Granularity depends on the requested bucketSize (day/week/month).

Example:

"2025-01-01T00:00:00.000Z"

displayKey
string
required

Unique identifier for the entity or entity group. In per-entity mode this is the canonical entity ID; in grouped mode it is the entity group ID (or entity ID if ungrouped).

Example:

"550e8400-e29b-41d4-a716-446655440000"

displayName
string
required

Human-readable name of the entity or entity group.

Example:

"Acme Corp"

isOwned
boolean
required

Whether this entity is owned by the project (i.e. the project's own brand or product).

Example:

true

isPrimary
boolean
required

Whether this entity is the primary (main) entity for the project.

Example:

true

isCompetitor
boolean
required

Whether this entity is a configured competitor of the project.

Example:

false

totalResponses
number
required

Total number of AI responses in this time bucket (denominator for visibilityPct). Scoped by the request filters (project, date range, models, platforms, tags).

Example:

150

presentIn
number
required

Number of AI responses in this bucket that mention the entity/group (numerator for visibilityPct). A response mentioning multiple variants of the same canonical entity is counted once.

Example:

42

visibilityPct
number
required

Visibility percentage — how often this entity/group appears across AI responses in this bucket. Formula: (presentIn / totalResponses) × 100.

Example:

28

avgPositionRank
number
required

Weighted average position rank for this entity in this time bucket. Lower values mean the entity appears earlier in AI responses. 0 if no position data.

Example:

2.5