---
title: "v2_get_analytics_dataset | Python SDK | AEO API"
description: "Choose a dataset and pass its filters. To measure visibility, give the brand ID and a UTC time window with an exclusive end."
url: "https://aeoapi.dev/docs/sdks/python/v2-get-analytics-dataset"
canonical: "https://aeoapi.dev/docs/sdks/python/v2-get-analytics-dataset"
last_updated: "2026-11-30"
---

# v2_get_analytics_dataset

Choose a dataset and pass its filters. To measure visibility, give the brand ID and a UTC time window with an exclusive end.

See the REST reference for [`GET /v2/analytics/{dataset}`](https://aeoapi.dev/docs/api-reference#get-v2-analytics-dataset).

## Signature

```
v2_get_analytics_dataset(
    dataset: str,
    *,
    after_url: str | None = None,
    ai_search: str | None = None,
    audience_id: str | None = None,
    brand_id: str,
    category_id: str | None = None,
    checks_as_of: str | datetime | None = None,
    city: str | None = None,
    cohort_version: str | None = None,
    compare_end: str | None = None,
    compare_end_at: str | datetime | None = None,
    compare_start: str | None = None,
    compare_start_at: str | datetime | None = None,
    country: str | None = None,
    cursor: str | int | None = None,
    device: Literal['desktop', 'mobile', 'unknown'] | Literal['ALL', 'PHONE', 'DESKTOP', 'TABLET'] | None = None,
    dimension: Literal['date', 'query', 'page'] | None = None,
    end: str | None = None,
    end_at: str | datetime | None = None,
    engine: Literal['chatgpt', 'gemini', 'claude', 'perplexity', 'google', 'bing', 'brave', 'meta_ai', 'grok', 'universal'] | str | Literal['bing', 'google', 'split'] | None = None,
    group_by: Sequence[Literal['date', 'source', 'country', 'language', 'location', 'currency', 'city', 'region']] | Literal['location', 'city', 'region'] | Sequence[Literal['date', 'source', 'country', 'language', 'location', 'currency']] | Literal['platform', 'country', 'topic', 'persona', 'theme', 'location', 'city', 'region'] | None = None,
    group_id: str | None = None,
    include_evidence: bool | None = None,
    include_page_details: bool | None = None,
    language: str | None = None,
    limit: int | None = None,
    location_id: str | None = None,
    metric_version: str | None = None,
    mode: Literal['ui_normal', 'ui_search', 'api_normal', 'api_web', 'ai_mode', 'ai_overview', 'organic_search'] | None = None,
    model: Literal['same_session', 'last_observed_ai_30d', 'modeled_influence', 'ga4_reported'] | None = None,
    month: str | None = None,
    observation_id: str | None = None,
    offset: int | None = None,
    opportunities: bool | None = None,
    ownership: Literal['brand_owned', 'registered_competitor', 'other_external', 'unknown'] | None = None,
    page_id: str | None = None,
    page_type: Literal['blog', 'directory', 'review_site', 'news', 'forum', 'brand_site', 'competitor_site', 'marketplace', 'docs', 'social', 'press_release', 'comparison', 'roundup', 'guide', 'institution', 'reference', 'other', 'unknown', 'video'] | Literal['blog', 'directory', 'review_site', 'news', 'forum', 'brand_site', 'competitor_site', 'marketplace', 'docs', 'social', 'press_release', 'comparison', 'roundup', 'guide', 'institution', 'reference', 'other', 'unknown'] | None = None,
    persona_id: str | None = None,
    platform: Literal['chatgpt', 'gemini', 'claude', 'perplexity', 'google', 'bing', 'brave', 'meta_ai', 'grok', 'universal'] | str | None = None,
    previous_month: str | None = None,
    product_id: str | None = None,
    prompt_id: str | None = None,
    prompt_version: int | None = None,
    property: str | None = None,
    provider: str | None = None,
    report_id: str | None = None,
    search_activity: Literal['observed', 'not_observed', 'unknown'] | None = None,
    section: Literal['timeline', 'channels', 'prompts'] | Literal['domains'] | Literal['urls'] | Literal['timeline'] | Literal['channels'] | Literal['prompts'] | Literal['social_timeline'] | None = None,
    service_id: str | None = None,
    social_platform: Literal['linkedin', 'reddit', 'youtube'] | None = None,
    stage: Literal['awareness', 'consideration', 'evaluation', 'decision', 'retention'] | None = None,
    start: str | None = None,
    start_at: str | datetime | None = None,
    status: Literal['approved', 'needs_review', 'suggested'] | None = None,
    theme: Literal['pricing', 'features', 'availability', 'policy', 'company', 'integrations', 'other'] | None = None,
    topic_id: str | None = None,
    traffic_limit: int | None = None,
    traffic_offset: int | None = None,
    url: str | None = None,
    view: Literal['summary', 'history', 'compare'] | None = None,
    website: str | None = None,
) -> Response[Any]
```

## Parameters

**`dataset`**

Name of the analytics dataset, such as visibility or citations. The dataset determines the filters and response.

**`after_url`**

Continue the URL list after this URL.

**`ai_search`**

Limit results to one AI search product, such as google_ai_overviews.

**`audience_id`**

Identifier for the audience.

**`brand_id`**

Identifier for the brand.

**`category_id`**

Identifier for the category.

**`checks_as_of`**

Send the check time from the first page on later requests.

**`city`**

Filter results by city.

**`cohort_version`**

Select the version of the measured cohort.

**`compare_end`**

End date of the earlier comparison period.

**`compare_end_at`**

Exclusive end of the earlier comparison window.

**`compare_start`**

Start date of the earlier comparison period.

**`compare_start_at`**

Inclusive start of the earlier comparison window.

**`country`**

Filter results by country.

**`cursor`**

Pass the previous page's next cursor with the original filters.

**`device`**

Select the device category supported by the dataset.

**`dimension`**

Group search data by date, query or page.

**`end`**

Last date for this dataset's reporting period.

**`end_at`**

End of the reporting window. For visibility this is an exclusive UTC timestamp.

**`engine`**

Filter results by engine.

**`group_by`**

Dimensions to group by. The available choices depend on the dataset.

**`group_id`**

Identifier for the group.

**`include_evidence`**

Include supporting evidence with the requested metrics.

**`include_page_details`**

Include details for individual pages.

**`language`**

Filter results by language.

**`limit`**

Maximum number of records per page. Each view sets its own limit.

**`location_id`**

Identifier for the location.

**`metric_version`**

Select the metric definition used for the comparison.

**`mode`**

Select the collection mode used to obtain the answers.

**`model`**

Select the attribution model.

**`month`**

UTC reporting month in YYYY-MM format.

**`observation_id`**

Identifier for the observation.

**`offset`**

Number of records to skip. For draft lists, send the returned next_offset.

**`opportunities`**

Return the opportunities page. Keep this value and the filters fixed for subsequent cursors.

**`ownership`**

Filter results by ownership.

**`page_id`**

Identifier for the page.

**`page_type`**

Filter results by page type.

**`persona_id`**

Identifier for the persona.

**`platform`**

Filter results by platform.

**`previous_month`**

Earlier UTC month to compare.

**`product_id`**

Identifier for the product.

**`prompt_id`**

Identifier for the prompt.

**`prompt_version`**

Choose the prompt revision to measure.

**`property`**

Property identifier for the selected connection.

**`provider`**

Connection type or source label for the selected view.

**`report_id`**

Identifier for the report.

**`search_activity`**

Filter on evidence of web search during answer collection.

**`section`**

Select the section of the requested dataset.

**`service_id`**

Identifier for the service.

**`social_platform`**

Filter results by social platform.

**`stage`**

Filter by the buyer stage assigned to a prompt.

**`start`**

First date for this dataset's reporting period.

**`start_at`**

Start of the reporting window. For visibility this is an inclusive UTC timestamp.

**`status`**

Only return records with this status.

**`theme`**

Filter results by theme.

**`topic_id`**

Identifier for the topic.

**`traffic_limit`**

Maximum number of traffic rows to include.

**`traffic_offset`**

Number of traffic rows to skip.

**`url`**

Filter results by url.

**`view`**

Choose the result to read. See the linked REST reference for the fields and access each view requires.

**`website`**

Website for the selected brand or connection.

## Return value

For visibility, response.data contains metric rows with visibility_score, mention_rate and coverage. Other datasets have their own fields.

## Errors

- AeoApiError includes the HTTP status, error code and request ID. An invalid key raises UnauthenticatedError. Check the key’s scopes if you receive ForbiddenError.
- Invalid arguments can raise ValueError or TypeError before the SDK sends a request.
- AeoTransportError means the request could not reach the API after any allowed retries, or the response could not be read as JSON.
- PreconditionFailedError means the revision has changed. Read the current record before editing it again.
- For a conflict, read the error message before repeating the write. Check the saved record for a competing edit or a repeated request.

## Python example

```
import os
from aeo_sdk import AeoClient

with AeoClient(os.environ["AEO_API_KEY"], base_url=os.environ["AEO_API_BASE_URL"]) as client:
    response = client.v2_get_analytics_dataset(
        dataset='visibility',
        brand_id='00000000-0000-4000-8000-000000000001',
        end_at='2026-12-01T00:00:00Z',
        start_at='2026-11-01T00:00:00Z',
    )
    print(response.body)
```

## Async example

```
import asyncio
import os
from aeo_sdk import AsyncAeoClient

async def main():
    async with AsyncAeoClient(os.environ["AEO_API_KEY"], base_url=os.environ["AEO_API_BASE_URL"]) as client:
        response = await client.v2_get_analytics_dataset(
            dataset='visibility',
            brand_id='00000000-0000-4000-8000-000000000001',
            end_at='2026-12-01T00:00:00Z',
            start_at='2026-11-01T00:00:00Z',
        )
        print(response.body)

asyncio.run(main())
```

## Requests by feature

### Site audits and page checks

- [Read page measurements](https://aeoapi.dev/docs/features/site-audits-and-page-checks/get-analytics-dataset-page-experience)

### Citations

- [Rank cited sources](https://aeoapi.dev/docs/features/citations/get-analytics-dataset-citations)
- [Citations by domain](https://aeoapi.dev/docs/features/citations/get-analytics-dataset-citations-domains)
- [Citations by URL](https://aeoapi.dev/docs/features/citations/get-analytics-dataset-citations-urls)
- [Citation timeline](https://aeoapi.dev/docs/features/citations/get-analytics-dataset-citations-timeline)
- [Citations by channel](https://aeoapi.dev/docs/features/citations/get-analytics-dataset-citations-channels)
- [Citations by prompt](https://aeoapi.dev/docs/features/citations/get-analytics-dataset-citations-prompts)
- [Social citation timeline](https://aeoapi.dev/docs/features/citations/get-analytics-dataset-citations-social-timeline)
- [Compare citation growth](https://aeoapi.dev/docs/features/citations/get-analytics-dataset-citation-growth)
- [Find competitor citation gaps](https://aeoapi.dev/docs/features/citations/get-analytics-dataset-citation-gaps)
- [Find pages missing the brand](https://aeoapi.dev/docs/features/citations/get-analytics-dataset-missing-brand)
- [List saved page checks](https://aeoapi.dev/docs/features/citations/get-analytics-dataset-page-checks)

### Answer accuracy

- [Read accuracy trends](https://aeoapi.dev/docs/features/answer-accuracy/get-analytics-dataset-answer-accuracy)
- [List frequent wrong claims](https://aeoapi.dev/docs/features/answer-accuracy/get-analytics-dataset-wrong-claims)
- [Review accuracy facts](https://aeoapi.dev/docs/features/answer-accuracy/get-analytics-dataset-accuracy-facts)

### Analytics and attribution

- [Measure visibility](https://aeoapi.dev/docs/features/analytics-and-attribution/get-analytics-dataset-visibility)
- [Read prompt metrics](https://aeoapi.dev/docs/features/analytics-and-attribution/get-analytics-dataset-prompts)
- [Compare locations](https://aeoapi.dev/docs/features/analytics-and-attribution/get-analytics-dataset-locations)
- [Compare engine scores](https://aeoapi.dev/docs/features/analytics-and-attribution/get-analytics-dataset-radar)
- [Read keyword shares](https://aeoapi.dev/docs/features/analytics-and-attribution/get-analytics-dataset-keywords)
- [Measure brand perception](https://aeoapi.dev/docs/features/analytics-and-attribution/get-analytics-dataset-brand-perception)
- [Filter dashboard metrics](https://aeoapi.dev/docs/features/analytics-and-attribution/get-analytics-dataset-dashboard)
- [Track URL impact](https://aeoapi.dev/docs/features/analytics-and-attribution/get-analytics-dataset-url-impact)
- [Read search performance](https://aeoapi.dev/docs/features/analytics-and-attribution/get-analytics-dataset-search-performance)
- [Read Bing site insights](https://aeoapi.dev/docs/features/analytics-and-attribution/get-analytics-dataset-bing-insights)
- [Read revenue attribution](https://aeoapi.dev/docs/features/analytics-and-attribution/get-analytics-dataset-attribution)

See [Python client setup](https://aeoapi.dev/docs/sdks/python) for the environment variables, response properties and retry settings.
