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.

Using the API, you can:

  • Get an AI search overview with metrics like link presence, average position, AI traffic, and historical trends
  • 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

GET https://api.seranking.com/v1/ai-search/overview/by-engine/time-series
Cost: 800 credits per request

Get 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

A successful request returns a JSON object with a comprehensive overview of LLM performance metrics.

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 }
]
}
}

Discover brand by URL

GET https://api.seranking.com/v1/ai-search/discover-brand
Cost: 100 credits per request

Identify 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

A successful request returns a JSON object with an array of brand names associated with the target.

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

Get prompts by target

GET https://api.seranking.com/v1/ai-search/prompts-by-target
Cost: 200 credits per returned prompt

Retrieve 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 the unique ID for the newly created audit.

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.

prompts array object structure

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.

answer object structure

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

GET https://api.seranking.com/v1/ai-search/prompts-by-brand
Cost: 200 credits per returned prompt

Retrieve 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

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.

prompts array object structure

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.

answer object structure

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

A successful request returns a JSON object containing a list of prompts that mention the specified brand.

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.