---
updatedAt: 2025-09-18T22:19:29.000Z
agentTools:
  projectIndex: https://docs.nodereal.io/llms.txt
---

# eth_getLogs

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

> 🚧 Block range limitation
>
> The response size for getLogs method would be different according to your block range:\
> Block range > 50K: Not available\
> Block range <= 100: No response size limit\
> Block range between 100 and 50K: Maximum 50K records would be responded\
> View error code description [here](https://docs.nodereal.io/docs/support)

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "eth_getLogs",
    "description": "Returns logs which are records that denote/provide context on specific events within a smart contract, like a token transfer or a change of ownership for example.",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://eth-mainnet.nodereal.io/v1"
    }
  ],
  "paths": {
    "/{apiKey}": {
      "post": {
        "operationId": "eth-getlogs",
        "summary": "eth_getLogs",
        "description": "Returns an array of all logs matching a given filter object.\n",
        "parameters": [
          {
            "name": "apiKey",
            "in": "path",
            "schema": {
              "type": "string",
              "default": "1659dfb40aa24bbb8153a677b98064d7"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "default": 1
                      },
                      "jsonrpc": {
                        "type": "string",
                        "default": "2.0"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "method": {
                        "type": "string",
                        "default": "eth_getLogs",
                        "enum": [
                          "eth_getLogs"
                        ]
                      },
                      "params": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 1,
                        "items": {
                          "type": "object",
                          "properties": {
                            "blockHash": {
                              "type": "string",
                              "description": "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."
                            },
                            "address": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              },
                              "description": "Contract address or a list of addresses from which logs should originate."
                            },
                            "fromBlock": {
                              "$ref": "#/paths/~1%7BapiKey%7D/post/requestBody/content/application~1json/schema/allOf/1/properties/params/items/properties/toBlock",
                              "default": "latest"
                            },
                            "toBlock": {
                              "default": "latest",
                              "type": "string",
                              "description": "String - Either the hex value of a **block number** OR One of the following **block tags**: \n  * `pending` - A sample next block built by the client on top of latest and containing the set of transactions usually taken from local mempool. Intuitively, you can think of these as blocks that have not been mined yet.\n  * `latest` - The most recent block in the canonical chain observed by the client, this block may be re-orged out of the canonical chain even under healthy/normal conditions.\n  * `safe` - The most recent crypto-economically secure block, cannot be re-orged outside of manual intervention driven by community coordination. Intuitively, this block is “unlikely” to be re-orged. **Only available on Ethereum Mainnet and Goerli**.\n  * `finalized` - The most recent crypto-economically secure block, that has been accepted by >2/3 of validators. Cannot be re-orged outside of manual intervention driven by community coordination. Intuitively, this block is very unlikely to be re-orged. **Only available on Ethereum Mainnet and Goerli**.\n  * `earliest` - The lowest numbered block the client has available. Intuitively, you can think of this as the first block created.\n",
                              "example": "finalized"
                            },
                            "topics": {
                              "type": "array",
                              "description": "Array of 32 Bytes DATA topics. Topics are order-dependent. Each topic can also be an array of DATA with \"or\" options.",
                              "items": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "x-readme": {
          "samples-languages": [
            "curl",
            "javascript",
            "python",
            "go"
          ]
        },
        "responses": {
          "200": {
            "description": "Returns array of log objects, or an empty array if nothing has changed since last poll.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "jsonrpc": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "properties": {
                        "result": {
                          "type": "array",
                          "description": "Array of log objects, or an empty array if nothing has changed since last poll.",
                          "items": {
                            "allOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "blockHash": {
                                    "type": "string",
                                    "description": "32 Bytes - hash of the block where this log was in. null when its pending. null when its pending log"
                                  },
                                  "blockNumber": {
                                    "type": "string",
                                    "description": "The block number where this log was in. null when its pending. null when its pending log."
                                  },
                                  "transactionIndex": {
                                    "type": "string",
                                    "description": "Integer of the transactions index position log was created from. null when its pending log."
                                  }
                                }
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "address": {
                                    "type": "string",
                                    "description": "20 Bytes - address from which this log originated."
                                  },
                                  "logIndex": {
                                    "type": "string",
                                    "description": "Integer of the log index position in the block. null when its pending log."
                                  },
                                  "data": {
                                    "type": "string",
                                    "description": "Contains one or more 32 Bytes non-indexed arguments of the log."
                                  },
                                  "removed": {
                                    "type": "boolean",
                                    "description": "true when the log was removed, due to a chain reorganization. false if its a valid log."
                                  },
                                  "topics": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    },
                                    "description": "Array of zero to four 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 declare the event with the anonymous specifier."
                                  },
                                  "transactionHash": {
                                    "type": "string",
                                    "description": "Hash of the transactions this log was created from. null when its pending log."
                                  }
                                }
                              }
                            ]
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```