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

# Count entries

> Count the number of log entries for a given key within an optional
sequence range.




## OpenAPI

````yaml /openapi/log.yaml get /api/v1/log/count
openapi: 3.1.0
info:
  title: OpenData Log API
  version: 1.0.0
  description: HTTP API for the OpenData Log service — an append-only, key-partitioned log.
servers:
  - url: http://localhost:3001
    description: Local development server
security: []
paths:
  /api/v1/log/count:
    get:
      summary: Count entries
      description: |
        Count the number of log entries for a given key within an optional
        sequence range.
      operationId: count
      parameters:
        - name: key
          in: query
          required: true
          description: Key to count (URL-encoded if it contains special characters).
          schema:
            type: string
        - name: start_seq
          in: query
          required: false
          description: Start sequence number (inclusive). Defaults to `0`.
          schema:
            type: integer
            format: uint64
            minimum: 0
        - name: end_seq
          in: query
          required: false
          description: End sequence number (exclusive). Defaults to `max uint64`.
          schema:
            type: integer
            format: uint64
            minimum: 0
      responses:
        '200':
          description: Entry count.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CountResponse'
              example:
                status: success
                count: 1024
        '400':
          description: Invalid input (e.g. missing `key` parameter).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CountResponse:
      type: object
      description: Response containing the count of entries for a key.
      properties:
        status:
          type: string
          example: success
        count:
          type: integer
          format: uint64
          description: Number of entries matching the query.
      required:
        - status
        - count
    ErrorResponse:
      type: object
      description: Error response returned for all error cases.
      properties:
        status:
          type: string
          example: error
        message:
          type: string
          description: Human-readable error message.
      required:
        - status
        - message

````