> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mentionlab.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Entities detected for one or more tags

> Returns the top `limit` entities per tag (default 20, max 100), ordered by visibility unless `sort` says otherwise, with the size of the full list (`entityCount`). `focus` returns the `focusKeys` entities and the primary entity with their rank, even outside the top `limit`.



## OpenAPI

````yaml https://api.mentionlab.io/api/docs-json post /api/v1/analytics/tags/entities
openapi: 3.0.0
info:
  title: MentionLab Public API v0.6.30-rc
  description: ''
  version: 0.6.30-rc
  contact: {}
servers:
  - url: https://api.mentionlab.io
security: []
tags: []
paths:
  /api/v1/analytics/tags/entities:
    post:
      tags:
        - Analytics - Tags
      summary: Entities detected for one or more tags
      description: >-
        Returns the top `limit` entities per tag (default 20, max 100), ordered
        by visibility unless `sort` says otherwise, with the size of the full
        list (`entityCount`). `focus` returns the `focusKeys` entities and the
        primary entity with their rank, even outside the top `limit`.
      operationId: TagsAnalyticsV1Controller_getEntities_v1
      parameters:
        - name: x-project-id
          in: header
          description: Project ID to specify the project context
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TagEntitiesDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TagEntitiesResponse'
        '400':
          description: >-
            The request failed validation — the body, query or path parameters
            are malformed or out of range.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: The request is missing valid authentication credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '403':
          description: >-
            The authenticated principal lacks the required permission, or access
            to the requested organisation/project.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
