API

AI Search

You are reading the Data API docs

Base URL: api.seranking.com

Data API and Project API keys are not interchangeable — use the correct one to avoid authentication errors.

Data apikey example:
80cfee7d-xxxx-xxxx-xxxx-fc8500816bb3
(UUID format)
Project apikey example:
253a73adxxxxxxxxxxxxxx340aa0a939
(40-char hex)

API keys are available in your account. For any questions or 401 errors, email [email protected] for support.

AI Search API provides programmatic access to a domain’s performance in Large Language Model (LLM) results. Data is refreshed on a monthly basis.

Using the API, you can:

  • get an AI search overview with metrics like link presence, average position, AI traffic, and historical trends
  • compare a primary domain against competitors across multiple LLM engines and retrieve a share of voice leaderboard
  • discover the brand associated with a domain or URL
  • retrieve prompts by target, showing where a domain or URL appears in LLM responses
  • retrieve prompts by brand, showing where a brand is mentioned in LLM results

Get AI search overview

Retrieves a high-level overview of a domain’s brand presence in an LLM, including historical trends over time and other metrics like link presence, average position, and AI traffic.

Request parameters

ParameterTypeRequiredDefaultDescription
engineStringYesN/ALLM to query (e.g., ai-overviewchatgptperplexitygeminiai-mode).
targetStringYesN/ATarget to analyze for LLM performance. Can be a root domain, subdomain, or a specific URL (e.g., seranking.com).
sourcestringYesN/ACountry code for the regional prompt database (e.g., us for the United States results). For acceptable values, see Regional database codes.
scopeStringNobase_domainScope of analysis:
• base_domain – aggregate by registrable domain, includes all subdomains.
• domain – exact host only, no subdomain aggregation.
• url – exact URL including path and query.
brandStringNoN/ABrand to filter the brand presence analysis (e.g., SE Ranking).

Request example

Copy
curl --location 'https://api.seranking.com/v1/ai-search/overview/by-engine/time-series?target=seranking.com&source=us&engine=ai-overview' \
--header 'Authorization: Token YOUR_API_KEY'

Response parameters

If successful, the server returns a JSON object containing aggregated metrics, changes from the previous period, and time-series data for generating charts.

ParameterTypeDescription
summaryObjectObject containing key performance metrics like brand_presence, link_presenceaverage_position, and ai_opportunity_traffic.
time_seriesObjectObject containing historical data arrays for overall_trafficorganic_trafficai_trafficlink_presence, and average_position.

Each object within the summary object has the following structure:

ParameterTypeDescription
currentFloatValue for the current period.
previousFloatValue for the previous period.
change_absoluteFloatAbsolute difference between the current and previous periods.
change_percentFloatPercentage change between the current and previous periods.

Each array within the time_series object contains a series of objects with the following structure:

ParameterTypeDescription
dateStringMonth and year of the data point in YYYY-MM format.
valueFloatMetric’s value for that month.

Response example

Copy
{
"summary": {
"brand_presence": {
"current": 50,
"previous": 45,
"change_absolute": 5,
"change_percent": 11.1
},
"link_presence": {
"current": 120,
"previous": 110,
"change_absolute": 10,
"change_percent": 9.1
},
"average_position": {
"current": 8.5,
"previous": 9.2,
"change_absolute": 0.7,
"change_percent": 7.6
},
"ai_opportunity_traffic": {
"current": 2000,
"previous": 1800,
"change_absolute": 200,
"change_percent": 11.1
}
},
"time_series": {
"overall_traffic": [
{ "date": "2025-08", "value": 43000 },
{ "date": "2025-09", "value": 45000 }
],
"organic_traffic": [
{ "date": "2025-08", "value": 40000 },
{ "date": "2025-09", "value": 42000 }
],
"ai_traffic": [
{ "date": "2025-08", "value": 3000 },
{ "date": "2025-09", "value": 3000 }
],
"link_presence": [
{ "date": "2025-08", "value": 110 },
{ "date": "2025-09", "value": 120 }
],
"average_position": [
{ "date": "2025-08", "value": 9.2 },
{ "date": "2025-09", "value": 8.5 }
]
}
}

Get AI search leaderboard

