Live LLM Mentions Target Metrics Lite

Live LLM Mentions Target Metrics Lite endpoint is the simplified version of the Target Metrics endpoint and provides a simplified view of aggregated LLM mentions for keywords and domains specified in the target array of the request. The results are specific to the selected platform (google for Google’s AI Overview or chat_gpt for ChatGPT), location and language parameters (see the List of Locations & Languages).

checked POST
Pricing

The cost of the task can be calculated on the Pricing page.

All POST data should be sent in the JSON format (UTF-8 encoding). The task setting is done using the POST method. When setting a task, you should send all task parameters in the task array of the generic POST array. You can send up to 2000 API calls per minute, each Live LLM Mentions API call can contain only one task.

Execution time for tasks set with the Live LLM Mentions endpoint is currently up to 120 seconds.

Below you will find a detailed description of the fields you can use for setting a task.

Description of the fields for setting a task:

Field nameTypeDescription
targetarray

array of objects containing target entities
required field
you can specify up to 10 entities (objects) in the target field
one target entity can contain either one domain or one keyword and related parameters

examples:

target array with a domain entity
[{"domain": "en.wikipedia.org", "search_filter": "exclude"}]
target array with a keyword entity
[{"keyword": "bmw", "search_scope": ["question"], "match_type ": "partial_match"}]
target array with multiple entities
[{"domain": "en.wikipedia.org", "search_filter": "exclude"}, {"keyword": "bmw", "match_type ": "partial_match", "search_scope": ["answer"]}]
Note: requests must include at least one domain_entity or keyword_entity with "search_filter": "include"

    domain_entityobject

domain entity in the target array
example:
{"domain": "en.wikipedia.org", "search_filter": "exclude", "search_scope": ["sources"]}

        domainstring

target domain
required field if you don't specify keyword
you can specify up to 63 characters in the domain field;
a domain should be specified without https:// and www.

        search_filterstring

target domain search filter
optional field
possible values:
include, exclude
default value: include

        search_scopearray

target domain search scope
optional field
possible values:
any, sources, search_results
default value: any

        include_subdomainsboolean

indicates if the subdomains of the target domain will be included in the search
optional field
if set to true, the subdomains will be included in the search
default value: false

    keyword_entityobject

keyword entity in the target array
example:
{"keyword": "bmw", "search_filter": "include", "search_scope": ["question"], "match_type ": "partial_match"}

        keywordstring

target keyword
required field if you don't specify domain
you can specify up to 250 characters in the keyword field
all %## will be decoded (plus character ‘+’ will be decoded to a space character)
if you need to use the “%” character for your keyword, please specify it as “%25”;
if you need to use the “+” character for your keyword, please specify it as “%2B”

learn more about rules and limitations of keyword and keywords fields in DataForSEO APIs in this Help Center article

        search_filterstring

target keyword search filter
optional field
possible values:
include, exclude
default value: include

        search_scopearray

target keyword search scope
optional field
possible values:
any, question, answer, brand_entities, fan_out_queries
default value: any

        match_typestring

target keyword match type
defines how the specified keyword is matched
optional field
possible values:
word_match - full-text search for terms that match the specified seed keyword with additional words included before, after, or within the key phrase (e.g., search for "light" will return results with "light bulb", "light switch");
partial_match - substring search that finds all instances containing the specified sequence of characters, even if it appears inside a longer word (e.g., search for "light" will return results with "lighting", "highlight");
default value: word_match

location_namestring

full name of search location
optional field
if you use this field, you don't need to specify location_code
if you don't specify this field, the location_code with 2840 value will be used by default;
you can receive the list of available locations of the search engine with their location_name by making a separate request to the https://api.dataforseo.com/v3/ai_optimization/llm_mentions/locations_and_languages
Note: chat_gpt data is available for United States only

location_codeinteger

search location code
optional field
if you use this field, you don't need to specify location_name
you can receive the list of available locations of the search engine with their location_code by making a separate request to the https://api.dataforseo.com/v3/ai_optimization/llm_mentions/locations_and_languages
default value: 2840
Note: chat_gpt data is available for 2840 only

