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

# Get Endpoint Stats

> Get endpoint statistics aggregated across a project with pagination.
Optionally filter by specific apps within the project.

Query parameters:
- app_slugs: Comma-separated app slugs to filter
- environment: Filter by environment name
- since/until: Time range
- methods: Comma-separated HTTP methods (e.g., "GET,POST")
- status_classes: Comma-separated status classes (e.g., "2xx,4xx")
- status_codes: Comma-separated status codes (e.g., "200,404")
- q: Search query for path or method
- sort_by: Field to sort by (endpoint, total_requests, error_rate, avg_response_time_ms, p95_response_time_ms)
- sort_dir: Sort direction (asc or desc)
- page: Page number (1-indexed)
- page_size: Items per page

Returns:
{
    "items": [...],
    "total_count": int
}



## OpenAPI

````yaml https://api.apilens.ai/api/v1/openapi.json get /api/v1/projects/{project_slug}/analytics/endpoints
openapi: 3.1.0
info:
  title: APILens API
  version: 1.0.0
  description: API Observability Platform
servers: []
security: []
paths:
  /api/v1/projects/{project_slug}/analytics/endpoints:
    get:
      tags:
        - Projects
      summary: Get Endpoint Stats
      description: >-
        Get endpoint statistics aggregated across a project with pagination.

        Optionally filter by specific apps within the project.


        Query parameters:

        - app_slugs: Comma-separated app slugs to filter

        - environment: Filter by environment name

        - since/until: Time range

        - methods: Comma-separated HTTP methods (e.g., "GET,POST")

        - status_classes: Comma-separated status classes (e.g., "2xx,4xx")

        - status_codes: Comma-separated status codes (e.g., "200,404")

        - q: Search query for path or method

        - sort_by: Field to sort by (endpoint, total_requests, error_rate,
        avg_response_time_ms, p95_response_time_ms)

        - sort_dir: Sort direction (asc or desc)

        - page: Page number (1-indexed)

        - page_size: Items per page


        Returns:

        {
            "items": [...],
            "total_count": int
        }
      operationId: api_projects_router_get_endpoint_stats
      parameters:
        - in: path
          name: project_slug
          schema:
            title: Project Slug
            type: string
          required: true
        - in: query
          name: app_slugs
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: App Slugs
          required: false
        - in: query
          name: environment
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Environment
          required: false
        - in: query
          name: since
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Since
          required: false
        - in: query
          name: until
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Until
          required: false
        - in: query
          name: methods
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Methods
          required: false
        - in: query
          name: status_classes
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Status Classes
          required: false
        - in: query
          name: status_codes
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Status Codes
          required: false
        - in: query
          name: q
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Q
          required: false
        - in: query
          name: sort_by
          schema:
            default: total_requests
            title: Sort By
            type: string
          required: false
        - in: query
          name: sort_dir
          schema:
            default: desc
            title: Sort Dir
            type: string
          required: false
        - in: query
          name: page
          schema:
            default: 1
            title: Page
            type: integer
          required: false
        - in: query
          name: page_size
          schema:
            default: 25
            title: Page Size
            type: integer
          required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                additionalProperties: true
                title: Response
                type: object
      security:
        - JWTBearer: []
components:
  securitySchemes:
    JWTBearer:
      type: http
      scheme: bearer

````