canonical: https://jentic.com/apis/plausible.io/plausible

# Plausible API

Jentic publishes the only available OpenAPI specification for Plausible API, keeping it validated and agent-ready. Query privacy-friendly web analytics including real-time visitor counts, aggregate metrics, time-series data, and dimension breakdowns - all without cookies or personal data collection. The API also provides site management capabilities for creating, updating, and deleting sites, managing shared dashboard links, defining conversion goals, and sending custom pageview events.

## For AI agents

Query privacy-focused web analytics (visitors, pageviews, sources, conversions), manage sites and goals, and send custom events - all without cookies or personal data.

## Scope

Does not handle product analytics, user-level behavioral tracking, A/B testing, or feature flags - use for aggregate web traffic analytics only.

## Capabilities

- Query real-time visitor counts for any registered site without page reload
- Retrieve aggregate metrics (visitors, pageviews, bounce rate, visit duration) for configurable date ranges
- Generate time-series data at day, week, or month granularity for trend visualization
- Break down metrics by source, page, country, device, browser, or operating system dimensions
- Create and delete sites with custom domain and timezone configuration
- Define conversion goals tracked by page path or custom event name
- Send custom pageview and event data via the event ingestion endpoint

## Use cases

### AI Agent Web Analytics Integration

AI agents query Plausible's Stats API to retrieve traffic metrics, source breakdowns, and conversion data without manual dashboard access. Through Jentic, an agent discovers the analytics operation by intent, receives the schema, and executes queries to return visitor counts, bounce rates, or source rankings directly within automated workflows. Privacy-compliant by design - no cookies or PII involved.

Example prompt: GET aggregate stats from /api/v1/stats/aggregate for site 'example.com' with metrics visitors, pageviews, and bounce_rate for the last 30 days

### Real-Time Traffic Monitoring

Query the real-time visitors endpoint to get the current number of active visitors on any registered site. This enables automated alerting when traffic spikes (viral content, launch events) or drops (outages, broken pages), and powers live dashboards that display current site activity without polling delay or session tracking.

Example prompt: GET the current real-time visitor count from /api/v1/stats/realtime/visitors for site_id 'example.com'

### Traffic Source and Campaign Analysis

Break down visitor metrics by referral source, UTM campaign, country, device type, or page path using the breakdown endpoint. This reveals which channels drive the most qualified traffic, which content performs best, and where geographic or device-specific optimization opportunities exist - all queryable programmatically for automated marketing reports.

Example prompt: GET breakdown from /api/v1/stats/breakdown for site 'example.com' with property 'visit:source' and metrics 'visitors,bounce_rate' for the last 7 days

### Conversion Goal Tracking

Define conversion goals based on page paths (e.g., /thank-you) or custom event names (e.g., signup_complete), then query aggregate and breakdown stats filtered to goal completions. This enables automated funnel measurement without cookies, tracking how many visitors complete key actions and which sources drive the highest conversion rates.

Example prompt: Create a goal via PUT /api/v1/sites/goals for site 'example.com' with event_name 'signup_complete', then query aggregate stats filtered to that goal

### Multi-Site Management

Programmatically create, configure, and delete sites within a Plausible account. Each site can have a custom timezone, shared dashboard links for public access, and conversion goals. Agencies and SaaS platforms use this to onboard client sites automatically, configure analytics for new tenants, and manage shared reporting links at scale.

Example prompt: Create a new site via POST /api/v1/sites with domain 'newclient.com' and timezone 'Europe/London', then create a shared dashboard link via PUT /api/v1/sites/shared-links

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /api/v1/stats/realtime/visitors | Get current real-time visitor count |
| GET | /api/v1/stats/aggregate | Query aggregate metrics for a date range |
| GET | /api/v1/stats/timeseries | Get time-series data at configurable intervals |
| GET | /api/v1/stats/breakdown | Break down metrics by dimension |
| POST | /api/v1/sites | Create a new analytics site |
| PUT | /api/v1/sites/goals | Create a conversion goal for a site |
| PUT | /api/v1/sites/shared-links | Create a shared dashboard link |
| POST | /api/event | Send a custom pageview or event |

