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

# Get Block Logs

> Get all logs in a block



## OpenAPI

````yaml GET /api/v1/customer/{chain}/blocks/logs
openapi: 3.1.0
info:
  title: SonarX EVM API - Logs
  description: Query event logs emitted by smart contracts on EVM-compatible networks.
  version: 1.0.0
servers:
  - url: https://api-gateway.sonarx.com
    description: Production API
security:
  - apiKey: []
tags:
  - name: Logs
    description: Query event logs emitted by smart contracts
paths:
  /api/v1/customer/{chain}/blocks/logs:
    get:
      tags:
        - Logs
      summary: Get Block Logs
      description: Get all logs (events) emitted in a block.
      operationId: getBlockLogs
      parameters:
        - $ref: '#/components/parameters/ChainPath'
        - name: block_number
          in: query
          description: Block number to query (>= 0)
          required: true
          schema:
            type: integer
            minimum: 0
            example: 81901165
        - name: address
          in: query
          description: Filter by contract address (42 character hex string)
          required: false
          schema:
            type: string
            pattern: ^0x[a-fA-F0-9]{40}$
            example: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Offset'
      responses:
        '200':
          description: Block logs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BlockLogsResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    ChainPath:
      name: chain
      in: path
      description: The blockchain network to query
      required: true
      schema:
        type: string
        enum:
          - polygon
        example: polygon
    Limit:
      name: limit
      in: query
      description: Maximum number of results (1-50)
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 50
        default: 10
    Offset:
      name: offset
      in: query
      description: Number of results to skip for pagination
      required: false
      schema:
        type: integer
        minimum: 0
        default: 0
  schemas:
    BlockLogsResponse:
      type: object
      properties:
        block_number:
          type: integer
        offset:
          type: integer
        limit:
          type: integer
        result:
          type: array
          items:
            $ref: '#/components/schemas/Log'
        count:
          type: integer
      example:
        block_number: 81901165
        offset: 0
        limit: 10
        result:
          - block_number: 81901165
            timestamp: 1768922302
            datetime: '2026-01-20T15:18:22'
            transaction_hash: '0x6a9cb0071fe44d7cf50962bc9ea05dfe45662d34c71f4f8b12fb3918f62f9692'
            transaction_index: 0
            transaction_from: '0x17fc3813d8761eab20e8d16ba7d38b92547dec91'
            transaction_to: '0x4eb48fecfb61873809270972f7d9d5a90c23752d'
            log_index: 0
            address: '0x0000000000000000000000000000000000001010'
            data: '0x00000000000000000000000000000000000000000000000001157946f3885900'
            topics:
              - >-
                0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63
              - >-
                0x0000000000000000000000000000000000000000000000000000000000001010
              - >-
                0x00000000000000000000000017fc3813d8761eab20e8d16ba7d38b92547dec91
              - >-
                0x0000000000000000000000007ee41d8a25641000661b1ef5e6ae8a00400466b0
            topic1: '0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63'
            topic2: '0x0000000000000000000000000000000000000000000000000000000000001010'
            topic3: '0x00000000000000000000000017fc3813d8761eab20e8d16ba7d38b92547dec91'
            topic4: '0x0000000000000000000000007ee41d8a25641000661b1ef5e6ae8a00400466b0'
            version: 0
        count: 1
    Log:
      type: object
      properties:
        block_number:
          type: integer
          description: Block number
        timestamp:
          type: integer
          description: Unix timestamp
        datetime:
          type: string
          format: date-time
        transaction_hash:
          type: string
          description: Transaction hash that emitted this log
        transaction_index:
          type: integer
        transaction_from:
          type: string
          description: Transaction sender
        transaction_to:
          type: string
          description: Transaction recipient
        log_index:
          type: integer
          description: Index of the log within the transaction
        address:
          type: string
          description: Contract address that emitted this log
        data:
          type: string
          description: Non-indexed event data
        topics:
          type: array
          items:
            type: string
          description: Indexed event topics
        topic1:
          type: string
          description: First topic (event signature hash)
        topic2:
          type: string
          nullable: true
        topic3:
          type: string
          nullable: true
        topic4:
          type: string
          nullable: true
        version:
          type: integer
      example:
        block_number: 81901160
        timestamp: 1768922292
        datetime: '2026-01-20T15:18:12'
        transaction_hash: '0x00dcc066aad65ae4f10c0fc4ec1fac5d3693c12c01d98a9f6a87448be9b26200'
        transaction_index: 66
        transaction_from: '0xef56899ed9b6b4f3b8d0ea4eb7cec948705c8d2c'
        transaction_to: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359'
        log_index: 366
        address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359'
        data: '0x000000000000000000000000000000000000000000000000000000000050df20'
        topics:
          - '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
          - '0x000000000000000000000000ef56899ed9b6b4f3b8d0ea4eb7cec948705c8d2c'
          - '0x0000000000000000000000003cb9cc9869a65db10f47fd40fb977331cc7e3c9b'
        topic1: '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
        topic2: '0x000000000000000000000000ef56899ed9b6b4f3b8d0ea4eb7cec948705c8d2c'
        topic3: '0x0000000000000000000000003cb9cc9869a65db10f47fd40fb977331cc7e3c9b'
        topic4: null
        version: 0
    ErrorResponse:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: apikey
      description: API key for authentication

````