Swetrix Custom Events API

Custom event analytics

Business capability
Product Usage Analytics BC-4280.30

Operations 1

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 /v1/log/custom-events Chart custom event counts over time · Get Custom Events Data #
Ask an LLM
“How many times did my signup custom event fire each day this month?”
“Can I compare trends for several custom events in one Swetrix query?”
Tell an agent
Get counts for custom events {customEvents} in project {pid} over {period} grouped by {timeBucket}.
Show the trend of custom events {customEvents} for project {pid} from {from} to {to}, bucketed by {timeBucket}, for period {period}.

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/swetrix:swetrix-custom-events-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

swetrix-custom-events-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Swetrix Statistics Custom Events API
  description: The Swetrix Statistics API enables querying aggregated analytics data for projects including traffic logs, performance metrics, session details, funnel analysis, user navigation flows, error statistics, keyword data, and feature flag evaluations. All requests require authentication via the X-Api-Key header. Rate limit is 600 requests/hour.
  version: '1.0'
  contact:
    name: Swetrix Support
    url: https://swetrix.com/contact
  termsOfService: https://swetrix.com/privacy
  license:
    name: AGPL-3.0
    url: https://github.com/Swetrix/swetrix-api/blob/main/LICENSE
servers:
- url: https://api.swetrix.com
  description: Swetrix Production API
security:
- ApiKeyAuth: []
tags:
- name: Custom Events
  description: Custom event analytics
paths:
  /v1/log/custom-events:
    get:
      operationId: getCustomEvents
      summary: Get Custom Events Data
      description: Returns custom event analytics grouped by time bucket for specified event names. Returns counts and trends for each custom event.
      tags:
      - Custom Events
      parameters:
      - $ref: '#/components/parameters/pid'
      - $ref: '#/components/parameters/timeBucket'
      - $ref: '#/components/parameters/period'
      - $ref: '#/components/parameters/from'
      - $ref: '#/components/parameters/to'
      - $ref: '#/components/parameters/timezone'
      - name: customEvents
        in: query
        required: true
        schema:
          type: string
        description: JSON array of custom event names to query
      responses:
        '200':
          description: Custom events data grouped by time bucket
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  parameters:
    timeBucket:
      name: timeBucket
      in: query
      required: true
      schema:
        type: string
        enum:
        - minute
        - hour
        - day
        - week
        - month
        - year
      description: Time bucket for data aggregation
    to:
      name: to
      in: query
      schema:
        type: string
        format: date
      description: Custom range end date (YYYY-MM-DD)
    timezone:
      name: timezone
      in: query
      schema:
        type: string
        default: Etc/GMT
      description: IANA timezone name (default Etc/GMT)
    pid:
      name: pid
      in: query
      required: true
      schema:
        type: string
      description: Project ID
    from:
      name: from
      in: query
      schema:
        type: string
        format: date
      description: Custom range start date (YYYY-MM-DD)
    period:
      name: period
      in: query
      required: true
      schema:
        type: string
        enum:
        - 1h
        - today
        - yesterday
        - 1d
        - 7d
        - 4w
        - 3M
        - 12M
        - 24M
        - all
      description: Time period for the query
  responses:
    Unauthorized:
      description: Unauthorized - missing or invalid API key
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: API key from Swetrix account settings (https://swetrix.com/user-settings)
externalDocs:
  description: Swetrix Statistics API Documentation
  url: https://swetrix.com/docs/statistics-api