Introduction
The Plausible Analytics API provides programmatic access to your web analytics data. It consists of two main APIs:Stats API
Query analytics data, metrics, and breakdowns for your sites
Sites API
Manage sites, goals, custom properties, and integrations
API Versions
Plausible offers multiple API versions:- v1 Stats API (
/api/v1/stats) - Legacy stats endpoints with simple aggregations and breakdowns - v2 Query API (
/api/v2/query) - Modern query API with advanced filtering and aggregations - v1 Sites API (
/api/v1/sites) - Site provisioning and configuration (Enterprise Edition)
Base URL
All API requests should be made to:plausible.io with your instance domain.
API Scopes
Plausible uses scope-based authorization. When creating an API key, you can assign one or more scopes:stats:read:*
stats:read:*
Read-only access to stats endpoints. Default scope for all API keys.Allows:
- Querying analytics data
- Accessing breakdowns and timeseries
- Reading realtime visitor counts
- Accessing site metadata
sites:read:*
sites:read:*
Read-only access to site configuration and metadata.Allows:
- Listing sites
- Reading site details
- Listing goals and custom properties
- Viewing site guests
sites:provision:*
sites:provision:*
Full access to site provisioning and configuration.Allows:
- All
sites:read:*permissions - Creating and deleting sites
- Managing goals and custom properties
- Configuring shared links
- Managing site guests
The scopes
stats:read:* and sites:read:* are implicit and available to all API keys, even if not explicitly assigned.Team-Scoped vs Legacy API Keys
Plausible supports two types of API keys:Team-Scoped Keys (Recommended)
Modern API keys that are scoped to a specific team. These keys:- Only work with sites belonging to the associated team
- Require the user to be a team member (not a guest)
- Use team-based rate limiting
- Are the only type available in the UI
Legacy Keys
Older API keys created before team-scoping was introduced:- Work across all teams the user belongs to
- Work for sites where the user is a guest
- Use user-based rate limiting
- Cannot be created through the UI anymore
API Endpoints Structure
The API follows RESTful conventions:Quick Start
Create an API key
Navigate to your account settings and create a new API key with the appropriate scopes for your use case.
Feature Availability
Some API features require specific subscription plans:| Feature | Required Plan |
|---|---|
| Stats API | Business plan or higher |
| Sites API | Enterprise plan |
| Custom Properties | Business plan or higher |
| Funnels API | Business plan or higher |
| Revenue Goals | Business plan or higher |
| Shared Links | Growth plan or higher |
| Site Segments | Growth plan or higher |
Response Formats
All API responses use JSON format with consistent structure:Success Response
Error Response
200- Success400- Bad request (invalid parameters)401- Unauthorized (missing or invalid API key)402- Payment required (feature not available on your plan)404- Not found (site or resource doesn’t exist)429- Too many requests (rate limit exceeded)
Next Steps
Authentication
Learn how to authenticate your API requests
Stats API
Query analytics data and metrics
Rate Limits
Understand rate limiting and best practices
Sites API
Manage sites and configurations