language_namestring

full name of search language
optional field
if you use this field, you don't need to specify language_code;
if you don't specify this field, the language_code with en value will be used by default;
you can receive the list of available languages of the search engine with their language_name by making a separate request to the https://api.dataforseo.com/v3/ai_optimization/llm_mentions/locations_and_languages
Note: chat_gpt data is available for English only

language_codestring

search language code
optional field
if you use this field, you don't need to specify language_name;
you can receive the list of available languages of the search engine with their language_code by making a separate request to the https://api.dataforseo.com/v3/ai_optimization/llm_mentions/locations_and_languages
default value: en
Note: chat_gpt data is available for en only

platformstring

target platform
optional field
possible values:
chat_gpt, google
Note: if the platform is not specified, the data is returned for both platforms
Note #2:chat_gpt data is available for the United States and English only

initial_dataset_filtersarray

array of filter expressions applied before aggregation
optional field
you can use this array to filter expressions applied to the raw mentions database before aggregation to limit the rows contributing to the result;

you can add several filters at once (8 filters maximum)
you should set a logical operator and, or between the conditions
the following operators are supported:
=, <>, in, not_in, like, not_like, ilike, not_ilike, match, not_match
you can use the % operator with like and not_like to match any string of zero or more characters
example:
["ai_search_volume",">",1000]

the full list of possible filters is available here.
learn more about the initial dataset filters in this help center article.

limitinteger

maximum number of results in the items array
optional field
you can use this parameter to limit the number of data objects you receive in the items array
minimum value: 1
maximum value: 1000
default value: 100

order_byarray

results sorting rules
optional field
you can use the same values as in the filters array to sort the results
possible sorting types:
asc - results will be sorted in the ascending order
desc - results will be sorted in the descending order
you should use a comma to set up a sorting type
example:
["ai_search_volume,desc"]
note that you can set no more than three sorting rules in a single request
you should use a comma to separate several sorting rules

offsetinteger

offset in the results array of the returned mentions data
optional field

default value: 0
example: if you specify the 10 value, the first ten mentions objects in the results array will be omitted and the data will be provided for the successive objects;
Note: the maximum value is 1000000

tagstring

user-defined task identifier
optional field
the character limit is 255
you can use this parameter to identify the task and match it with the result
you will find the specified tag value in the data object of the response



‌‌As a response of the API server, you will receive JSON-encoded data containing a tasks array with the information specific to the set tasks.

Description of the fields in the results array:
Field nameTypeDescription
versionstring

the current version of the API

status_codeinteger

general status code
you can find the full list of the response codes here
Note: we strongly recommend designing a necessary system for handling related exceptional or error conditions

status_messagestring

general informational message
you can find the full list of general informational messages here

timestring

execution time, seconds

costfloat

total tasks cost, USD

tasks_countinteger

the number of tasks in the tasks array

tasks_errorinteger

the number of tasks in the tasks array returned with an error

tasksarray

array of tasks

    idstring

task identifier
unique task identifier in our system in the UUID format

    status_codeinteger

status code of the task
generated by DataForSEO; can be within the following range: 10000-60000
you can find the full list of the response codes here

    status_messagestring

informational message of the task
you can find the full list of general informational messages here

    timestring

execution time, seconds

    costfloat

cost of the task, USD

    result_countinteger

number of elements in the result array

    patharray

URL path

    dataobject

contains the same parameters that you specified in the POST request

    resultarray

array of results

        total_countinteger

total amount of results relevant the request

        offsetinteger

the number of mentions objects that are omitted in the items array

        items_countinteger

the number of results returned in the items array

        aggregated_metricsobject

aggregated mentions metrics
in this case, always returns null

        itemsarray

array of aggregated mentions metrics
contains objects with aggregated mention metrics for the specified target

            locationinteger

location identifier
location of aggregated metrics

            languagestring

language identifier
language of aggregated metrics

            platformstring

LLM platform identifiers
LLM platform of aggregated metrics

            metricsobject

LLM metrics
metrics aggregated by specific parameters and respective identifiers

                mentionsinteger

