Pirsch Statistics API

Query analytics statistics by date range and filter criteria

Business capability
Digital Marketing Management BC-400.60

Operations 28

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /statistics/total Get total visitors, views and bounces · Get total statistics #
Ask an LLM
“How many visitors and page views did my site get last month?”
“What was my overall bounce rate for a date range?”
Tell an agent
Get total visitors, views, sessions and bounces for domain {id} from {from} to {to}.
Summarize overall traffic totals for {id} between {from} and {to} in timezone {tz}.
GET /statistics/visitor Chart visitors over time · Get visitor statistics over time #
Ask an LLM
“How did my daily visitor count change over the last quarter?”
“Can I group visitors by week or month instead of by day?”
Tell an agent
Show visitors per day for domain {id} from {from} to {to}.
Chart visitors for {id} from {from} to {to} grouped by {scale}.
GET /statistics/page Get traffic broken down by page · Get page statistics #
Ask an LLM
“Which pages on my site got the most visitors?”
“Can I search page statistics for a specific path?”
Tell an agent
List the top pages for domain {id} from {from} to {to}.
Show page statistics for {id} from {from} to {to} for paths matching {search}.
GET /statistics/hostname Get traffic broken down by hostname · Get hostname statistics #
Ask an LLM
“How is traffic split between my site's different hostnames?”
“Which hostname brought the most visitors?”
Tell an agent
Break down traffic by hostname for domain {id} from {from} to {to}.
Compare visitors per hostname for {id} between {from} and {to}.
GET /statistics/referrer See which referrers send traffic · Get referrer statistics #
Ask an LLM
“Which websites are sending me the most visitors?”
“Where is my referral traffic coming from this month?”
Tell an agent
List referrers for domain {id} from {from} to {to}.
Show the top {limit} referring sites for {id} between {from} and {to}.
GET /statistics/channel Get traffic by channel · Get traffic channel statistics #
Ask an LLM
“How much of my traffic comes from search versus social versus direct?”
“Which traffic channel performs best for my site?”
Tell an agent
Break down traffic by channel for domain {id} from {from} to {to}.
Compare organic, social, direct and other channels for {id} between {from} and {to}.
GET /statistics/utm/source Get visitors by UTM source · Get UTM source statistics #
Ask an LLM
“Which utm_source values brought the most visitors?”
“How many visitors came from each campaign source?”
Tell an agent
Show UTM source statistics for domain {id} from {from} to {to}.
Rank campaign sources by visitors for {id} between {from} and {to}.
GET /statistics/utm/medium Get visitors by UTM medium · Get UTM medium statistics #
Ask an LLM
“Which utm_medium, like email or cpc, drove the most traffic?”
“How do visitors split across campaign mediums?”
Tell an agent
Show UTM medium statistics for domain {id} from {from} to {to}.
Rank campaign mediums by visitors for {id} between {from} and {to}.
GET /statistics/utm/campaign Get visitors by UTM campaign · Get UTM campaign statistics #
Ask an LLM
“Which marketing campaign brought the most visitors?”
“How did each utm_campaign perform last month?”
Tell an agent
Show UTM campaign statistics for domain {id} from {from} to {to}.
Compare my marketing campaigns by visitors for {id} between {from} and {to}.
GET /statistics/utm/content Get visitors by UTM content · Get UTM content statistics #
Ask an LLM
“Which ad variant, tracked with utm_content, got more clicks through?”
“How do visitors break down by utm_content value?”
Tell an agent
Show UTM content statistics for domain {id} from {from} to {to}.
Compare utm_content variants by visitors for {id} between {from} and {to}.
GET /statistics/utm/term Get visitors by UTM term · Get UTM term statistics #
Ask an LLM
“Which paid keywords tagged with utm_term brought visitors?”
“How many visitors arrived for each utm_term?”
Tell an agent
Show UTM term statistics for domain {id} from {from} to {to}.
Rank utm_term keywords by visitors for {id} between {from} and {to}.
GET /statistics/country Get visitors by country · Get country statistics #
Ask an LLM
“Which countries do most of my visitors come from?”
“How many visitors did I get from each country?”
Tell an agent
Show visitors by country for domain {id} from {from} to {to}.
Rank countries by traffic for {id} between {from} and {to}.
GET /statistics/region Get visitors by region · Get region statistics #
Ask an LLM
“Which states or regions send the most visitors?”
“Can I see traffic broken down below the country level by region?”
Tell an agent
Show visitors by region for domain {id} from {from} to {to}.
Rank regions by traffic for {id} between {from} and {to}.
GET /statistics/city Get visitors by city · Get city statistics #
Ask an LLM
“Which cities are my visitors located in?”
“What are the top cities for my site's traffic?”
Tell an agent
Show visitors by city for domain {id} from {from} to {to}.
Rank cities by traffic for {id} between {from} and {to}.
GET /statistics/language Get visitors by browser language · Get language statistics #
Ask an LLM
“What languages do my visitors' browsers use?”
“Should I translate my site — how many visitors prefer each language?”
Tell an agent
Show visitors by language for domain {id} from {from} to {to}.
Rank visitor languages for {id} between {from} and {to}.
GET /statistics/browser Get visitors by browser · Get browser statistics #
Ask an LLM
“Which web browsers do my visitors use most?”
“How many visitors use Safari versus Chrome on my site?”
Tell an agent
Show visitors by browser for domain {id} from {from} to {to}.
Rank browsers by visitors for {id} between {from} and {to}.
GET /statistics/os Get visitors by operating system · Get operating system statistics #
Ask an LLM
“Which operating systems are my visitors on?”
“How many visitors come from iOS, Android, Windows or macOS?”
Tell an agent
Show visitors by operating system for domain {id} from {from} to {to}.
Rank operating systems by visitors for {id} between {from} and {to}.
GET /statistics/platform Get desktop vs mobile split · Get platform statistics #
Ask an LLM
“What share of my visitors are on mobile versus desktop?”
“How much of my traffic comes from phones?”
Tell an agent
Show the desktop, mobile and unknown platform split for domain {id} from {from} to {to}.
Compare mobile and desktop visitors for {id} between {from} and {to}.
GET /statistics/events List tracked custom events and counts · Get event list and statistics #
Ask an LLM
“Which custom events were tracked on my site and how many visitors triggered them?”
“What metadata keys are attached to my events?”
Tell an agent
List custom events with visitor counts for domain {id} from {from} to {to}.
Show event statistics and metadata keys for {id} between {from} and {to}.
GET /statistics/goals Get conversion goal results · Get conversion goal statistics #
Ask an LLM
“How many visitors reached each of my conversion goals?”
“What's the conversion rate for my goals this month?”
Tell an agent
Show conversion goal statistics for domain {id} from {from} to {to}.
Report how each goal converted for {id} between {from} and {to}.
GET /statistics/funnel Get step-by-step funnel results · Get funnel statistics #
Ask an LLM
“Where do visitors drop off in my signup funnel?”
“How many people completed each step of a funnel last week?”
Tell an agent
Show step-by-step results for funnel {funnel_id} on domain {id} from {from} to {to}.
Find the drop-off between steps of funnel {funnel_id} for {id} between {from} and {to}.
GET /statistics/active Get real-time active visitors · Get active visitors #
Ask an LLM
“How many people are on my site right now?”
“Can I change how many seconds count as an active visitor?”
Tell an agent
Show the active visitor count for domain {id} right now.
Count visitors active on {id} in the last {start} seconds.
GET /statistics/session/list List individual visitor sessions · Get session list #
Ask an LLM
“Can I see a list of individual visitor sessions on my site?”
“How do I page through sessions recorded in a date range?”
Tell an agent
List visitor sessions for domain {id} from {from} to {to}.
Show {limit} sessions for {id} between {from} and {to} starting at offset {offset}.
GET /statistics/session/details Get the page path of one session · Get session details #
Ask an LLM
“Which pages did a specific visitor view during one session?”
“Can I see the page-by-page journey of a single session?”
Tell an agent
Show details of session {session_id} for visitor {visitor_id} on domain {id}.
Walk through the pages visitor {visitor_id} viewed in session {session_id} on {id}.
GET /statistics/growth Compare growth against the previous period · Get growth statistics #
Ask an LLM
“Is my traffic growing compared to the previous period?”
“By what percentage did visitors change versus last month?”
Tell an agent
Show growth rates for domain {id} from {from} to {to} versus the prior period.
Compare visitors and views for {id} between {from} and {to} to the period before.
GET /statistics/keywords Get Google Search Console keywords · Get Google Search Console keywords #
Ask an LLM
“Which Google search keywords lead people to my site?”
“Can I see Search Console queries alongside my analytics?”
Tell an agent
Get Google Search Console keywords for domain {id} from {from} to {to}.
List the search terms visitors used to find {id} between {from} and {to}.
GET /statistics Export statistics as CSV files · Export statistics as CSV #
Ask an LLM
“How do I download my site's analytics as CSV?”
“Can I export a ZIP of all statistics for a date range?”
Tell an agent
Export statistics for domain {id} from {from} to {to} as CSV.
Download a ZIP archive of CSV analytics for {id} between {from} and {to}.
DELETE /statistics Delete a domain's collected statistics · Delete statistics #
Ask an LLM
“How do I wipe all collected analytics for a site but keep the domain?”
“Can I delete statistics for only a specific date range?”
Tell an agent destructive · confirm first
Delete all statistics for domain {id}.
Delete {kind} statistics for domain {id} from {from} to {to}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/pirsch:pirsch-statistics-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