POST https://api.seranking.com/v1/ai-search/overview/leaderboard
Cost: 7,500 credits per request (flat)

Compares a primary domain against up to 10 competitors across multiple LLM engines and returns a share of voice leaderboard showing which domains have the highest AI search visibility. The leaderboard is calculated based on both brand and link presence across the selected engines.

Request parameters

ParameterTypeRequiredDefaultDescription
primaryObjectYesN/APrimary domain and brand information.
competitorsArrayYesN/AList of competitors to compare (1–10 items).
scopeStringNobase_domainScope of the analysis: 
• base_domain – aggregate by registrable domain, includes all subdomains. 
• domain – exact host only, no subdomain aggregation.
• url – exact URL including path and query.
sourceStringYesN/ACountry code for the regional database (e.g., us for United States results). For acceptable values, see Regional database codes.
enginesArrayYesN/ALLM engines to query (ai-overviewchatgptperplexitygeminiai-mode).

Each object within the primary parameter has the following structure:

ParameterTypeRequiredDescription
targetStringYesTarget to analyze for LLM performance. Can be a root domain, subdomain, or a specific URL (e.g., seranking.com).
brandStringNoBrand name (e.g., SE Ranking).

Each object within the competitors parameter has the following structure:

ParameterTypeRequiredDescription
targetStringYesCompetitor to analyze for LLM performance. Can be a root domain, subdomain, or a specific URL (e.g., semrush.com).
brandStringNoCompetitor brand name (e.g., Semrush).

Request example

Copy
curl --location 'https://api.seranking.com/v1/ai-search/overview/leaderboard' \
--header 'Authorization: Token YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"primary": {
"target": "example.com",
"brand": "Example"
},
"competitors": [
{ "target": "example1.com", "brand": "Example 1" },
{ "target": "example2.com", "brand": "Example 2" }
],
"scope": "base_domain",
"source": "us",
"engines": ["ai-overview", "chatgpt", "perplexity"]
}'

Response parameters

If successful, the server returns a JSON object containing leaderboard and per-domain, per-engine metrics.

ParameterTypeDescription
request_metadataObjectMetadata describing the request.
leaderboardArrayLeaderboard of domains sorted by share of voice.
resultsObjectDetailed per-domain, per-engine metrics.

Each object in request_metadata has the following structure:

ParameterTypeDescription
primaryStringPrimary target domain.
competitorsArrayCompetitor domains included in the request.
enginesArrayEngines used for the comparison.
sourceStringCountry code for the regional database.

Each object in leaderboard array has the following structure:

ParameterTypeDescription
rankIntegerPosition in the leaderboard (1 = highest share of voice).
domainStringDomain name.
share_of_voiceFloatCalculated share of voice.
brand_presenceIntegerTotal brand mentions across selected engines.
link_presenceIntegerTotal link citations across selected engines.
is_primary_targetBooleanIndicates whether this is the primary domain.

Each object in results has the following structure:

  • Each domain object (results.{domain}) contains:
ParameterTypeDescription
{engine}ObjectMetrics for a specific engine.
  • Each engine object (results.{domain}.{engine}) contains:
ParameterTypeDescription
brand_presenceIntegerBrand presence for this domain on this engine.
link_presenceIntegerLink presence for this domain on this engine.

Response example

Copy
{
"results": {
"example.com": {
"chatgpt": {
"brand_presence": 5,
"link_presence": 18
},
"ai-overview": {
"brand_presence": 4798,
"link_presence": 9245
},
"perplexity": {
"brand_presence": 162,
"link_presence": 416
}
},
"example1.com": {
"chatgpt": {
"brand_presence": 3042,
"link_presence": 287
},
"ai-overview": {
"brand_presence": 13688,
"link_presence": 10083
},
"perplexity": {
"brand_presence": 737,
"link_presence": 730
}
},
"example2.com": {
"chatgpt": {
"brand_presence": 55,
"link_presence": 324
},
"ai-overview": {
"brand_presence": 20161,
"link_presence": 37952
},
"perplexity": {
"brand_presence": 466,
"link_presence": 2816
}
}
},
"request_metadata": {
"engines": [
"ai-overview",
"chatgpt",
"perplexity"
],
"competitors": [
"example1.com",
"example2.com"
],
"source": "us",
"primary": "example.com"
},
"leaderboard": [
{
"rank": 1,
"link_presence": 41092,
"share_of_voice": 0.5719,
"is_primary_target": false,
"brand_presence": 20682,
"domain": "example2.com"
},
{
"rank": 2,
"link_presence": 11100,
"share_of_voice": 0.2923,
"is_primary_target": false,
"brand_presence": 17467,
"domain": "example1.com"
},
{
"rank": 3,
"link_presence": 9679,
"share_of_voice": 0.1358,
"is_primary_target": true,
"brand_presence": 4965,
"domain": "example.com"
}
]
}

