Pirsch Tracking API

Send page views, events, and session keep-alive signals

Business capability
Product Telemetry Instrumentation BC-4280.10

Operations 6

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

POST /hit Record a single page view server-side · Send a page view #
Ask an LLM
“How do I track page views from my backend instead of a JavaScript snippet?”
“Which visitor details, like IP and user agent, must I forward with a page view?”
Tell an agent
Record a page view for {url} from IP {ip} with user agent {user_agent}.
Track a visit to {url} titled {title} referred by {referrer} for IP {ip} and agent {user_agent}.
POST /hit/batch Record many page views in one request · Send multiple page views #
Ask an LLM
“Can I send a backlog of page views in one request?”
“What's the most efficient way to import many page hits at once?”
Tell an agent
Send this batch of page views in one request.
Upload the queued page hits together as a batch.
POST /event Record a custom event · Send a custom event #
Ask an LLM
“How do I track a button click or signup as a custom event?”
“Can I attach metadata and a duration to an event?”
Tell an agent
Send event {event_name} on {url} for IP {ip} and user agent {user_agent}.
Track event {event_name} at {url} with metadata {event_meta} for IP {ip} and agent {user_agent}.
POST /event/batch Record many custom events at once · Send multiple custom events #
Ask an LLM
“Can I send multiple custom events in a single call?”
“Is there a bulk endpoint for queued event tracking?”
Tell an agent
Send this batch of custom events.
Upload the queued events together in one request.
POST /session Extend a visitor's session · Keep a session alive #
Ask an LLM
“How do I keep a visitor's session from timing out while they stay on a page?”
“Can I extend a session without recording a new page view?”
Tell an agent
Keep the session alive for IP {ip} with user agent {user_agent}.
Extend the current visitor session for {ip} using agent {user_agent}.
POST /session/batch Extend many visitor sessions at once · Keep multiple sessions alive #
Ask an LLM
“Can I extend several visitor sessions in one request?”
“Is there a batch way to send session keep-alive pings?”
Tell an agent
Keep this batch of visitor sessions alive.
Send all pending session keep-alive pings together.

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-tracking-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-tracking-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Pirsch Tracking 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: Tracking
  description: Send page views, events, and session keep-alive signals
paths:
  /hit:
    post:
      operationId: sendPageView
      summary: Send a page view
      description: Track a single page view for a domain
      tags:
      - Tracking
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HitRequest'
      responses:
        '200':
          description: Page view accepted
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /hit/batch:
    post:
      operationId: sendPageViewBatch
      summary: Send multiple page views
      description: Track a batch of page views
      tags:
      - Tracking
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/HitBatchRequest'
      responses:
        '200':
          description: Batch accepted
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /event:
    post:
      operationId: sendEvent
      summary: Send a custom event
      description: Track a single custom event with optional metadata
      tags:
      - Tracking
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventRequest'
      responses:
        '200':
          description: Event accepted
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /event/batch:
    post:
      operationId: sendEventBatch
      summary: Send multiple custom events
      description: Track a batch of custom events
      tags:
      - Tracking
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/EventBatchRequest'
      responses:
        '200':
          description: Batch accepted
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /session:
    post:
      operationId: keepSessionAlive
      summary: Keep a session alive
      description: Extend an existing visitor session
      tags:
      - Tracking
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SessionRequest'
      responses:
        '200':
          description: Session extended
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /session/batch:
    post:
      operationId: keepSessionAliveBatch
      summary: Keep multiple sessions alive
      description: Extend multiple visitor sessions in a single request
      tags:
      - Tracking
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/SessionBatchRequest'
      responses:
        '200':
          description: Sessions extended
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        validation:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Field-level validation errors
        error:
          type: array
          items:
            type: string
          description: General error messages
        context:
          type: object
          additionalProperties: true
          description: Additional error context
    EventRequest:
      type: object
      allOf:
      - $ref: '#/components/schemas/HitRequest'
      - type: object
        required:
        - event_name
        properties:
          event_name:
            type: string
            description: Name of the event
          event_duration:
            type: number
            description: Event duration in seconds
          event_meta:
            type: object
            additionalProperties:
              type: string
            description: Event metadata key-value pairs
          non_interactive:
            type: boolean
            description: Whether the event is non-interactive
    SessionBatchRequest:
      type: object
      allOf:
      - $ref: '#/components/schemas/SessionRequest'
      - type: object
        required:
        - time
        properties:
          time:
            type: string
            format: date-time
    SessionRequest:
      type: object
      required:
      - ip
      - user_agent
      properties:
        ip:
          type: string
        user_agent:
          type: string
        sec_ch_ua:
          type: string
        sec_ch_ua_mobile:
          type: string
        sec_ch_ua_platform:
          type: string
        sec_ch_ua_platform_version:
          type: string
        disable_bot_filter:
          type: boolean
    HitBatchRequest:
      type: object
      allOf:
      - $ref: '#/components/schemas/HitRequest'
      - type: object
        required:
        - time
        properties:
          time:
            type: string
            format: date-time
            description: Timestamp of the page view (ISO 8601)
    HitRequest:
      type: object
      required:
      - url
      - ip
      - user_agent
      properties:
        url:
          type: string
          format: uri
          description: Full URL of the page viewed
        ip:
          type: string
          description: Visitor IP address
        user_agent:
          type: string
          description: Visitor User-Agent header value
        accept_language:
          type: string
          description: Accept-Language header value
        referrer:
          type: string
          description: HTTP Referer header value
        title:
          type: string
          description: Page title
        sec_ch_ua:
          type: string
          description: Sec-CH-UA client hint header
        sec_ch_ua_mobile:
          type: string
          description: Sec-CH-UA-Mobile client hint header
        sec_ch_ua_platform:
          type: string
          description: Sec-CH-UA-Platform client hint header
        sec_ch_ua_platform_version:
          type: string
          description: Sec-CH-UA-Platform-Version client hint header
        sec_ch_width:
          type: string
          description: Sec-CH-Width client hint header
        sec_ch_viewport_width:
          type: string
          description: Sec-CH-Viewport-Width client hint header
        screen_width:
          type: integer
          description: Screen width in pixels
        screen_height:
          type: integer
          description: Screen height in pixels
        disable_bot_filter:
          type: boolean
          description: Disable bot filtering for this request
        tags:
          type: object
          additionalProperties:
            type: string
          description: Custom key-value tags
    EventBatchRequest:
      type: object
      allOf:
      - $ref: '#/components/schemas/EventRequest'
      - type: object
        required:
        - time
        properties:
          time:
            type: string
            format: date-time
  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.