Live LLM Mentions Top Pages endpoint provides aggregated LLM mentions metrics grouped by the most frequently mentioned pages for the specified target. 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).
Instead of ‘login’ and ‘password’ use your credentials from https://app.dataforseo.com/api-access
using System;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Collections.Generic;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace DataForSeoSdk;
public class AiOptimization
{
private static readonly HttpClient _httpClient;
static AiOptimization()
{
_httpClient = new HttpClient
{
BaseAddress = new Uri("https://api.dataforseo.com/")
};
_httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Basic", ApiConfig.Base64Auth);
}
/// <summary>
/// Method: POST
/// Endpoint: https://api.dataforseo.com/v3/ai_optimization/llm_mentions/top_pages/live
/// </summary>
/// <see href="https://docs.dataforseo.com/v3/ai_optimization/llm_mentions/top_pages/live"/>
public static async Task LlmMentionsTopPagesLive()
{
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 = "en",
location_code = 2840,
platform = "google",
target = new object[]
{
new
{
keyword = "bmw",
search_scope = new object[]
{
"answer"
}
},
new
{
keyword = "auto",
search_scope = new object[]
{
"question"
},
match_type = "partial_match"
}
},
links_scope = "sources",
initial_dataset_filters = new object[]
{
new object[]
{
"ai_search_volume",
">",
10
}
},
items_list_limit = 3,
internal_list_limit = 2
});
var content = new StringContent(JsonConvert.SerializeObject(postData), Encoding.UTF8, "application/json");
using var response = await _httpClient.PostAsync("/v3/ai_optimization/llm_mentions/top_pages/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:
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 name
Type
Description
target
array
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"]}]
‘domain’ entity
object
domain entity in the target array
example: {"domain": "en.wikipedia.org", "search_filter": "exclude", "search_scope": ["sources"]}
domain
string
target domain required field if you don’t specify keyword
a domain should be specified without https:// and www.
search_filter
string
target domain search filter
optional field
possible values: include, exclude
default value: include
search_scope
array
target domain search scope
optional field
possible values: any, sources, search_results
default value: any
‘keyword’ entity
object
keyword entity in the target array
example: {"keyword": "bmw", "search_filter": "include", "search_scope": ["question"], "match_type ": "partial_match"}
keyword
string
target keyword required field if you don’t specify domain
you can specify up to 2000 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_filter
string
target keyword search filter
optional field
possible values: include, exclude
default value: include
search_scope
array
target keyword search scope
optional field
possible values: any, question, answer
default value: any
match_type
string
target keyword match type
optional field
possible values: word_match, partial_match word_match – full-text search for terms that match the specified seed keyword with additional words included before, after, or within the seed key phrase. partial_match – searches for any occurrence of the keyword or its parts within the content
default value: word_match
location_name
string
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
example: United States
location_code
integer
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
example: 2840
default value: 2840
language_name
string
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
language_code
string
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
platform
string
target platform
optional field
possible values: chat_gpt, google
default value: google
links_scope
string
links source scope
optional field
this parameter specifies which links will be used to extract pages and aggregation data
possible values: sources, search_results
default value: sources
initial_dataset_filters
array
array of results filtering parameters
optional field 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.
items_list_limit
integer
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: 10
default value: 5
internal_list_limit
integer
maximum number of elements within internal arrays
optional field
you can use this field to limit the number of elements within the following arrays: sources_domain search_results_domain
minimum value: 1
maximum value: 10
default value: 5
tag
string
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 name
Type
Description
version
string
the current version of the API
status_code
integer
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_message
string
general informational message
you can find the full list of general informational messages here
time
string
execution time, seconds
cost
float
total tasks cost, USD
tasks_count
integer
the number of tasks in the tasks array
tasks_error
integer
the number of tasks in the tasks array returned with an error
tasks
array
array of tasks
id
string
task identifier unique task identifier in our system in the UUID format
status_code
integer
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_message
string
informational message of the task
you can find the full list of general informational messages here
time
string
execution time, seconds
cost
float
cost of the task, USD
result_count
integer
number of elements in the result array
path
array
URL path
data
object
contains the same parameters that you specified in the POST request
result
array
array of results
total
object
aggregated mentions metrics summary
contains overall aggregated LLM mention metrics across all found top pages, grouped by various dimensions
location
array
location-based grouping
array of objects containing mention metrics segmented by geographical location
type
string
type of the element = ‘group_element‘
key
string
grouping identifier
the specific identifier for the grouping dimension
mentions
integer
total LLM mentions count
the number of times the target keyword or domain were mentioned in relation to this specific grouping key
ai_search_volume
integer
current AI search volume rate of a keyword
learn more about this metric here
impressions
integer
current AI impressions rate of a keyword
language
array
language-based grouping
array of objects containing mention metrics segmented by content language
type
string
type of the element = ‘group_element‘
key
string
grouping identifier
the specific identifier for the grouping dimension
mentions
integer
total LLM mentions count
the number of times the target keyword or domain were mentioned in relation to this specific grouping key
ai_search_volume
integer
current AI search volume rate of a keyword
learn more about this metric here
impressions
integer
current AI impressions rate of a keyword
platform
array
platform-based grouping
array of group elements containing mention metrics segmented by AI platform
type
string
type of the element = ‘group_element‘
key
string
grouping identifier
the specific identifier for the grouping dimension
mentions
integer
total LLM mentions count
the number of times the target keyword or domain were mentioned in relation to this specific grouping key
ai_search_volume
integer
current AI search volume rate of a keyword
learn more about this metric here
impressions
integer
current AI impressions rate of a keyword
sources_domain
array
found source domains relevant to the target
array of objects containing data on top domains that are cited as sources in LLM responses
type
string
type of the element = ‘group_element‘
key
string
grouping identifier
the specific identifier for the grouping dimension
in this case the field displays a found domain name
mentions
integer
total LLM mentions count
the number of times the target keyword or domain were mentioned in relation to the specific domain
ai_search_volume
integer
current AI search volume rate of a keyword
learn more about this metric here
impressions
integer
current AI impressions rate of a keyword
search_results_domain
array
found search results domains relevant to the target
array of objects containing data on top domains that appear in search results related to LLM queries
type
string
type of the element = ‘group_element‘
key
string
grouping identifier
the specific identifier for the grouping dimension
in this case the field displays a found domain name
mentions
integer
total LLM mentions count
the number of times the target keyword or domain were mentioned in relation to the specific domain
ai_search_volume
integer
current AI search volume rate of a keyword
learn more about this metric here
impressions
integer
current AI impressions rate of a keyword
items
array
individual pages results
array containing detailed mention metrics for each of the found top pages
key
string
URL of a found page
the URL of a page found in LLM mentions for the specified target
location
array
location-based grouping
array of objects containing page mention metrics segmented by geographical location
type
string
type of the element = ‘group_element‘
key
string
grouping identifier
the specific identifier for the grouping dimension
mentions
integer
total LLM mentions count
the number of times the target keyword or domain were mentioned in relation to this specific grouping key
ai_search_volume
integer
current AI search volume rate of a keyword
learn more about this metric here
impressions
integer
current AI impressions rate of a keyword
language
array
language-based grouping
array of objects containing page mention metrics segmented by content language
type
string
type of the element = ‘group_element‘
key
string
grouping identifier
the specific identifier for the grouping dimension
mentions
integer
total LLM mentions count
the number of times the target keyword or domain were mentioned in relation to this specific grouping key
ai_search_volume
integer
current AI search volume rate of a keyword
learn more about this metric here
impressions
integer
current AI impressions rate of a keyword
platform
array
platform-based grouping
array of group elements containing page mention metrics segmented by AI platform
type
string
type of the element = ‘group_element‘
key
string
grouping identifier
the specific identifier for the grouping dimension
mentions
integer
total LLM mentions count
the number of times the target keyword or domain were mentioned in relation to this specific grouping key
ai_search_volume
integer
current AI search volume rate of a keyword
learn more about this metric here
impressions
integer
current AI impressions rate of a keyword
sources_domain
array
source domains relevant to the specific page
array of objects containing data on domains that are cited as sources in LLM responses
type
string
type of the element = ‘group_element‘
key
string
grouping identifier
the specific identifier for the grouping dimension
in this case the field displays a found domain name
mentions
integer
total LLM mentions count
the number of times the target keyword or domain were mentioned in relation to the specific domain
ai_search_volume
integer
current AI search volume rate of a keyword
learn more about this metric here
impressions
integer
current AI impressions rate of a keyword
search_results_domain
array
search results domains relevant to the specific page
array of objects containing data on domains that appear in search results related to LLM queries
type
string
type of the element = ‘group_element‘
key
string
grouping identifier
the specific identifier for the grouping dimension
in this case the field displays a found domain name
mentions
integer
total LLM mentions count
the number of times the target keyword or domain were mentioned in relation to the specific domain
ai_search_volume
integer
current AI search volume rate of a keyword
learn more about this metric here