Swetrix Errors API

Record JavaScript error events

Operations 4

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/errors List grouped JavaScript errors for a project · List Error Events #
Ask an LLM
“Which JavaScript errors are my visitors hitting most this week?”
“Can I page through error groups 150 at a time?”
Tell an agent
List error groups for project {pid} over {period}.
Show the next {take} error groups for project {pid} over {period}, skipping {skip}.
GET /v1/log/get-error View details of one error group · Get Error Details #
Ask an LLM
“What are the full details behind a specific error group?”
“Can I drill into one error by its ID to see its occurrences?”
Tell an agent
Get details for error {eid} in project {pid} over {period}.
Show me error group {eid} on project {pid} from {from} to {to} for period {period}.
GET /v1/log/error-overview Chart error counts over time · Get Error Statistics Overview #
Ask an LLM
“Is my site's error rate going up or down over time?”
“How many errors happened per day across the whole project?”
Tell an agent
Chart error counts for project {pid} over {period} by {timeBucket}.
Get the error statistics overview for project {pid}, bucketed by {timeBucket}, for {period}.
POST /log/error Report a JavaScript error from a page · Record Error Event #
Ask an LLM
“How do I send a caught JavaScript exception to Swetrix?”
“Can I include a stack trace and source file line when logging an error?”
Tell an agent
Record a {name} error with message {message} for project {pid}.
Log error {name} from {filename} at line {lineno} for project {pid} with stack trace {stackTrace}.

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-errors-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-errors-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Swetrix Errors API
  version: '1.0'
  contact:
    name: Swetrix Support
    url: https://swetrix.com/contact
  license:
    name: AGPL-3.0
    url: https://github.com/Swetrix/swetrix-api/blob/main/LICENSE
  termsOfService: https://swetrix.com/privacy
  description: 'Operations tagged Errors across 2 of this provider''s published API definitions: swetrix-statistics-api-openapi.yml, swetrix-errors-api-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.swetrix.com
  description: Swetrix Production API
security:
- ApiKeyAuth: []
tags:
- name: Errors
  description: JavaScript error statistics
paths:
  /v1/log/errors:
    get:
      operationId: listErrors
      summary: List Error Events
      description: Returns a paginated list of error event groups for the specified project and time period.
      tags:
      - Errors
      parameters:
      - $ref: '#/components/parameters/pid'
      - $ref: '#/components/parameters/period'
      - $ref: '#/components/parameters/from'
      - $ref: '#/components/parameters/to'
      - $ref: '#/components/parameters/timezone'
      - $ref: '#/components/parameters/filters'
      - $ref: '#/components/parameters/take'
      - $ref: '#/components/parameters/skip'
      responses:
        '200':
          description: Paginated error list
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
    servers:
    - url: https://api.swetrix.com
      description: Swetrix Production API
  /v1/log/get-error:
    get:
      operationId: getError
      summary: Get Error Details
      description: Returns detailed information for a specific error group by error ID.
      tags:
      - Errors
      parameters:
      - $ref: '#/components/parameters/pid'
      - name: eid
        in: query
        required: true
        schema:
          type: string
        description: Error group ID
      - $ref: '#/components/parameters/period'
      - $ref: '#/components/parameters/from'
      - $ref: '#/components/parameters/to'
      - $ref: '#/components/parameters/timezone'
      responses:
        '200':
          description: Error group details
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
    servers:
    - url: https://api.swetrix.com
      description: Swetrix Production API
  /v1/log/error-overview:
    get:
      operationId: getErrorOverview
      summary: Get Error Statistics Overview
      description: Returns aggregated error statistics for chart rendering, showing error counts over the specified time period.
      tags:
      - Errors
      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'
      responses:
        '200':
          description: Error overview chart data
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
    servers:
    - url: https://api.swetrix.com
      description: Swetrix Production API
  /log/error:
    servers:
    - url: https://api.swetrix.com
      description: Swetrix Production API
    post:
      operationId: recordError
      summary: Record Error Event
      description: Records a JavaScript error event for aggregation in the Errors tab of the dashboard. Captures error name, message, stack trace, source file, and location. Errors are grouped by name and message.
      tags:
      - Errors
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ErrorEvent'
            example:
              pid: abc123projectid
              name: TypeError
              message: Cannot read property 'foo' of undefined
              lineno: 42
              colno: 15
              filename: https://example.com/app.js
              pg: /dashboard
              lc: en-US
      responses:
        '201':
          description: Error recorded successfully
          content:
            application/json:
              schema:
                type: object
                example: {}
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/ServerError'
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
    skip:
      name: skip
      in: query
      schema:
        type: integer
        default: 0
      description: Number of results to skip for pagination
    filters:
      name: filters
      in: query
      schema:
        type: string
      description: JSON array of filter objects
    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
    take:
      name: take
      in: query
      schema:
        type: integer
        default: 30
        maximum: 150
      description: Number of results to return (max 150)
  responses:
    Unauthorized:
      description: Unauthorized - missing or invalid API key
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
    BadRequest:
      description: Bad request - malformed body, missing required fields, or disabled project
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
    ServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
  schemas:
    ErrorEvent:
      type: object
      required:
      - pid
      - name
      properties:
        pid:
          type: string
          description: Project ID
        name:
          type: string
          maxLength: 200
          description: Error name (e.g. TypeError)
        message:
          type: string
          maxLength: 2000
          description: Error message
        lineno:
          type: integer
          description: Line number where error occurred
        colno:
          type: integer
          description: Column number where error occurred
        stackTrace:
          type: string
          maxLength: 7500
          description: Full stack trace
        filename:
          type: string
          maxLength: 1000
          description: Source file URL
        tz:
          type: string
          description: Visitor timezone
        pg:
          type: string
          description: Page path
        lc:
          type: string
          description: Locale
        meta:
          type: object
          description: Custom metadata (max 100 keys, 2000 chars total)
          additionalProperties:
            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
x-refined-from:
- swetrix-statistics-api-openapi.yml
- swetrix-errors-api-openapi.yml