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

# Get Event Logs by Address and/or Topic(s)

> Event logs for an address and topic. Use and/or with the topic operator to specify
topic retrieval options when adding multiple topics. Up to a maximum of 1,000 event logs.

Required:
- `fromBlock` and `toBlock`
- At least one of `address`, `topic0`, `topic1`, `topic2`, `topic3`
- If any pair of topic parameters is set, the corresponding `topicA_B_opr` is required.




## OpenAPI

````yaml /openapi-specs/pro-api-v11.yaml get /legacy/logs/get-logs
openapi: 3.0.0
info:
  contact:
    email: info@blockscout.com
  title: Blockscout
  version: 11.0.3
servers:
  - url: http://localhost/api
    variables: {}
security: []
tags:
  - name: blocks
  - name: transactions
  - name: addresses
  - name: internal-transactions
  - name: tokens
  - name: token-transfers
  - name: smart-contracts
  - name: config
  - name: main-page
  - name: search
  - name: stats
  - name: csv-export
  - name: account-abstraction
  - name: withdrawals
  - name: advanced-filters
  - name: arbitrum
  - name: legacy
  - name: optimism
  - name: mud
  - name: celo
  - name: scroll
  - name: zilliqa
paths:
  /legacy/logs/get-logs:
    get:
      tags:
        - legacy
      summary: Get Event Logs by Address and/or Topic(s)
      description: >
        Event logs for an address and topic. Use and/or with the topic operator
        to specify

        topic retrieval options when adding multiple topics. Up to a maximum of
        1,000 event logs.


        Required:

        - `fromBlock` and `toBlock`

        - At least one of `address`, `topic0`, `topic1`, `topic2`, `topic3`

        - If any pair of topic parameters is set, the corresponding
        `topicA_B_opr` is required.
      operationId: BlockScoutWeb.API.Legacy.LogsController.get_logs
      parameters:
        - description: 'Start block: integer or the sentinel "latest"'
          in: query
          name: fromBlock
          schema:
            anyOf:
              - $ref: '#/components/schemas/IntegerString'
              - enum:
                  - latest
                type: string
                x-struct: null
                x-validate: null
            x-struct: null
            x-validate: null
        - description: 'End block: integer or the sentinel "latest"'
          in: query
          name: toBlock
          schema:
            anyOf:
              - $ref: '#/components/schemas/IntegerString'
              - enum:
                  - latest
                type: string
                x-struct: null
                x-validate: null
            x-struct: null
            x-validate: null
        - in: query
          name: address
          schema:
            $ref: '#/components/schemas/AddressHash'
        - in: query
          name: topic0
          schema:
            pattern: ^0x[0-9a-fA-F]{64}$
            type: string
            x-struct: null
            x-validate: null
        - in: query
          name: topic1
          schema:
            pattern: ^0x[0-9a-fA-F]{64}$
            type: string
            x-struct: null
            x-validate: null
        - in: query
          name: topic2
          schema:
            pattern: ^0x[0-9a-fA-F]{64}$
            type: string
            x-struct: null
            x-validate: null
        - in: query
          name: topic3
          schema:
            pattern: ^0x[0-9a-fA-F]{64}$
            type: string
            x-struct: null
            x-validate: null
        - in: query
          name: topic0_1_opr
          schema:
            enum:
              - and
              - or
            type: string
            x-struct: null
            x-validate: null
        - in: query
          name: topic0_2_opr
          schema:
            enum:
              - and
              - or
            type: string
            x-struct: null
            x-validate: null
        - in: query
          name: topic0_3_opr
          schema:
            enum:
              - and
              - or
            type: string
            x-struct: null
            x-validate: null
        - in: query
          name: topic1_2_opr
          schema:
            enum:
              - and
              - or
            type: string
            x-struct: null
            x-validate: null
        - in: query
          name: topic1_3_opr
          schema:
            enum:
              - and
              - or
            type: string
            x-struct: null
            x-validate: null
        - in: query
          name: topic2_3_opr
          schema:
            enum:
              - and
              - or
            type: string
            x-struct: null
            x-validate: null
        - description: API key for rate limiting or for sensitive endpoints
          in: query
          name: apikey
          required: false
          schema:
            type: string
            x-struct: null
            x-validate: null
        - description: Secret key for getting access to restricted resources
          in: query
          name: key
          required: false
          schema:
            type: string
            x-struct: null
            x-validate: null
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  message:
                    description: >-
                      Human-readable status string — `OK` on success, a
                      descriptive error message otherwise.
                    type: string
                    x-struct: null
                    x-validate: null
                  result:
                    allOf:
                      - items:
                          $ref: '#/components/schemas/LogItem'
                        nullable: true
                        type: array
                        x-struct: null
                        x-validate: null
                    description: Endpoint-specific payload on success; `null` on error.
                    nullable: true
                    x-struct: null
                    x-validate: null
                  status:
                    description: '`1` = OK, `0` = error, `2` = pending.'
                    enum:
                      - '0'
                      - '1'
                      - '2'
                    type: string
                    x-struct: null
                    x-validate: null
                required:
                  - status
                  - message
                  - result
                type: object
                x-struct: null
                x-validate: null
          description: Event logs
      callbacks: {}