pirsch-statistics-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Pirsch Statistics API
  description: RESTful API for sending page views, events, and session data to Pirsch, and for querying statistics including visitors, pages, referrers, UTM parameters, geo-location, device, browser, conversion goals, funnels, and real-time active visitors. Also exposes management endpoints for domains, members, clients, webhooks, email reports, traffic filters, short links, and views.
  version: '1'
  contact:
    name: Pirsch Support
    url: https://pirsch.io
  license:
    name: Proprietary
    url: https://pirsch.io/privacy
servers:
- url: https://api.pirsch.io/api/v1
  description: Pirsch production API
security:
- BearerAuth: []
tags:
- name: Statistics
  description: Query analytics statistics by date range and filter criteria
paths:
  /statistics/total:
    get:
      operationId: getTotalStatistics
      summary: Get total statistics
      description: Get total visitors, views, sessions, and bounce data for a date range
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
        description: Domain ID
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: tz
        in: query
        schema:
          type: string
      - name: scale
        in: query
        schema:
          type: string
          enum:
          - day
          - week
          - month
          - year
      responses:
        '200':
          description: Total statistics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TotalStats'
  /statistics/visitor:
    get:
      operationId: getVisitorStatistics
      summary: Get visitor statistics over time
      description: Get visitors grouped by time scale
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: tz
        in: query
        schema:
          type: string
      - name: scale
        in: query
        schema:
          type: string
          enum:
          - day
          - week
          - month
          - year
      responses:
        '200':
          description: Visitor time series
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/VisitorStats'
  /statistics/page:
    get:
      operationId: getPageStatistics
      summary: Get page statistics
      description: Get statistics broken down by page path
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: search
        in: query
        schema:
          type: string
      - name: offset
        in: query
        schema:
          type: integer
      - name: limit
        in: query
        schema:
          type: integer
      - name: sort
        in: query
        schema:
          type: string
      - name: direction
        in: query
        schema:
          type: string
          enum:
          - asc
          - desc
      responses:
        '200':
          description: Page statistics
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PageStats'
  /statistics/hostname:
    get:
      operationId: getHostnameStatistics
      summary: Get hostname statistics
      description: Get statistics broken down by hostname
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: Hostname statistics
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    hostname:
                      type: string
                    visitors:
                      type: integer
                    views:
                      type: integer
                    sessions:
                      type: integer
                    bounces:
                      type: integer
                    relative_visitors:
                      type: number
                    relative_views:
                      type: number
                    bounce_rate:
                      type: number
  /statistics/referrer:
    get:
      operationId: getReferrerStatistics
      summary: Get referrer statistics
      description: Get statistics broken down by referrer
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: offset
        in: query
        schema:
          type: integer
      - name: limit
        in: query
        schema:
          type: integer
      responses:
        '200':
          description: Referrer statistics
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ReferrerStats'
  /statistics/channel:
    get:
      operationId: getChannelStatistics
      summary: Get traffic channel statistics
      description: Get statistics grouped by traffic channel
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: Channel statistics
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
  /statistics/utm/source:
    get:
      operationId: getUtmSourceStatistics
      summary: Get UTM source statistics
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: UTM source breakdown
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
  /statistics/utm/medium:
    get:
      operationId: getUtmMediumStatistics
      summary: Get UTM medium statistics
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: UTM medium breakdown
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
  /statistics/utm/campaign:
    get:
      operationId: getUtmCampaignStatistics
      summary: Get UTM campaign statistics
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: UTM campaign breakdown
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
  /statistics/utm/content:
    get:
      operationId: getUtmContentStatistics
      summary: Get UTM content statistics
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: UTM content breakdown
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
  /statistics/utm/term:
    get:
      operationId: getUtmTermStatistics
      summary: Get UTM term statistics
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: UTM term breakdown
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
  /statistics/country:
    get:
      operationId: getCountryStatistics
      summary: Get country statistics
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: Country breakdown
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    country:
                      type: string
                    visitors:
                      type: integer
                    relative_visitors:
                      type: number
  /statistics/region:
    get:
      operationId: getRegionStatistics
      summary: Get region statistics
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: Region breakdown
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
  /statistics/city:
    get:
      operationId: getCityStatistics
      summary: Get city statistics
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: City breakdown
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
  /statistics/language:
    get:
      operationId: getLanguageStatistics
      summary: Get language statistics
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: Language breakdown
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
  /statistics/browser:
    get:
      operationId: getBrowserStatistics
      summary: Get browser statistics
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: Browser breakdown
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
  /statistics/os:
    get:
      operationId: getOsStatistics
      summary: Get operating system statistics
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: OS breakdown
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
  /statistics/platform:
    get:
      operationId: getPlatformStatistics
      summary: Get platform statistics
      description: Get breakdown between desktop, mobile, and unknown platforms
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: Platform statistics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformStats'
  /statistics/events:
    get:
      operationId: getEventStatistics
      summary: Get event list and statistics
      description: Get list of tracked events with visitor counts and metadata keys
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: Event statistics
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EventStats'
  /statistics/goals:
    get:
      operationId: getGoalStatistics
      summary: Get conversion goal statistics
      description: Get statistics for all configured conversion goals
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: Goal statistics
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
  /statistics/funnel:
    get:
      operationId: getFunnelStatistics
      summary: Get funnel statistics
      description: Get step-by-step funnel analytics
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: funnel_id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: Funnel analytics
          content:
            application/json:
              schema:
                type: object
  /statistics/active:
    get:
      operationId: getActiveVisitors
      summary: Get active visitors
      description: Get current real-time active visitor count
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: start
        in: query
        schema:
          type: integer
          default: 600
        description: Number of seconds to consider a visitor active
      responses:
        '200':
          description: Active visitor data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActiveVisitors'
  /statistics/session/list:
    get:
      operationId: getSessionList
      summary: Get session list
      description: Get list of individual visitor sessions
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: offset
        in: query
        schema:
          type: integer
      - name: limit
        in: query
        schema:
          type: integer
      responses:
        '200':
          description: Session list
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
  /statistics/session/details:
    get:
      operationId: getSessionDetails
      summary: Get session details
      description: Get page-by-page breakdown of a single session
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: visitor_id
        in: query
        required: true
        schema:
          type: string
      - name: session_id
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Session details
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
  /statistics/growth:
    get:
      operationId: getGrowthStatistics
      summary: Get growth statistics
      description: Get growth rate metrics comparing the current period to the previous
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: Growth rates
          content:
            application/json:
              schema:
                type: object
  /statistics/keywords:
    get:
      operationId: getKeywords
      summary: Get Google Search Console keywords
      description: Get keyword data sourced from Google Search Console integration
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: Keyword data
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
  /statistics:
    get:
      operationId: exportStatistics
      summary: Export statistics as CSV
      description: Download a ZIP archive of CSV exports for the selected date range
      tags:
      - Statistics
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: ZIP file with CSV exports
          content:
            application/zip:
              schema:
                type: string
                format: binary
    delete:
      operationId: deleteStatistics
      summary: Delete statistics
      description: Delete all or partial statistics for a domain
      tags:
      - Statistics
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - id
              properties:
                id:
                  type: string
                  description: Domain ID
                kind:
                  type: string
                  enum:
                  - ''
                  - all
                  - events
                  - imported
                from:
                  type: string
                  format: date
                to:
                  type: string
                  format: date
      responses:
        '200':
          description: Statistics deleted
