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

# eth_getLogs

Returns an array of all logs matching a given filter object.

### Body

<ParamField body="id" type="number" placeholder="1">
  Serves as a unique identifier for the request
</ParamField>

<ParamField body="jsonrpc" type="string" placeholder="2.0">
  Indicates the version of JSON-RPC being used
</ParamField>

<ParamField body="method" type="string" placeholder="eth_getLogs">
  Represents the name of the remote procedure or method to be called
</ParamField>

<ParamField body="params" type="array">
  Contains the list of parameters passed to the remote method.

  <Expandable title="params">
    <ParamField body="fromBlock" type="string or number">
      (optional, default: "latest")Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined
      transactions.
    </ParamField>

    <ParamField body="toBlock" type="string or number">
      (optional, default: "latest")Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined
      transactions.
    </ParamField>

    <ParamField body="address" type="string or array">
      20 Bytes - (optional) Contract address or a list of addresses from which logs should originate.
    </ParamField>

    <ParamField body="topics" type="array">
      (Optional) Array of 32 Bytes DATA topics. Topics are order-dependent. Each topic can also be an array of
      DATA with "or" options.
    </ParamField>

    <ParamField body="blockhash" type="string">
      32 Bytes - (optional, future) With the addition of EIP-234, blockHash will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to fromBlock = toBlock = the block number with hash blockHash. If blockHash is present in the filter criteria, then neither fromBlock nor toBlock are allowed.
    </ParamField>
  </Expandable>
</ParamField>

### Response

<ResponseField name="id" type="number">
  Returns unique identifier for the request
</ResponseField>

<ResponseField name="jsonrpc" type="string">
  Returns the version of JSON-RPC being used.
</ResponseField>

<ResponseField name="result" type="array">
  For filters created with eth\_newBlockFilter the return are block hashes (DATA, 32 Bytes), e.g. \["0x3454645634534..."].

  For filters created with eth\_newPendingTransactionFilter the return are transaction hashes (DATA, 32 Bytes), e.g. \["0x6345343454645..."].

  For filters created with eth\_newFilter logs are objects with following params:

  <Expandable title="Log objects">
    <ResponseField name="logIndex" type="string">
      Integer of the log index position in the block. null when its pending log.
    </ResponseField>

    <ResponseField name="removed" type="bool">
      True when the log was removed, due to a chain reorganization. false if its a valid log.
    </ResponseField>

    <ResponseField name="transactionIndex" type="string">
      Integer of the transactions index position log was created from. null when its pending log.
    </ResponseField>

    <ResponseField name="transactionHash" type="string">
      32 Bytes - hash of the transactions this log was created from. null when its pending log.
    </ResponseField>

    <ResponseField name="blockHash" type="string">
      32 Bytes - hash of the block where this log was in. null when its pending. null when its pending log.
    </ResponseField>

    <ResponseField name="blockNumber" type="string">
      The block number where this log was in. null when its pending. null when its pending log.
    </ResponseField>

    <ResponseField name="address" type="string">
      20 Bytes - address from which this log originated.
    </ResponseField>

    <ResponseField name="data" type="string">
      Contains one or more 32 Bytes non-indexed arguments of the log.
    </ResponseField>

    <ResponseField name="topics" type="array">
      Array of 0 to 4 32 Bytes DATA of indexed log arguments. (In solidity: The first topic is the hash of the signature of the event (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.)
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash Example Request theme={null}
  curl - 'https://rpc1.aries.axiomesh.io' \
  --header 'Content-Type: application/json' \
  --data '{
      "jsonrpc": "2.0",
      "method": "eth_getLogs",
      "params": [ {
              "topics":[
                  "0xf9fbd55454309325ccadd998a641a1dfe7cd888eea26c0ae93b95992a13ac144"
              ]
          }],
      "id": 1
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
      {
          "address": "0x4cd8ee4fc57c51d8af5b6b6a08cc441f2b4fcbfe",
          "topics": [
              "0xf9fbd55454309325ccadd998a641a1dfe7cd888eea26c0ae93b95992a13ac144"
          ],
          "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000047465737400000000000000000000000000000000000000000000000000000000",
          "blockNumber": "0x3",
          "transactionHash": "0x8c292190c6449c5897e0b1b5ac0b7d61b76f554d3cf9aa3e7490cb84f274d844",
          "transactionIndex": "0x0",
          "blockHash": "0xf922bf9ef8548c06e7744b684527a0bbef1adb1617fed50a3c67251ded62e619",
          "logIndex": "0x0",
          "removed": false
      }
  ]
  }
  ```
</ResponseExample>