components:
  schemas:
    IntegerString:
      nullable: false
      pattern: ^-?([1-9][0-9]*|0)$
      title: IntegerString
      type: string
      x-struct: Elixir.BlockScoutWeb.Schemas.API.V2.General.IntegerString
      x-validate: null
    AddressHash:
      nullable: false
      pattern: ^0x([A-Fa-f0-9]{40})$
      title: AddressHash
      type: string
      x-struct: Elixir.BlockScoutWeb.Schemas.API.V2.General.AddressHash
      x-validate: null
    LogItem:
      additionalProperties: false
      properties:
        address:
          $ref: '#/components/schemas/AddressHash'
        blockNumber:
          description: Hex-encoded block number.
          pattern: ^0x[0-9a-fA-F]+$
          type: string
          x-struct: null
          x-validate: null
        data:
          description: Hex-encoded event data payload (`0x`-prefixed, arbitrary length).
          pattern: ^0x[0-9a-fA-F]*$
          type: string
          x-struct: null
          x-validate: null
        gasPrice:
          description: Hex-encoded gas price in wei.
          pattern: ^0x[0-9a-fA-F]+$
          type: string
          x-struct: null
          x-validate: null
        gasUsed:
          description: Hex-encoded gas used by the transaction.
          pattern: ^0x[0-9a-fA-F]+$
          type: string
          x-struct: null
          x-validate: null
        logIndex:
          description: Hex-encoded position of the log within the block.
          pattern: ^0x[0-9a-fA-F]+$
          type: string
          x-struct: null
          x-validate: null
        timeStamp:
          description: Hex-encoded Unix timestamp in seconds of the block.
          pattern: ^0x[0-9a-fA-F]+$
          type: string
          x-struct: null
          x-validate: null
        topics:
          description: >-
            32-byte indexed event topics. Always a 4-element array; unfilled
            slots are `null`.
          items:
            nullable: true
            pattern: ^0x[0-9a-fA-F]{64}$
            type: string
            x-struct: null
            x-validate: null
          maxItems: 4
          minItems: 4
          type: array
          x-struct: null
          x-validate: null
        transactionHash:
          $ref: '#/components/schemas/FullHash'
        transactionIndex:
          description: Hex-encoded position of the transaction within the block.
          pattern: ^0x[0-9a-fA-F]+$
          type: string
          x-struct: null
          x-validate: null
      required:
        - address
        - topics
        - data
        - blockNumber
        - timeStamp
        - gasPrice
        - gasUsed
        - logIndex
        - transactionHash
        - transactionIndex
      title: LogItem
      type: object
      x-struct: Elixir.BlockScoutWeb.Schemas.API.Legacy.LogItem
      x-validate: null
    FullHash:
      nullable: false
      pattern: ^0x([A-Fa-f0-9]{64})$
      title: FullHash
      type: string
      x-struct: Elixir.BlockScoutWeb.Schemas.API.V2.General.FullHash
      x-validate: null

````