Web analytics
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
GET | |
PATCH | |
DELETE | |
GET | |
GET | |
GET | |
POST | |
GET | |
POST | |
GET | |
GET | |
POST | |
POST | |
POST | |
POST | |
POST |
List all aeo prompts
Lists the project's AEO prompt set, ordered by topic and then rank, one page at a time. Filter by topic or by on/off state. Archived prompts are left out unless include_archived is true. Each prompt carries its latest check per answer engine.
Required API key scopes
web_analytics:readQuery parameters
- activeboolean | null
- include_archivedbooleanDefault:
false - limitinteger
- offsetinteger
- topicstring
Response
Example request
GET /api /projects /:project_id /aeo_promptsExample response
Status 200
Retrieve aeo prompts
Gets one prompt from the project's AEO prompt set, archived ones included, with its latest check per answer engine.
Required API key scopes
web_analytics:readPath parameters
- idstring
Response
Example request
GET /api /projects /:project_id /aeo_prompts /:idExample response
Status 200
Update aeo prompts
Turns a prompt on or off, changes its topic, archives or restores it, or changes its text. A text change adds the next version and makes it current, and current_version moves back to an earlier one. The prompt keeps its id, and past checks are always kept.
Required API key scopes
web_analytics:writePath parameters
- idstring
Request parameters
- activeboolean | null
- topicstring
- promptstring
- version_descriptionstring
- current_versioninteger | null
- archivedboolean | null
Response
Example request
PATCH /api /projects /:project_id /aeo_prompts /:idExample response
Status 200 The updated prompt.
Status 400 The edit is invalid, the version does not exist, or the prompt is archived and must be restored first.
Status 409 Another prompt in the set already has the new text.
Delete aeo prompts
Archives a prompt: it is turned off and never runs again. Nothing is deleted, and its versions and checks are kept. Restore it with a PATCH of archived=false.
Required API key scopes
web_analytics:writePath parameters
- idstring
Example request
DELETE /api /projects /:project_id /aeo_prompts /:idExample response
Status 204 The prompt is archived.
Retrieve aeo prompts
Lists every check of one prompt, newest first, one page at a time. Filter by engine or by prompt version. Each check has the engine's answer, the URLs it cited, the searches it ran and the prompt version it ran.
Required API key scopes
web_analytics:readPath parameters
- idstring
Query parameters
- enginestring
- limitinteger
- offsetinteger
- versioninteger
Response
Example request
GET /api /projects /:project_id /aeo_prompts /:id /checksExample response
Status 200
Retrieve aeo prompts
Gets citation and brand-mention totals per answer engine for one prompt, plus, for the last 30 days in the project's timezone, per-day counts, which engines cite which domains, brand sentiment per engine, and the words of the web searches the engines ran.
Required API key scopes
web_analytics:readPath parameters
- idstring
Response
Example request
GET /api /projects /:project_id /aeo_prompts /:id /statsExample response
Status 200
Retrieve aeo prompts
Lists every version of a prompt's text, newest first. A text edit adds a version, and one of them is current.
Required API key scopes
web_analytics:readPath parameters
- idstring
Example request
GET /api /projects /:project_id /aeo_prompts /:id /versionsExample response
Status 200
Create aeo prompts bulk
Adds prompts to the project's AEO prompt set, or updates the topic and visibility of prompts that already exist. Existing prompts keep their active state. Prompts whose text matches an archived prompt are skipped.
Required API key scopes
web_analytics:writeRequest parameters
- promptsarray
Response
Example request
POST /api /projects /:project_id /aeo_prompts /bulk_importExample response
Status 200
Retrieve aeo prompts
Lists the topics in the project's AEO prompt set, with the number of prompts in each.
Required API key scopes
web_analytics:readExample request
GET /api /projects /:project_id /aeo_prompts /topicsExample response
Status 200
Create web analytics fetch llms
Loads an llms.txt file from a public URL for coverage analysis without saving it.
Required API key scopes
web_analytics:readRequest parameters
- urlstring
Response
Example request
POST /api /projects /:project_id /web_analytics /llms_txtExample response
Status 200
Status 400 The URL is invalid, inaccessible, or does not return an llms.txt file.
Create web analytics fetch llms
Loads an llms.txt file from a public URL for coverage analysis without saving it.
Required API key scopes
web_analytics:readRequest parameters
- urlstring
Response
Example request
POST /api /projects /:project_id /web_analytics /llms_txtExample response
Status 200
Status 400 The URL is invalid, inaccessible, or does not return an llms.txt file.
Retrieve web analytics
The 'Wrapped'-style weekly recap: everything in the weekly digest (visitors, pageviews, sessions, bounce rate, average session duration with period-over-period comparisons, top pages, top sources, and goals) plus a single derived weekly persona and a short list of screenshot-worthy highlights for the period.
Required API key scopes
web_analytics:readQuery parameters
- comparebooleanDefault:
true - daysintegerDefault:
7
Response
Example request
GET /api /projects /:project_id /web_analytics /recapExample response
Status 200
Retrieve web analytics
The 'Wrapped'-style weekly recap: everything in the weekly digest (visitors, pageviews, sessions, bounce rate, average session duration with period-over-period comparisons, top pages, top sources, and goals) plus a single derived weekly persona and a short list of screenshot-worthy highlights for the period.
Required API key scopes
web_analytics:readQuery parameters
- comparebooleanDefault:
true - daysintegerDefault:
7
Response
Example request
GET /api /projects /:project_id /web_analytics /recapExample response
Status 200
Retrieve web analytics weekly
Also available via the PostHog MCP server:
web-analytics-weekly-digest— Summarize web analytics
Summarizes a project's web analytics over a lookback window (default 7 days): unique visitors, pageviews, sessions, bounce rate, and average session duration with period-over-period comparisons, plus the top 5 pages, top 5 traffic sources, and goal conversions.
Required API key scopes
web_analytics:readQuery parameters
- comparebooleanDefault:
true - daysintegerDefault:
7
Response
Example request
GET /api /projects /:project_id /web_analytics /weekly_digestExample response
Status 200
Retrieve web analytics weekly
Also available via the PostHog MCP server:
web-analytics-weekly-digest— Summarize web analytics
Summarizes a project's web analytics over a lookback window (default 7 days): unique visitors, pageviews, sessions, bounce rate, and average session duration with period-over-period comparisons, plus the top 5 pages, top 5 traffic sources, and goal conversions.
Required API key scopes
web_analytics:readQuery parameters
- comparebooleanDefault:
true - daysintegerDefault:
7
Response
Example request
GET /api /projects /:project_id /web_analytics /weekly_digestExample response
Status 200
Create web analytics content autopilot opportunities
Marks an opportunity as dismissed. It stays dismissed across refreshes, and list responses still include it with status dismissed.
Required API key scopes
web_analytics:writePath parameters
- idstring
Response
Example request
POST /api /projects /:project_id /web_analytics_content_autopilot_opportunities /:id /dismissExample response
Status 200
Create web analytics content autopilot opportunities
Starts a run that researches and drafts content for the selected opportunities.
Required API key scopes
web_analytics:writeRequest parameters
- profile_idstring
- opportunity_idsarray
Response
Example request
POST /api /projects /:project_id /web_analytics_content_autopilot_opportunities /draftExample response
Status 202
Create web analytics content autopilot opportunities
Re-reads AI citation checks and updates the site's content opportunities. Makes no model calls.
Required API key scopes
web_analytics:writeRequest parameters
- profile_idstring
Example request
POST /api /projects /:project_id /web_analytics_content_autopilot_opportunities /refreshExample response
Status 200
Create web analytics content autopilot profiles
Inspects a public site for its canonical origin, name, and sitemap URLs.
Required API key scopes
web_analytics:writeRequest parameters
- domainstring
Response
Example request
POST /api /projects /:project_id /web_analytics_content_autopilot_profiles /discoverExample response
Status 200
Create web analytics content autopilot proposals
Saves reviewed Markdown and its structured package without publishing it.
Required API key scopes
web_analytics:writePath parameters
- idstring
Request parameters
- proposed_markdownstring
- content_package
Response
Example request
POST /api /projects /:project_id /web_analytics_content_autopilot_proposals /:id /edit




