Plausible Analytics
plausible.io · Web Analytics · for: Retrieve site traffic metrics, pageviews, and visitor stats to generate automated analytics reports or summaries.
OAuth 2.0 is not available for Plausible Analytics. Have users generate a Personal Access Token in Plausible settings (API Keys) on a Business plan, and collect this API key in your app interface.
Your path at a glance
Watch out for
- BlockerNo Public OAuth 2.0 Flowwhy & fix →
- WarningPaid Subscription Required for Stats APIwhy & fix →
- WarningHourly Rate Limitwhy & fix →
- InfoViewer and Guest Role Restrictionswhy & fix →
Before you start
Steps
Copy & paste
- Developer console
- Not found in the provider's documentation
- OAuth docs
- https://plausible.io/docs/stats-api
Show prompt
Create an API client for Plausible Analytics using Personal Access Token authentication. Store the API key securely, attach it via 'Authorization: Bearer <TOKEN>' headers on all requests, query stats endpoints using the site_id parameter, and handle rate limits (600 req/hr) and HTTP 401 errors.
Show bash
PLAUSIBLE_API_KEY=your_personal_access_token_here PLAUSIBLE_SITE_ID=example.com
Show javascript
async function fetchPlausibleAggregateStats(siteId, apiKey) {
const url = `https://plausible.io/api/v1/stats/aggregate?site_id=${encodeURIComponent(siteId)}&period=30d&metrics=pageviews,visitors,bounce_rate`;
const response = await fetch(url, {
headers: {
'Authorization': `Bearer ${apiKey}`
}
});
if (!response.ok) {
throw new Error(`Plausible API error: ${response.status} ${response.statusText}`);
}
return await response.json();
}Why & details
The reasoning, evidence and sources behind everything above. Hover a badge to see its sources.
The full picture
No public OAuth
Plausible Analytics does not offer OAuth 2.0 for third-party integrations, authenticating API access exclusively via Personal Access Tokens. Users must manually create an API key in their Plausible account settings and provide it to your application.
Plausible Analytics does not support standard OAuth 2.0 authorization flows for third-party applications. API authentication relies on static Personal Access Tokens passed as HTTP Bearer tokens.
Developer or user creates a Personal Access Token in Plausible team settings.
Application backend securely prompts for, validates, and stores end-user Plausible API keys.
What affects your setup
- Paid plan required
Stats API access requires an active Business plan or higher subscription.
- Token lifecycle gotchas
API tokens do not support automated refresh flows. If a key is deleted or revoked by the user, API requests fail until a new key is provided.
Before you start — why each matters
- Plausible Business Plan — Access to the Stats API requires a paid Business plan or higher tier.
- Plausible Team Role — The user creating the API key must have an Owner, Admin, Editor, or Billing role on the target Plausible team.
How well this guide is backed
Step details
Confirm that your Plausible account is on a Business plan or higher and obtain the domain name (site_id) configured in Plausible.
👤 Why you: A product/business judgement only you can make
🤖 What an agent can do: Document the site_id format and subscription prerequisite in UI microcopy.
https://plausible.io/docs/stats-api ↗Log in to Plausible, navigate to account settings -> API Keys, click New API Key, select Stats API or Sites API, and save the token.
👤 Why you: Needs your logged-in console session (2FA/CAPTCHA)
🤖 What an agent can do: Provide direct step-by-step UI copy for users creating an API key inside Plausible.
https://plausible.io/docs/api-keys ↗Store the token securely and send it with every request as an Authorization header ('Authorization: Bearer <TOKEN>').
🤖 What an agent can do: Write HTTP client wrapper code that appends the Bearer token header to all Plausible API calls.
Make a GET request to the aggregate endpoint with the site_id parameter to verify authentication and data retrieval.
🤖 What an agent can do: Generate script to execute test API calls and parse site metric response payloads.
https://plausible.io/docs/stats-api ↗Handle 600 request/hour rate limits and 401 unauthorized errors gracefully in case the key is invalid or revoked.
🤖 What an agent can do: Implement retry handling, backoff timers, and UI alerts prompting users to update their API key if invalidated.
Gotchas explained
- BlockerNo Public OAuth 2.0 Flow
Plausible does not provide an OAuth flow for seamless end-user authorization. Users must manually paste API keys into your application.
Fix: Design your application onboarding to collect and validate user API keys manually.
- WarningPaid Subscription Required for Stats API
Stats API access is restricted to accounts on a Business plan or higher.
Fix: Warn users in your setup interface that a paid Plausible Business plan is necessary.
- WarningHourly Rate Limit
API requests are capped at 600 requests per hour by default.
Fix: Cache results where possible or request elevated limits from Plausible for Enterprise users.
- InfoViewer and Guest Role Restrictions
Team members with Viewer or Guest roles cannot generate API keys in Plausible.
Fix: Inform users that an account with Owner, Admin, Editor, or Billing permissions is required to generate keys.
Reference facts
- Authentication MethodPersonal Access Token (HTTP Bearer Header)
- Default Rate Limit600 requests per hour
- Required Parametersite_id (domain configured in Plausible)
What we verified — and what we couldn't
Live probes (no credentials)
- ✓page
https://plausible.io/docs/stats-apiHTTP 200; title "Plausible Stats API reference | Plausible docs"[P1]
Open questions
- Is OAuth 2.0 planned on Plausible's product roadmap?Official documentation makes no mention of third-party OAuth 2.0 support or partner integration portals.To resolve: Contact Plausible support (https://plausible.io/contact) or monitor developer documentation updates.
- Not searched: developer forums and community reportsThis key has no Google Search grounding, so only the provider's own pages were read. Real-world gotchas reported by developers may be missing.To resolve: Re-run with a billing-enabled Gemini key, or search the provider's community forum for review and rate-limit issues.
Ask the provider
A ready-to-send message built from the open questions above.
- Send to
- Plausible Support / Contact Form — https://plausible.io/contact
- Subject
- OAuth integration questions — Plausible Analytics
Hi Plausible Analytics developer support team, We're building an integration where retrieve site traffic metrics, pageviews, and visitor stats to generate automated analytics reports or summaries. Before we register an OAuth app and launch to customers, we couldn't find answers to the following in your documentation: 1. Is OAuth 2.0 planned on Plausible's product roadmap? (What we found: Official documentation makes no mention of third-party OAuth 2.0 support or partner integration portals.) Could you point us to the right documentation or process — including whether any review or approval is needed before customers outside our own account can connect, and the typical timeline? Thanks, [Your name] [Company · website]
Sources
- S1Site provisioning API reference | Plausible docsofficial
- S2Stats API v1 reference (legacy) | Plausible docsofficial
- S3Plausible Stats API reference | Plausible docsofficial
- S4Plausible: The more accurate alternative to Google Analytics | Plausible Analyticsofficial
- S5Security Practices | Plausible Analyticsofficial
- S6How to migrate from Google Analytics to Plausible | Plausible Analyticsofficial
- S7Plausible Analytics Data Studio connector: custom reports, no extra complexity | Plausible Analyticsofficial
- S8Plausible Analytics | Simple, privacy-friendly Google Analytics alternativeofficial
- P1Our probe: page check on plausible.ioprobe