total LLM mentions count
total count of mentions of the target

                ai_search_volumeinteger

aggregated AI search volume rate
total AI search volume across all mentions of the target
learn more about this metric here

‌‌

Instead of ‘login’ and ‘password’ use your credentials from https://app.dataforseo.com/api-access

# Instead of 'login' and 'password' use your credentials from https://app.dataforseo.com/api-access 
login="login" 
password="password" 
cred="$(printf ${login}:${password} | base64)" 
curl --location --request POST "https://api.dataforseo.com/v3/ai_optimization/llm_mentions/target_metrics_lite/live" 
--header "Authorization: Basic ${cred}"  
--header "Content-Type: application/json" 
--data-raw '[
    {
        "language_code": "es",
        "location_code": 2840,
        "platform": "google",
        "target": [
            {
                "domain": "en.wikipedia.org",
                "search_filter": "exclude"
            },
            {
                "keyword": "bmw",
                "search_scope": [
                    "answer"
                ]
            }
        ],
        "initial_dataset_filters": [
            [
                "ai_search_volume",
                ">",
                10
            ]
        ],
        "limit": 6
    }
]'
<?php

/**
 * Method: POST
 * Endpoint: https://api.dataforseo.com/v3/ai_optimization/llm_mentions/target_metrics_lite/live
 * @see https://docs.dataforseo.com/v3/ai_optimization/llm_mentions/target_metrics_lite/live
 */

require_once __DIR__ . '/../../../../../lib/RestClient.php';
$config = require __DIR__ . '/../../../../../lib/config.php';

$client = new RestClient($config['base_url'], null, $config['login'], $config['password']);

$data = [
    [
        'language_code' => 'es',
        'location_code' => 2840,
        'platform' => 'google',
        'target' => [
            [
                'domain' => 'en.wikipedia.org',
                'search_filter' => 'exclude',
            ],
            [
                'keyword' => 'bmw',
                'search_scope' => [
                    'answer',
                ],
            ],
        ],
        'initial_dataset_filters' => [
            [
                'ai_search_volume',
                '>',
                10,
            ],
        ],
        'limit' => 6,
    ],
];
try {
    $result = $client->post('/v3/ai_optimization/llm_mentions/target_metrics_lite/live', $data);
    print_r($result);
    // do something with post result
} catch (RestClientException $e) {
    printf(
        "HTTP code: %dnError code: %dnMessage: %snTrace: %sn",
        $e->getHttpCode(),
        $e->getCode(),
        $e->getMessage(),
        $e->getTraceAsString()
    );
}
?>
const axios = require('axios');

axios({
    method: 'post',
    url: 'https://api.dataforseo.com/v3/ai_optimization/llm_mentions/target_metrics_lite/live',
    auth: {
        username: 'login',
        password: 'password'
    },
    data: [{
      "language_code": "es",
      "location_code": 2840,
      "platform": "google",
      "target": [
        {
          "domain": "en.wikipedia.org",
          "search_filter": "exclude"
        },
        {
          "keyword": "bmw",
          "search_scope": [
            "answer"
          ]
        }
      ],
      "initial_dataset_filters": [
        [
          "ai_search_volume",
          ">",
          10
        ]
      ],
      "limit": 6
    }],
    headers: {
        'content-type': 'application/json'
    }
}).then(function (response) {
    var result = response['data']['tasks'];
    // Result data
    console.log(result);
}).catch(function (error) {
    console.log(error);
});
"""
Method: POST
Endpoint: https://api.dataforseo.com/v3/ai_optimization/llm_mentions/target_metrics_lite/live
@see https://docs.dataforseo.com/v3/ai_optimization/llm_mentions/target_metrics_lite/live
"""

import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../../../')))
from lib.client import RestClient
from lib.config import username, password
client = RestClient(username, password)

post_data = []
post_data.append({
        'language_code': 'es',
        'location_code': 2840,
        'platform': 'google',
        'target': [
            {
                'domain': 'en.wikipedia.org',
                'search_filter': 'exclude'
            },
            {
                'keyword': 'bmw',
                'search_scope': [
                    'answer'
                ]
            }
        ],
        'initial_dataset_filters': [
            [
                'ai_search_volume',
                '<',
                10
            ]
        ],
        'limit': 6
    })
