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

# Compare Servers

> Compares 2-5 servers over one analytics range. Use `by=id` or `by=cfxId` for each reference. Available on all standard plans.



## OpenAPI

````yaml /rapidapi-v1.yaml post /rapid/v1/compare
openapi: 3.0.2
info:
  title: Fexmetrics RapidAPI
  version: 1.0.0
  description: |
    Customer-facing RapidAPI v1 contract.

    Raw history returns recorded time-series observations and is restricted by
    plan depth. Stats, growth, peak-hours, integrity, and compare return derived
    calculations; access to a derived range does not grant raw observations for
    that range.

    `by=id` is the default wherever `by` is available. Use `by=cfxId` when the
    identifier is a CFX network ID.

    RapidAPI handles authentication, request limits, quotas, and billing.
  contact:
    name: Fexmetrics
servers:
  - url: https://fexmetrics-fivem-redm-server-analytics-api3.p.rapidapi.com
    description: RapidAPI gateway
security:
  - RapidApiKey: []
tags:
  - name: Servers
    description: Public server discovery and current state.
  - name: Raw History
    description: Recorded observations with plan-specific download depth.
  - name: Analytics
    description: Derived summaries calculated from bounded observation windows.
  - name: Integrity
    description: Explainable heuristic analysis; never proof or a calibrated probability.
  - name: Comparison
    description: Set-based comparison of two to five public servers.
paths:
  /rapid/v1/compare:
    post:
      tags:
        - Comparison
      summary: Compare Servers
      description: >-
        Compares 2-5 servers over one analytics range. Use `by=id` or `by=cfxId`
        for each reference. Available on all standard plans.
      operationId: compareRapidServers
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompareRequest'
            examples:
              mixedIdentifiers:
                value:
                  servers:
                    - identifier: public-fivem
                      by: id
                    - identifier: cfx-history
                      by: cfxId
                  range: 30d
      responses:
        '200':
          description: Derived statistics in caller order.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompareResponse'
              examples:
                success:
                  value:
                    range: 30d
                    data:
                      - serverId: public-fivem
                        cfxId: cfx-public
                        range: 30d
                        currentPlayers: 80
                        averagePlayers: 42.7
                        medianPlayers: 41
                        peakPlayers: 91
                        lowestPlayers: 6
                        growth:
                          players: 12.4
                          percentage: 39.7
                        uptime: null
                        sampleCount: 2880
                      - serverId: history-redm
                        cfxId: cfx-history
                        range: 30d
                        currentPlayers: 40
                        averagePlayers: 37.2
                        medianPlayers: 37
                        peakPlayers: 65
                        lowestPlayers: 10
                        growth:
                          players: 8.1
                          percentage: 27.8
                        uptime: null
                        sampleCount: 2880
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/FeatureNotAvailable'
        '404':
          $ref: '#/components/responses/ServerNotFound'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    CompareRequest:
      type: object
      additionalProperties: false
      required:
        - servers
      properties:
        servers:
          type: array
          minItems: 2
          maxItems: 5
          items:
            $ref: '#/components/schemas/ServerReference'
        range:
          type: string
          enum:
            - 24h
            - 7d
            - 30d
            - 90d
            - 1y
          default: 30d
    CompareResponse:
      type: object
      additionalProperties: false
      required:
        - range
        - data
      properties:
        range:
          type: string
          enum:
            - 24h
            - 7d
            - 30d
            - 90d
            - 1y
        data:
          type: array
          minItems: 2
          maxItems: 5
          items:
            $ref: '#/components/schemas/ServerResult'
    ServerReference:
      type: object
      additionalProperties: false
      required:
        - identifier
        - by
      properties:
        identifier:
          type: string
          minLength: 1
          maxLength: 128
          pattern: ^[A-Za-z0-9-]+$
        by:
          type: string
          enum:
            - id
            - cfxId
          description: Explicit identifier namespace; never guessed.
    ServerResult:
      allOf:
        - $ref: '#/components/schemas/ServerStats'
      description: >-
        Derived statistics for one canonical compare member; uptime remains
        null.
    ErrorResponse:
      type: object
      additionalProperties: false
      required:
        - error
      properties:
        error:
          type: object
          additionalProperties: false
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - INVALID_REQUEST
                - RAPIDAPI_UNAUTHORIZED
                - FEATURE_NOT_AVAILABLE
                - SERVER_NOT_FOUND
                - RATE_LIMITED
                - INTERNAL_ERROR
            message:
              type: string
    ServerStats:
      type: object
      additionalProperties: false
      required:
        - serverId
        - cfxId
        - range
        - currentPlayers
        - averagePlayers
        - medianPlayers
        - peakPlayers
        - lowestPlayers
        - growth
        - uptime
        - sampleCount
      properties:
        serverId:
          type: string
        cfxId:
          type: string
        range:
          type: string
          enum:
            - 24h
            - 7d
            - 30d
            - 90d
            - 1y
        currentPlayers:
          type: integer
          description: Current player count, not the last history point.
        averagePlayers:
          type: number
          nullable: true
        medianPlayers:
          type: number
          nullable: true
        peakPlayers:
          type: number
          nullable: true
        lowestPlayers:
          type: number
          nullable: true
        growth:
          $ref: '#/components/schemas/GrowthFields'
        uptime:
          type: number
          nullable: true
          enum:
            - null
          description: >
            Always null in v1. Explicit collection attempts and availability

            outcomes are not stored, so missing observations cannot be treated
            as

            downtime.
        sampleCount:
          type: integer
          minimum: 0
    GrowthFields:
      type: object
      additionalProperties: false
      required:
        - players
        - percentage
      properties:
        players:
          type: number
          nullable: true
        percentage:
          type: number
          nullable: true
  responses:
    InvalidRequest:
      description: Query, path, body, range, or duplicate-reference validation failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            invalidRequest:
              value:
                error:
                  code: INVALID_REQUEST
                  message: Invalid request
    Unauthorized:
      description: RapidAPI authentication failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            unauthorized:
              value:
                error:
                  code: RAPIDAPI_UNAUTHORIZED
                  message: Unauthorized
    FeatureNotAvailable:
      description: The authenticated subscription does not include this feature or range.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            featureNotAvailable:
              value:
                error:
                  code: FEATURE_NOT_AVAILABLE
                  message: Feature not available for this subscription
    ServerNotFound:
      description: Server is unknown or is not publishable through RapidAPI.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            serverNotFound:
              value:
                error:
                  code: SERVER_NOT_FOUND
                  message: Server not found
    InternalError:
      description: Unexpected service error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internalError:
              value:
                error:
                  code: INTERNAL_ERROR
                  message: Internal server error
  securitySchemes:
    RapidApiKey:
      type: apiKey
      in: header
      name: X-RapidAPI-Key
      description: Customer key supplied by RapidAPI.
      x-default: YOUR_API_KEY

````