components:
  schemas:
    PlatformStats:
      type: object
      properties:
        platform_desktop:
          type: integer
        platform_mobile:
          type: integer
        platform_unknown:
          type: integer
        relative_platform_desktop:
          type: number
          format: float
        relative_platform_mobile:
          type: number
          format: float
        relative_platform_unknown:
          type: number
          format: float
    ActiveVisitors:
      type: object
      properties:
        stats:
          type: array
          items:
            type: object
        countries:
          type: array
          items:
            type: object
        visitors:
          type: integer
    PageStats:
      type: object
      properties:
        path:
          type: string
        title:
          type: string
        visitors:
          type: integer
        views:
          type: integer
        sessions:
          type: integer
        bounces:
          type: integer
        relative_visitors:
          type: number
          format: float
        relative_views:
          type: number
          format: float
        bounce_rate:
          type: number
          format: float
        average_time_spent_seconds:
          type: integer
    ReferrerStats:
      type: object
      properties:
        referrer:
          type: string
        referrer_name:
          type: string
        referrer_icon:
          type: string
        visitors:
          type: integer
        sessions:
          type: integer
        relative_visitors:
          type: number
          format: float
        bounces:
          type: integer
        bounce_rate:
          type: number
          format: float
    TotalStats:
      type: object
      properties:
        visitors:
          type: integer
        views:
          type: integer
        sessions:
          type: integer
        bounces:
          type: integer
        bounce_rate:
          type: number
          format: float
        cr:
          type: number
          format: float
        custom_metric_avg:
          type: number
          format: float
        custom_metric_total:
          type: number
          format: float
    VisitorStats:
      type: object
      properties:
        day:
          type: string
          format: date-time
        week:
          type: string
          format: date-time
        month:
          type: string
          format: date-time
        year:
          type: string
          format: date-time
        visitors:
          type: integer
        views:
          type: integer
        sessions:
          type: integer
        bounces:
          type: integer
        bounce_rate:
          type: number
          format: float
        cr:
          type: number
          format: float
        custom_metric_avg:
          type: number
          format: float
        custom_metric_total:
          type: number
          format: float
    EventStats:
      type: object
      properties:
        name:
          type: string
        count:
          type: integer
        visitors:
          type: integer
        views:
          type: integer
        cr:
          type: number
          format: float
        average_duration_seconds:
          type: integer
        meta_keys:
          type: array
          items:
            type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Pass an OAuth2 access token obtained from POST /token, or a static access key, as a Bearer token in the Authorization header.