## Key resources

- **Stats** — Query real-time visitors, aggregate metrics, time-series, and dimension breakdowns
- **Sites** — Create, update, and delete analytics sites with timezone configuration
- **Goals** — Define conversion goals tracked by page path or custom event name
- **Shared Links** — Create public dashboard sharing links for external access
- **Events** — Send custom pageview and event data from server-side applications

## Why Jentic

- **Setup:** Wiring the Plausible API by hand means learning its bearer auth and hand-building requests across its stats, site and event endpoints yourself. Through Jentic you install once, import Plausible from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** Plausible's operations take the site id in the query or request body rather than the URL path, so scoping is operations-only: limit the agent to the operations it needs, such as reading realtime visitors or an aggregate stats query. You choose which operations it may call, so ones like creating a site or setting goals are not included unless you add them.
- **Credential handling:** Your Plausible API key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'query website visitor statistics' or 'break down traffic by page', and Jentic returns the matching Plausible operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **PostHog API** — PostHog provides open-source product analytics with deeper behavioral tracking, feature flags, and session recording
- **Mixpanel API** — Mixpanel offers deep product analytics with segmentation, funnels, and JQL but uses cookie-based user tracking
- **Segment API** — Segment routes event data to multiple analytics destinations including Plausible for unified data collection
- **Heap API** — Heap auto-captures all web interactions for retroactive analysis but requires cookie-based tracking

## FAQ

### Why is there no official OpenAPI spec for Plausible API?

Plausible does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call Plausible API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Plausible API use?

The Plausible API uses Bearer token authentication with an API key generated from the Plausible account settings. Include it in the Authorization header as 'Bearer {api_key}'. Through Jentic, your Plausible API key is stored encrypted in the credential vault and agents receive scoped access without the raw key entering their context.

### Can I query real-time visitor counts with the Plausible API?

Yes. GET /api/v1/stats/realtime/visitors returns the current number of active visitors on a site within the last 5 minutes. Pass the site_id as a query parameter to specify which site to query.

### What are the rate limits for the Plausible API?

Plausible Cloud enforces a rate limit of 600 requests per hour per API key. Self-hosted instances can configure custom rate limits. The API returns standard rate limit headers so clients can implement backoff. Stats endpoints and site management endpoints share the same limit pool.

### How do I query traffic source breakdown through the Plausible API via Jentic?

Search Jentic for 'break down web analytics by traffic source' to discover the /api/v1/stats/breakdown operation. Load the schema, set property to 'visit:source' and metrics to 'visitors,bounce_rate', specify the site_id and date range, and execute. Install with pip install jentic to get started.

### Is the Plausible API GDPR-compliant?

Yes. Plausible does not use cookies, does not collect personal data, and does not track users across sites. The API returns only aggregate metrics - no individual user identifiers are exposed. This makes it fully GDPR, CCPA, and PECR compliant without requiring cookie consent banners.

### How do I define and track conversion goals?

PUT /api/v1/sites/goals creates a goal for a site, specifying either a page_path (like '/thank-you') or an event_name (like 'signup'). Once created, you can filter aggregate and breakdown queries by goal to see only sessions that completed the conversion. Delete goals via DELETE /api/v1/sites/goals/{goal_id}.

### Can I limit what my agent is allowed to do with the Plausible API?

Yes. Because Plausible takes the site id in the query or request body rather than the URL path, scoping is operations-only, and your self-hosted Jentic One instance lets you decide which operations the agent may call. You can grant read-only operations like fetching realtime visitors or an aggregate stats query while withholding others. Write operations such as creating a site or setting a conversion goal are not available to the agent unless you explicitly add them.