components:
  schemas:
    TagEntitiesDto:
      type: object
      properties:
        startDate:
          type: string
          description: Start date (inclusive)
          example: '2025-01-01'
        endDate:
          type: string
          description: End date (inclusive)
          example: '2025-01-31'
        countries:
          description: Filter by country codes
          example:
            - BE
            - FR
          type: array
          items:
            type: string
        languages:
          description: Filter by language codes
          example:
            - en
            - fr
          type: array
          items:
            type: string
        models:
          description: Filter by AI models
          example:
            - gpt-4o
            - claude-3-5-sonnet
          type: array
          items:
            type: string
        queryIds:
          description: Filter by query IDs
          example:
            - 3fa85f64-5717-4562-b3fc-2c963f66afa6
          type: array
          items:
            type: string
        hasSources:
          type: string
          description: >-
            Filter by source presence: "sources" (only with sources),
            "no_sources" (only without), "all" (no filter). Legacy true/false
            values are still accepted.
          enum:
            - all
            - sources
            - no_sources
        hasShopping:
          type: string
          description: >-
            Filter by shopping presence: "shopping" (only with shopping),
            "no_shopping" (only without), "all" (no filter). Legacy true/false
            values are still accepted.
          enum:
            - all
            - shopping
            - no_shopping
        hasAds:
          type: string
          description: >-
            Filter by sponsored-ad presence: "ads" (only with ads), "no_ads"
            (only without), "all" (no filter). Legacy true/false values are
            still accepted.
          enum:
            - all
            - ads
            - no_ads
        queryTagIds:
          description: Filter by query tag IDs (numeric — bigint column)
          example:
            - '42'
          type: array
          items:
            type: string
        execTagIds:
          description: Filter by execution tag IDs
          example:
            - 3fa85f64-5717-4562-b3fc-2c963f66afa6
          type: array
          items:
            type: string
        queryTagGroupIds:
          description: >-
            Filter by query tag group IDs — matches rows carrying any tag filed
            under a selected group. Combines with queryTagIds per queryTagMode.
          example:
            - 3fa85f64-5717-4562-b3fc-2c963f66afa6
          type: array
          items:
            type: string
        execTagGroupIds:
          description: >-
            Filter by execution tag group IDs — matches rows carrying any tag
            filed under a selected group. Combines with execTagIds per
            execTagMode.
          example:
            - 3fa85f64-5717-4562-b3fc-2c963f66afa6
          type: array
          items:
            type: string
        queryTypes:
          type: array
          description: >-
            Filter by query type. Include "untyped" to also match queries
            without a type. Results from since-deleted queries are excluded when
            this filter is set.
          items:
            type: string
            enum:
              - comparative
              - informative
              - perception
              - untyped
        queryTagMode:
          type: string
          description: >-
            Query tag matching mode: "and" matches ALL tags (default, the
            dashboard's), "or" matches ANY tag.
          enum:
            - and
            - or
        execTagMode:
          type: string
          description: >-
            Execution tag matching mode: "and" matches ALL tags (default, the
            dashboard's), "or" matches ANY tag.
          enum:
            - and
            - or
        timezone:
          type: string
          deprecated: true
          description: >-
            Deprecated and ignored. Date bounds and buckets are always UTC.
            Accepted for backward compatibility only.
          example: UTC
        groupBy:
          type: string
          description: >-
            Row grouping level for entity results. "none" = one row per entity,
            "division" = one row per division (entities not in a division get
            their own row), "group" = one row per top-level group (divisions
            roll up into their group). Defaults to "none".
          enum:
            - none
            - division
            - group
        groupByEntityGroup:
          type: boolean
          description: >-
            Deprecated — use groupBy instead. true is equivalent to
            groupBy="group".
          deprecated: true
          example: false
        showAllEntities:
          type: boolean
          description: >-
            Include entities that have only ever been seen in a single AI
            response. These are mostly one-off extraction noise and are hidden
            by default.
          example: false
        entityTypes:
          type: array
          description: >-
            Filter which entity types to include in results. Accepted values:
            "owned", "primary", "competitor". Defaults to all types when
            omitted.
          example:
            - owned
            - primary
            - competitor
          items:
            type: string
            enum:
              - owned
              - primary
              - competitor
        tagType:
          type: string
          description: Which tag system the tagIds belong to
          enum:
            - query
            - execution
          example: query
        tagIds:
          description: Tag IDs to get entities for
          example:
            - '42'
            - '43'
          type: array
          items:
            type: string
        limit:
          type: number
          description: >-
            Entities returned per tag: the top N in the sort order. The full
            list is not available (a large project holds about a million
            tag-entity rows); use `focusKeys` to get an entity outside the top
            N, and `entityCount` for the size of the full list.
          default: 20
          maximum: 100
          example: 15
        focusKeys:
          description: >-
            Display keys (the `displayKey` of an entity row) to return in
            `focus` with their rank, even outside the top `limit`. The project's
            primary entity is always in `focus`.
          example:
            - 550e8400-e29b-41d4-a716-446655440000
          type: array
          items:
            type: string
        sort:
          description: Per-tag sort. Defaults to visibility DESC.
          example:
            - field: visibility
              direction: desc
          type: array
          items:
            $ref: '#/components/schemas/SortOptions'
      required:
        - tagType
        - tagIds
    TagEntitiesResponse:
      type: object
      properties:
        tags:
          description: Per-tag entity results.
          type: array
          items:
            $ref: '#/components/schemas/TagEntitiesTopResult'
      required:
        - tags
    ApiErrorResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code of the error.
          example: 400
        message:
          type: string
          description: >-
            Human-readable description of the error. Validation failures return
            an array of per-field validation errors instead of a single string.
          example: Validation failed
        error:
          type: string
          description: Short name of the HTTP error.
          example: Bad Request
      required:
        - statusCode
    SortOptions:
      type: object
      properties:
        field:
          type: string
          description: Field name to sort by
        direction:
          type: string
          enum:
            - ASC
            - DESC
          description: Sort direction
      required:
        - field
        - direction
    TagEntitiesTopResult:
      type: object
      properties:
        tagId:
          type: string
          description: Tag ID (UUID).
          example: 550e8400-e29b-41d4-a716-446655440000
        resultCount:
          type: number
          description: >-
            Total number of AI responses for this tag in the filtered scope
            (denominator for visibility).
          example: 340
        entities:
          description: >-
            Detected entities for this tag with their metrics, in the request
            sort order (default visibility descending).
          type: array
          items:
            $ref: '#/components/schemas/TagEntityPoint'
        entityCount:
          type: number
          description: >-
            Number of entities in the full list for this tag (`entities` holds
            the top `limit` only). An entity absent from the tag ranks after all
            of them (entityCount + 1).
          example: 1240
        focus:
          description: >-
            The `focusKeys` entities and the project's primary entity with their
            rank, even outside the top `limit`. Ordered by rank. An entity with
            no mention in this tag is absent.
          type: array
          items:
            $ref: '#/components/schemas/TagEntityFocusPoint'
      required:
        - tagId
        - resultCount
        - entities
        - entityCount
        - focus
    TagEntityPoint:
      type: object
      properties:
        displayKey:
          type: string
          description: Canonical entity ID.
          example: 550e8400-e29b-41d4-a716-446655440000
        displayName:
          type: string
          description: Human-readable entity name.
          example: Acme Corp
        isOwned:
          type: boolean
          description: >-
            Whether this entity is owned by the project (i.e. the project's own
            brand or product).
          example: true
        isPrimary:
          type: boolean
          description: Whether this entity is the primary (main) entity for the project.
          example: false
        isCompetitor:
          type: boolean
          description: Whether this entity is a configured competitor of the project.
          example: true
        mentionCount:
          type: number
          description: Raw mention count of this entity in the tag's responses.
          example: 265
        visibility:
          type: number
          description: 'Visibility: % of this tag''s responses that mention this entity.'
          example: 77.9
        shareOfVoice:
          type: number
          description: >-
            Share of voice (%): this entity's responses over the sum of every
            entity's responses for this tag. Same definition as
            /analytics/visibility/share-of-voice.
          example: 32.1
        avgRanking:
          type: number
          description: >-
            Average position rank across all mention entries for this entity
            (not deduped). Lower values mean the entity tends to appear
            higher/earlier in responses.
          example: 1.8
        sentimentScore:
          type: number
          description: >-
            Average sentiment score for this entity's mentions within this tag.
            Scale: 0 (most negative) to 100 (most positive). Computed across raw
            mention rows (not deduped).
          example: 74.2
        sentiment:
          description: >-
            Sentiment breakdown — counts of entity mention entries by sentiment
            category (positive, neutral, negative).
          allOf:
            - $ref: '#/components/schemas/TagEntitySentiment'
      required:
        - displayKey
        - displayName
        - isOwned
        - isPrimary
        - isCompetitor
        - mentionCount
        - visibility
        - shareOfVoice
        - avgRanking
        - sentimentScore
        - sentiment
    TagEntityFocusPoint:
      type: object
      properties:
        displayKey:
          type: string
          description: Canonical entity ID.
          example: 550e8400-e29b-41d4-a716-446655440000
        displayName:
          type: string
          description: Human-readable entity name.
          example: Acme Corp
        isOwned:
          type: boolean
          description: >-
            Whether this entity is owned by the project (i.e. the project's own
            brand or product).
          example: true
        isPrimary:
          type: boolean
          description: Whether this entity is the primary (main) entity for the project.
          example: false
        isCompetitor:
          type: boolean
          description: Whether this entity is a configured competitor of the project.
          example: true
        mentionCount:
          type: number
          description: Raw mention count of this entity in the tag's responses.
          example: 265
        visibility:
          type: number
          description: 'Visibility: % of this tag''s responses that mention this entity.'
          example: 77.9
        shareOfVoice:
          type: number
          description: >-
            Share of voice (%): this entity's responses over the sum of every
            entity's responses for this tag. Same definition as
            /analytics/visibility/share-of-voice.
          example: 32.1
        avgRanking:
          type: number
          description: >-
            Average position rank across all mention entries for this entity
            (not deduped). Lower values mean the entity tends to appear
            higher/earlier in responses.
          example: 1.8
        sentimentScore:
          type: number
          description: >-
            Average sentiment score for this entity's mentions within this tag.
            Scale: 0 (most negative) to 100 (most positive). Computed across raw
            mention rows (not deduped).
          example: 74.2
        sentiment:
          description: >-
            Sentiment breakdown — counts of entity mention entries by sentiment
            category (positive, neutral, negative).
          allOf:
            - $ref: '#/components/schemas/TagEntitySentiment'
        rank:
          type: number
          description: >-
            Position of this entity in the tag's full list, in the request sort
            order (1 = first).
          example: 7
      required:
        - displayKey
        - displayName
        - isOwned
        - isPrimary
        - isCompetitor
        - mentionCount
        - visibility
        - shareOfVoice
        - avgRanking
        - sentimentScore
        - sentiment
        - rank
    TagEntitySentiment:
      type: object
      properties:
        positive:
          type: number
          description: Number of entity mention entries classified as positive sentiment.
          example: 165
        neutral:
          type: number
          description: Number of entity mention entries classified as neutral sentiment.
          example: 72
        negative:
          type: number
          description: Number of entity mention entries classified as negative sentiment.
          example: 28
      required:
        - positive
        - neutral
        - negative

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.