Endpoint
Authentication
All requests must include your API key in theAuthorization header:
Query Parameters
The domain of your site as configured in Plausible. Example:
example.comThe time period for the query. Valid values:
day- Current day7d- Last 7 days30d- Last 30 daysmonth- Current month6mo- Last 6 months12mo- Last 12 monthscustom- Custom date range (requiresdateparameter)
30d if not specified.Date or date range in ISO-8601 format.For single date periods:
2024-01-01For custom periods: 2024-01-01,2024-01-31 (comma-separated start and end dates)Required when period=custom.Comma-separated list of metrics to retrieve. Defaults to
visitors if not specified.Available metrics:visitors- Unique visitorsvisits- Total visits (sessions)pageviews- Total pageviewsevents- Total eventsbounce_rate- Bounce rate percentagevisit_duration- Average visit duration in secondsviews_per_visit- Average pageviews per visitconversion_rate- Goal conversion rate (requires goal filter)time_on_page- Average time on page in seconds (requires page filter)
visitors,pageviews,bounce_rateNote: Each metric can only be specified once. Metrics cannot be queried multiple times.Filter the data by specific dimensions. Format:
dimension==value for equality or dimension!=value for negation.Multiple filters can be combined with semicolons (;).Multiple values for the same dimension can be combined with pipes (|).Wildcard matching is supported using asterisks (*).Examples:event:page==/blog- Filter to a specific pagevisit:country==US- Filter to United States trafficvisit:source==Google|Twitter- Filter to Google or Twitter trafficevent:page==/blog**- Wildcard match for blog pagesvisit:country!=US;visit:source==Google- Combine multiple filters
Enable comparison with previous period. Set to
previous_period to compare with the equivalent previous time period.Properties
Available dimensions for filtering:Event Properties
event:page- Page pathevent:name- Custom event nameevent:goal- Goal name (pageview or custom event goal)event:hostname- Hostname (not supported for breakdowns)event:props:*- Custom event properties (e.g.,event:props:author)
Visit (Session) Properties
visit:source- Traffic sourcevisit:channel- Traffic channelvisit:country- Country code (ISO 3166-1 alpha-2)visit:region- Region codevisit:city- City namevisit:entry_page- Entry page pathvisit:exit_page- Exit page pathvisit:referrer- Referrer URLvisit:utm_medium- UTM mediumvisit:utm_source- UTM sourcevisit:utm_campaign- UTM campaignvisit:utm_content- UTM contentvisit:utm_term- UTM termvisit:device- Device type (Desktop, Mobile, Tablet)visit:os- Operating systemvisit:os_version- Operating system versionvisit:browser- Browser namevisit:browser_version- Browser version
Metric Constraints
Certain metrics have specific requirements:conversion_rate- Can only be queried with a goal filter (event:goal==)time_on_page- Can only be queried with a page filter or in a page breakdown- Session metrics (
visits,bounce_rate,visit_duration,views_per_visit) - Cannot be queried when filtering byevent:name,event:goal, or custom event properties
Response
Object containing the requested metrics with their values.
Optional warning message (e.g., when imported stats are excluded)
Examples
Basic Request
With Filters and Comparison
Custom Date Range
Error Responses
Error message describing what went wrong