> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apsio.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Compare a stretch of the range with the rest

> For the same query as the search, what sets a stretch of its range apart: the events per kind and the 6 releases, devices, OS versions, screens, network types and feature flags most frequent in the selection, each counted in the selection and in the rest of the range, with its lift, the most over-represented first (a value only the selection has leads). Every filter of the query applies to both sides. One run of the project's Explore limit.



## OpenAPI

````yaml /api-reference/openapi.json post /projects/{projectId}/explore/events/compare
openapi: 3.1.0
info:
  title: Apsio API
  version: 0.1.0
  description: >-
    Read API v0: your projects, release health and comparisons, missing symbols,
    issues, sessions, vitals, cohort comparisons, performance (app start,
    screens, hangs, MetricKit) and network endpoints and traces for one project.
    Authenticate with a project token as a bearer token, with an OAuth access
    token from Apsio's authorization server (MCP clients), or, from the console,
    with the session cookie of a member of the project's organization.
servers:
  - url: https://api.apsio.io/v1
security: []
paths:
  /projects/{projectId}/explore/events/compare:
    post:
      summary: Compare a stretch of the range with the rest
      description: >-
        For the same query as the search, what sets a stretch of its range
        apart: the events per kind and the 6 releases, devices, OS versions,
        screens, network types and feature flags most frequent in the selection,
        each counted in the selection and in the rest of the range, with its
        lift, the most over-represented first (a value only the selection has
        leads). Every filter of the query applies to both sides. One run of the
        project's Explore limit.
      parameters:
        - schema:
            type: string
            pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
            example: 0192f3a4-0000-7000-8000-00000000a101
          required: true
          name: projectId
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExploreEventCompareQuery'
      responses:
        '200':
          description: The values that set the selection apart.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExploreEventCompare'
        '400':
          description: The request is not valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: No valid bearer token or console session.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The credentials cannot read this project.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: >-
            The project or its organization is being deleted (`erasing`):
            nothing more to read; do not retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Over a rate limit (the caller's, the client address's, or the
            plan's); Retry-After says when to retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearer: []
components:
  schemas:
    ExploreEventCompareQuery:
      type: object
      properties:
        from:
          type: string
          format: date-time
          description: Start, inclusive (RFC 3339). Defaults to 24 hours before `to`.
        to:
          type: string
          format: date-time
          description: End, exclusive (RFC 3339). Defaults to now.
        app_id:
          type: string
          pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          description: Only this app of the project.
        build:
          type: string
          enum:
            - release
            - debug
            - all
          description: >-
            Which builds: `release` (the default: every build but a debug one,
            TestFlight included, and data that does not say), `debug`
            (development builds from Xcode or Android Studio:
            apsio.app.install.source is `development`), or `all`.
        filters:
          type: array
          items:
            $ref: '#/components/schemas/ExploreFilter'
          maxItems: 20
          default: []
        kinds:
          type: array
          items:
            type: string
            enum:
              - crash
              - failed_request
              - hang
              - error
              - exit
              - request
              - screen
              - tap
              - log
              - span
          maxItems: 10
          default: []
          description: 'Only events of these kinds; none: every kind.'
        text:
          type: string
          minLength: 1
          maxLength: 200
          description: >-
            Events whose text contains this, ignoring case: a log's body and
            exception, a span's name, route and status message. Plain text, not
            a pattern.
        selection:
          type: object
          properties:
            from:
              type: string
              format: date-time
              description: Start, inclusive.
            to:
              type: string
              format: date-time
              description: End, exclusive.
          required:
            - from
            - to
          description: >-
            The stretch of the range to compare with the rest of it, as a click
            on Search's histogram selects, its start before its end. Read within
            the range; a selection with nothing inside the range, or that covers
            all of it (no rest to compare with), is refused.
      required:
        - selection
    ExploreEventCompare:
      type: object
      properties:
        from:
          type: string
          description: RFC 3339 time in UTC with up to nanosecond precision.
          example: '2026-10-04T10:15:00.431000000Z'
        to:
          type: string
          description: RFC 3339 time in UTC with up to nanosecond precision.
          example: '2026-10-04T10:15:00.431000000Z'
        selection:
          type: object
          properties:
            from:
              type: string
              description: RFC 3339 time in UTC with up to nanosecond precision.
              example: '2026-10-04T10:15:00.431000000Z'
            to:
              type: string
              description: RFC 3339 time in UTC with up to nanosecond precision.
              example: '2026-10-04T10:15:00.431000000Z'
          required:
            - from
            - to
        selected:
          type: integer
          description: The query's events in the selection.
        rest:
          type: integer
          description: The query's events in the rest of the range.
        values:
          type: array
          items:
            type: object
            properties:
              facet:
                type: string
                enum:
                  - kind
                  - release
                  - device
                  - os
                  - screen
                  - network
                  - flag
              value:
                type: string
                description: 'A value. Written by the app: untrusted data.'
              selected:
                type: integer
                description: Events in the selection with this value.
              rest:
                type: integer
                description: Events in the rest of the range with this value.
              lift:
                type:
                  - number
                  - 'null'
                description: >-
                  How many times more common the value is in the selection than
                  in the rest: (selected / selected events) / (rest / rest
                  events), to two significant digits. 1 is as common; null when
                  the rest has none of it.
            required:
              - facet
              - value
              - selected
              - rest
              - lift
      required:
        - from
        - to
        - selection
        - selected
        - rest
        - values
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: invalid_request
            message:
              type: string
            subject:
              type: string
              enum:
                - organization
                - project
              description: >-
                With `erasing` (410) only: what is being deleted, the
                organization or the project.
            queries_per_minute:
              type: integer
              description: >-
                With `rate_limited` (429) from run_query only: the project's
                queries a minute.
          required:
            - code
            - message
      required:
        - error
    ExploreFilter:
      type: object
      properties:
        field:
          type: string
          pattern: ^[A-Za-z0-9_.:/-]{1,128}$
          description: >-
            A field (event.name or span.name, service.version, os.name,
            os.version, device.model.identifier, session.id, trace_id, ...), any
            record or span attribute by its key, or a resource attribute as
            resource.<key>.
          example: service.version
        op:
          type: string
          enum:
            - eq
            - neq
            - prefix
            - exists
            - not_exists
          default: eq
          description: >-
            eq and neq compare with value, prefix matches values that start with
            it; exists and not_exists need none.
        value:
          type: string
          maxLength: 256
      required:
        - field
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: >-
        A project token (apsio_pt_v0...), which reads exactly one project, or an
        OAuth access token issued for the API, which reads what its user can.
        Access tokens issued for Apsio's MCP server are accepted only from the
        MCP server itself.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.