v2GetAnalyticsDataset
Read a named dataset for a brand. Choose visibility for mention rates and visibility scores, or citation_gaps to investigate missing citations.
See the REST reference for GET /v2/analytics/{dataset}.
Signature
v2GetAnalyticsDataset(
dataset: string,
options: {
signal?: AbortSignal;
after_url?: string | null;
ai_search?: string | null;
audience_id?: string | null;
brand_id: string;
category_id?: string | null;
checks_as_of?: string | Date;
city?: string | null;
cohort_version?: string | null;
compare_end?: string | null;
compare_end_at?: string | Date;
compare_start?: string | null;
compare_start_at?: string | Date;
country?: string | null;
cursor?: string | null | number;
device?: "desktop" | "mobile" | "unknown" | "ALL" | "PHONE" | "DESKTOP" | "TABLET";
dimension?: "date" | "query" | "page";
end?: string | null;
end_at?: string | Date | null;
engine?: "chatgpt" | "gemini" | "claude" | "perplexity" | "google" | "bing" | "brave" | "meta_ai" | "grok" | "universal" | null | string | "split";
group_by?: ReadonlyArray<"date" | "source" | "country" | "language" | "location" | "currency" | "city" | "region"> | "location" | "city" | "region" | null | ReadonlyArray<"date" | "source" | "country" | "language" | "location" | "currency"> | "platform" | "country" | "topic" | "persona" | "theme";
group_id?: string | null;
include_evidence?: boolean;
include_page_details?: boolean;
language?: string | null;
limit?: number;
location_id?: string | null;
metric_version?: string | null;
mode?: "ui_normal" | "ui_search" | "api_normal" | "api_web" | "ai_mode" | "ai_overview" | "organic_search" | null;
model?: "same_session" | "last_observed_ai_30d" | "modeled_influence" | "ga4_reported";
month?: string | null;
observation_id?: string;
offset?: number;
opportunities?: boolean;
ownership?: "brand_owned" | "registered_competitor" | "other_external" | "unknown" | null;
page_id?: string | null;
page_type?: "blog" | "directory" | "review_site" | "news" | "forum" | "brand_site" | "competitor_site" | "marketplace" | "docs" | "social" | "press_release" | "comparison" | "roundup" | "guide" | "institution" | "reference" | "other" | "unknown" | "video" | null;
persona_id?: string | null;
platform?: "chatgpt" | "gemini" | "claude" | "perplexity" | "google" | "bing" | "brave" | "meta_ai" | "grok" | "universal" | null | string;
previous_month?: string | null;
product_id?: string | null;
prompt_id?: string | null;
prompt_version?: number | null;
property?: string | null;
provider?: string | null;
report_id?: string | null;
search_activity?: "observed" | "not_observed" | "unknown";
section?: "timeline" | "channels" | "prompts" | "domains" | "urls" | "social_timeline";
service_id?: string | null;
social_platform?: "linkedin" | "reddit" | "youtube" | null;
stage?: "awareness" | "consideration" | "evaluation" | "decision" | "retention" | null;
start?: string | null;
start_at?: string | Date | null;
status?: "approved" | "needs_review" | "suggested" | null;
theme?: "pricing" | "features" | "availability" | "policy" | "company" | "integrations" | "other" | null;
topic_id?: string | null;
traffic_limit?: number;
traffic_offset?: number;
url?: string | null;
view?: "summary" | "history" | "compare";
website?: string | null;
},
): Promise<ApiResponse<unknown>>Parameters
dataset- Name of the analytics dataset. The example reads visibility.
options- Pass the named options in the signature. The selected action or view determines which fields are required.
options.signal- Optional AbortSignal to cancel the HTTP request.
options.brand_id- string (uuid), required for this request. brand_id
options.start_at- string (date-time), required for this request. Inclusive UTC timestamp.
options.end_at- string (date-time), required for this request. Exclusive UTC timestamp; after start_at. Maximum window per plan/history and 366 days per synchronous query.
options.group_by- array of "date" | "source" | "country" | "language" | "location" | "currency" | "city" | "region". group_by
Return value
Promise<ApiResponse<unknown>>. For visibility, body.data contains metric rows. Each row includes visibility_score and coverage. Check coverage before comparing periods.
Errors
- The SDK throws AeoApiError if the API returns an error. Inspect status, code, fieldErrors and requestId.
- AeoTransportError means the request failed to connect or the client could not finish reading a successful response. Invalid JSON in a successful response throws SyntaxError. If you abort the request, the SDK throws the reason from the AbortSignal.
- For HTTP 422, check fieldErrors for the input field and validation message.
TypeScript example
import { AeoClient } from "@aeoapi/aeo-sdk";
const apiKey = process.env.AEO_API_KEY;
if (!apiKey) throw new Error("Set AEO_API_KEY on your server.");
const client = new AeoClient(apiKey, { baseUrl: "https://api.aeoapi.dev" });
// Substitute your own record IDs and values.
const response = await client.v2GetAnalyticsDataset("visibility", {
"brand_id": "00000000-0000-4000-8000-000000000001",
"start_at": "2026-11-01T00:00:00Z",
"end_at": "2026-11-30T00:00:00Z",
"group_by": [
"date"
]
});
console.log(response.status, response.body);Requests by feature
Site audits and page checks
Citations
Answer accuracy
Analytics and attribution
See TypeScript client setup for authentication, timeouts and retry settings.