Describe the analytics schema
Returns column metadata for every table and view in the analytics schema. Use this to discover available tables/columns before writing an analytics query.
apiKeyAuthorizationBearer <token>API key for authenticating protected endpoints. Pass as Bearer token in Authorization header.
Schema metadata retrieved successfully
application/json- response
tables*array<>One row per column, grouped by table in ordinal order
curl -X GET "https://example.com/v1/analytics/schema"{ "tables": [ { "table_name": "string", "column_name": "string", "data_type": "string", "is_nullable": "string" } ]}Run an analytics SQL query POST
Execute a read-only SQL query against the analytics schema, scoped to your publication. **Auth:** Requires an API key. Queries run as the publication that owns the API key; Row-Level Security guarantees that only that publication's rows are visible even if the SQL is unscoped. **SQL requirements:** - `SELECT` or `WITH` (CTE) statements only - Reference tables unprefixed (e.g. `FROM posts`) — the `analytics` schema is the default `search_path` - No semicolons, no writes, no DDL, no superuser functions - Hard limit of 10,000 rows; anything over is truncated and `truncated: true` is returned - 30-second statement timeout **Discovering the schema:** call `GET /v1/analytics/schema` for column metadata. Common queries: open rate, subscriber count, top posts by views, engagement over time, click-through rate. For raw post-scoped tables, join through `posts.draft_of` to roll draft/version rows up to the canonical published post.
Get search and AI visibility GET
Returns how search engines and AI tools find your publication: visits referred by search engines and AI assistants (ChatGPT, Perplexity, Claude, ...), pages fetched by AI crawlers, and the posts and pages they reach most. The same report as the Search & AI tab in the app's analytics. AI crawler hits are only tracked on a live custom website; `crawlerTrackingAvailable` is false otherwise. This data isn't in the analytics SQL schema. **Periods:** `daily` covers the last 14 days, `weekly` the last 12 weeks, `monthly` the last 12 months, and `all` all time by month.