Discover brand by URL

Identifies the brand name associated with the specified target domain. This utility endpoint is useful for programmatically finding a brand before using it in other queries.

Request parameters

ParameterTypeRequiredDefaultDescription
targetStringYesN/ATarget to analyze for LLM performance. Can be a root domain, subdomain, or a specific URL (e.g., seranking.com).
sourceStringYesN/ACountry code for the regional prompt database (e.g., us for United States results). For acceptable values, see Regional database codes.
scopeStringYesbase_domainScope of analysis:
• base_domain – aggregate by registrable domain, includes all subdomains.
• domain – exact host only, no subdomain aggregation.
• url – exact URL including path and query.

Request example

Copy
curl --location 'https://api.seranking.com/v1/ai-search/discover-brand?target=microsoft.com&scope=domain&source=us' \
--header 'Authorization: Token YOUR_API_KEY'

Response parameters

If successful, the server returns a JSON object containing an array of discovered brand names.

ParameterTypeDescription
brandsArrayArray of strings, each a potential brand name.

Response example

Copy
{
"brands": [
"Microsoft"
]
}

Get prompts by target

Retrieves a paginated list of prompts where the specified domain, subdomain, or URL appears in LLM results.

Request parameters

ParameterTypeRequiredDefaultDescription
engineStringYesN/ALLM to query (e.g., ai-overviewchatgptperplexitygeminiai-mode).
targetStringYesN/ATarget to analyze for LLM performance. Can be a root domain, subdomain, or a specific URL.
sourceStringYesN/ACountry code for the regional prompt database (e.g., us for United States results).

For acceptable values, see Regional database codes.
scopeStringYesbase_domainScope of the analysis:
• base_domain – aggregate by registrable domain, includes all subdomains.
• domain – exact host only, no subdomain aggregation.
• url – exact URL including path and query.
sortStringNovolumeField to sort the results by: volume, type, snippet_length.
sort_orderStringNodescSort order for the results:
• asc – for ascending
• desc – for descending
limitIntegerNo100Maximum number of prompts to return per page (max 1000).
offsetIntegerNo0Starting position for the paginated list.
filterObjectNoN/AObject for filtering results. See the Filtering results section for details.

Request example

Copy
curl --location --globoff 'https://api.seranking.com/v1/ai-search/prompts-by-target?target=seranking.com&scope=domain&source=us&engine=ai-mode&limit=1' \
--header 'Authorization: Token YOUR_API_KEY'

Response parameters

If successful, the server returns a JSON object containing a list of prompts and metadata.

ParameterTypeDescription
totalIntegerTotal number of prompts found for the target.
dateStringDate of the data snapshot in YYYY-MM-DD format.
promptsArrayArray of objects, each representing a found prompt.

Each object in the prompts array has the following structure:

ParameterTypeDescription
promptStringUser query or prompt text that triggered the LLM response.
volumeIntegerEstimated monthly search volume for the prompt.
typeStringType of appearance for the target in the LLM result (e.g., Link, Brand).
answerObjectObject containing the detailed response from the LLM.

The answer object contains the following fields:

ParameterTypeDescription
textStringFull text of the snippet generated by the LLM.
linksArrayArray of URL strings that were included as links within the LLM’s answer.

Response example

Copy
{
"total": 5448,
"date": "2025-09-01",
"prompts": [
{
"prompt": "peliculas en netflix",
"volume": 14800,
"type": "Link",
"answer": {
"text": "Hay una gran variedad de peliculas disponibles en Netflix...",
"links": [ "[https://movies.sitioficial.netflix.com/browse/genre/34399](https://movies.sitioficial.netflix.com/browse/genre/34399)" ]
}
}
]
}

