RapidAPI Analytics API

Endpoints for retrieving gateway traffic analytics, including request counts, response times, error rates, and usage patterns.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

rapidapi-analytics-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: RapidAPI Gateway Alerts Analytics API
  description: The RapidAPI Gateway provides enterprise-grade API gateway capabilities for managing API traffic, security, and routing. It enables organizations to configure custom gateways that handle authentication, rate limiting, and request routing for their APIs. The gateway supports multiple deployment models and can be configured to work with existing infrastructure, providing a centralized point of control for all API traffic flowing through the RapidAPI platform. The Rapid Runtime proxies requests between consumers and providers, adding authentication verification, usage tracking, and billing data collection.
  version: '1.0'
  contact:
    name: RapidAPI Support
    url: https://docs.rapidapi.com
  termsOfService: https://rapidapi.com/terms
servers:
- url: https://gateway.rapidapi.com/v1
  description: Production Server
security:
- rapidApiKey: []
tags:
- name: Analytics
  description: Endpoints for retrieving gateway traffic analytics, including request counts, response times, error rates, and usage patterns.
paths:
  /gateways/{gatewayId}/analytics:
    get:
      operationId: getGatewayAnalytics
      summary: Get gateway analytics
      description: Retrieves traffic analytics for a gateway over a specified time period, including request counts, response times, error rates, and top endpoints by usage.
      tags:
      - Analytics
      parameters:
      - $ref: '#/components/parameters/gatewayId'
      - name: startDate
        in: query
        required: true
        description: Start date for the analytics period
        schema:
          type: string
          format: date
      - name: endDate
        in: query
        required: true
        description: End date for the analytics period
        schema:
          type: string
          format: date
      - name: granularity
        in: query
        required: false
        description: Time granularity for the analytics data
        schema:
          type: string
          enum:
          - hour
          - day
          - week
          - month
          default: day
      responses:
        '200':
          description: Gateway analytics data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayAnalytics'
        '400':
          description: Bad request - invalid date range or parameters
        '401':
          description: Unauthorized - invalid or missing API key
        '404':
          description: Gateway not found
components:
  schemas:
    GatewayAnalytics:
      type: object
      properties:
        gatewayId:
          type: string
          description: The gateway the analytics are for
        period:
          type: object
          properties:
            startDate:
              type: string
              format: date
              description: Start of the analytics period
            endDate:
              type: string
              format: date
              description: End of the analytics period
          description: The time period for the analytics
        totalRequests:
          type: integer
          description: Total number of requests in the period
        totalErrors:
          type: integer
          description: Total number of error responses
        averageResponseTime:
          type: number
          format: double
          description: Average response time in milliseconds
        dataPoints:
          type: array
          items:
            type: object
            properties:
              timestamp:
                type: string
                format: date-time
                description: The time bucket for this data point
              requests:
                type: integer
                description: Number of requests in this time bucket
              errors:
                type: integer
                description: Number of errors in this time bucket
              averageResponseTime:
                type: number
                format: double
                description: Average response time in milliseconds
          description: Time-series analytics data points
        topEndpoints:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                description: Endpoint path
              requestCount:
                type: integer
                description: Number of requests to this endpoint
              averageResponseTime:
                type: number
                format: double
                description: Average response time for this endpoint
          description: Top endpoints by request volume
  parameters:
    gatewayId:
      name: gatewayId
      in: path
      required: true
      description: The unique identifier of the gateway
      schema:
        type: string
  securitySchemes:
    rapidApiKey:
      type: apiKey
      name: X-RapidAPI-Key
      in: header
      description: RapidAPI key used for authenticating requests to the Gateway API.
externalDocs:
  description: RapidAPI Gateway Configuration Documentation
  url: https://docs.rapidapi.com/docs/gateway-configuration