try:
    response = client.post('/v3/ai_optimization/llm_mentions/target_metrics_lite/live', post_data)
    print(response)
    # do something with post result
except Exception as e:
    print(f'An error occurred: {e}')
/// <summary>
    /// Method: POST
    /// Endpoint: https://api.dataforseo.com/v3/ai_optimization/llm_mentions/target_metrics_lite/live
    /// </summary>
    /// <see href="https://docs.dataforseo.com/v3/ai_optimization/llm_mentions/target_metrics_lite/live"/>
    
    public static async Task LlmMentionsAggregatedMetricsLive()
    {
        var postData = new List<object>();
        // a simple way to set a task, the full list of possible parameters is available in documentation
        postData.Add(new
        {
            language_code = "es",
            location_code = 2840,
            platform = "google",
            target = new object[]
            {
                new
                {
                    domain = "en.wikipedia.org",
                    search_filter = "exclude"
                },
                new
                {
                    keyword = "bmw",
                    search_scope = new object[]
                    {
                        "answer"
                    }
                }
            },
            initial_dataset_filters = new object[]
            {
                new object[]
                {
                    "ai_search_volume",
                    ">",
                    10
                }
            },
            limit = 6
        });

        var content = new StringContent(JsonConvert.SerializeObject(postData), Encoding.UTF8, "application/json");
        using var response = await _httpClient.PostAsync("/v3/ai_optimization/llm_mentions/target_metrics_lite/live", content);
        var result = JsonConvert.DeserializeObject<dynamic>(await response.Content.ReadAsStringAsync());
        // you can find the full list of the response codes here https://docs.dataforseo.com/v3/appendix/errors
        if (result.status_code == 20000)
        {
            // do something with result
            Console.WriteLine(result);
        }
        else
            Console.WriteLine($"error. Code: {result.status_code} Message: {result.status_message}");
    }

The above command returns JSON structured like this:

{
  "version": "0.1.20251208",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "1.9593 sec.",
  "cost": 0.101,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "12121212-1535-0635-0000-a76352adde37",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "1.9079 sec.",
      "cost": 0.101,
      "result_count": 1,
      "path": [
        "v3",
        "ai_optimization",
        "llm_mentions",
        "target_metrics_lite",
        "live"
      ],
      "data": {
        "api": "ai_optimization",
        "function": "target_metrics_lite",
        "language_code": "es",
        "location_code": 2840,
        "platform": "google",
        "target": [
          {
            "domain": "en.wikipedia.org",
            "search_filter": "exclude"
          },
          {
            "keyword": "bmw",
            "search_scope": [
              "answer"
            ]
          }
        ],
        "limit": 6
      },
      "result": [
        {
          "total_count": 5,
          "offset": 0,
          "items_count": 5,
          "aggregated_metrics": null,
          "items": [
            {
              "location": "2276",
              "language": "de",
              "platform": "google",
              "metrics": {
                "mentions": 1704,
                "ai_search_volume": 675140
              }
            },
            {
              "location": "2840",
              "language": "en",
              "platform": "google",
              "metrics": {
                "mentions": 979,
                "ai_search_volume": 1030740
              }
            },
            {
              "location": "2528",
              "language": "nl",
              "platform": "google",
              "metrics": {
                "mentions": 351,
                "ai_search_volume": 104300
              }
            },
            {
              "location": "2840",
              "language": "en",
              "platform": "chat_gpt",
              "metrics": {
                "mentions": 198,
                "ai_search_volume": 4562
              }
            },
            {
              "location": "2826",
              "language": "en",
              "platform": "google",
              "metrics": {
                "mentions": 196,
                "ai_search_volume": 324970
              }
            },
            {
              "location": "2040",
              "language": "de",
              "platform": "google",
              "metrics": {
                "mentions": 153,
                "ai_search_volume": 35890
              }
            }
          ]
        }
      ]
    }
  ]
}