Get prompts by brand

Retrieves a paginated list of prompts where the specified brand name is mentioned in LLM results.

Request parameters

ParameterTypeRequiredDefaultDescription
engineStringYesN/ALLM to query (e.g., ai-overviewchatgptperplexitygeminiai-mode).
brandStringYesN/ABrand name to search for in LLM snippets.
sourceStringYesN/ACountry code for the regional prompt database (e.g., us for United States results). For acceptable values, see Regional database codes.
sortStringNovolumeField to sort the results by: volume, type, snippet_length.
sort_orderStringNodescSort order for the results:
• asc – for ascending
• desc – for descending
limitIntegerNo100Maximum number of prompts to return per page (max 1000).
offsetIntegerNo0Starting position for the paginated list.
filterObjectNoN/AObject for filtering results. See the Filtering results section for details.

Request example

Copy
curl --location 'https://api.seranking.com/v1/ai-search/prompts-by-brand?brand=Netflix&source=us&engine=perplexity&sort=volume&sort_order=desc&offset=0&limit=10' \
--header 'Authorization: Token YOUR_API_KEY'

Response parameters

If successful, the server returns a JSON object containing a list of prompts that mention the specified brand.

ParameterTypeDescription
totalIntegerTotal number of times the brand has been mentioned in the specified LLM for the current month.
dateStringDate of the data snapshot in YYYY-MM-DD format.
promptsArrayArray of objects, each representing a found prompt. See the structure below for details.

Each object in the prompts array has the following structure:

ParameterTypeDescription
promptStringUser query or prompt text that triggered the LLM response.
volumeIntegerEstimated monthly search volume for the prompt.
typeStringType of appearance for the target in the LLM result (e.g., Link, Brand).
answerObjectObject containing the detailed response from the LLM.

The answer object contains the following fields:

ParameterTypeDescription
textStringFull text of the snippet generated by the LLM.
linksArrayArray of URL strings that were included as links within the LLM’s answer.

Response example

Copy
{
"total": 5448,
"date": "2025-09-01",
"prompts": [
{
"prompt": "peliculas en netflix",
"volume": 14800,
"type": "Link",
"answer": {
"text": "Hay una gran variedad de peliculas disponibles en Netflix...",
"links": [ "[https://movies.sitioficial.netflix.com/browse/genre/34399](https://movies.sitioficial.netflix.com/browse/genre/34399)" ]
}
}
]
}

Filtering results

The Get prompts by target and Get prompts by brand endpoints support advanced filtering to refine your search results. The filter parameter is passed as an object in the query string.

Range filters (volume, keyword_count, characters_count)

These filters allow you to specify a numeric range for your results. Both from and to values are inclusive. You can use one or both to define the range.

  • To get values greater than or equal to a number: Use filter[<parameter>][from]=<value>.
    • Example: filter[volume][from]=100 returns prompts with a search volume of 100 or more.
  • To get values less than or equal to a number: Use filter[<parameter>][to]=<value>.
    • Example: filter[keyword_count][to]=5 returns prompts with 5 or fewer words.
  • To get values within a specific range: Use both from and to.
    • Example: filter[characters_count][from]=10&filter[characters_count][to]=50 returns prompts that are between 10 and 50 characters long.

Text search filters (multi_keyword_included, multi_keyword_excluded)

These filters allow you to include or exclude specific keywords from the prompt text.

  • multi_keyword_included: A URL-encoded JSON string specifying keywords that must be present in the prompt.
  • multi_keyword_excluded: A URL-encoded JSON string specifying keywords that must not be present in the prompt.

For details on how to structure the JSON for these filters, please refer to the Text search JSON structure documentation.

Learn how SE Ranking’s API can boost your SEO!

Hi! Meet our product expert, Alex.

He’ll walk you through the API and show you how to get the most out of it.

  • Enjoy a tailored demo on integrating rich, structured SEO data into your stack.
  • Pin down every tech detail live—auth, endpoints, rate limits, data formats.
  • Compare usage tiers and pricing so you can unlock maximum data value.

Request a free demo to see our tools and integrations in action

By clicking this button, you agree to SE Ranking’s Terms of Services and Privacy Policy.