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

# eth_getLogs

> Returns logs matching a filter object

## Parameters

<ParamField body="filter" type="object" required>
  Filter options

  <Expandable title="properties">
    <ParamField body="fromBlock" type="string">
      Start block (hex), or `latest`, `earliest`, `pending`
    </ParamField>

    <ParamField body="toBlock" type="string">
      End block (hex), or `latest`, `earliest`, `pending`
    </ParamField>

    <ParamField body="address" type="string | array">
      Contract address or list of addresses
    </ParamField>

    <ParamField body="topics" type="array">
      Array of topic filters (32 bytes each). Use `null` for wildcard.
    </ParamField>

    <ParamField body="blockHash" type="string">
      Filter by specific block hash. Cannot use with fromBlock/toBlock.
    </ParamField>
  </Expandable>
</ParamField>

## Returns

<ParamField body="logs" type="array">
  Array of log objects

  <Expandable title="properties">
    <ParamField body="address" type="string">
      Address of log origin
    </ParamField>

    <ParamField body="topics" type="array">
      Array of indexed log arguments
    </ParamField>

    <ParamField body="data" type="string">
      Non-indexed arguments (hex)
    </ParamField>

    <ParamField body="blockNumber" type="string">
      Block number (hex)
    </ParamField>

    <ParamField body="transactionHash" type="string">
      Transaction hash
    </ParamField>

    <ParamField body="transactionIndex" type="string">
      Transaction index (hex)
    </ParamField>

    <ParamField body="blockHash" type="string">
      Block hash
    </ParamField>

    <ParamField body="logIndex" type="string">
      Log index in block (hex)
    </ParamField>

    <ParamField body="removed" type="boolean">
      `true` if removed due to reorg
    </ParamField>
  </Expandable>
</ParamField>

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://edge.goldsky.com/standard/evm/1?secret=YOUR_SECRET" \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"fromBlock": "latest", "toBlock": "latest", "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"}], "id": 1}'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://edge.goldsky.com/standard/evm/1?secret=YOUR_SECRET', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
    "jsonrpc": "2.0",
    "method": "eth_getLogs",
    "params": [
      {
        "fromBlock": "latest",
        "toBlock": "latest",
        "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
      }
    ],
    "id": 1
  })
  });
  const { result } = await response.json();
  console.log(result);
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://edge.goldsky.com/standard/evm/1?secret=YOUR_SECRET',
      json={
    "jsonrpc": "2.0",
    "method": "eth_getLogs",
    "params": [
      {
        "fromBlock": "latest",
        "toBlock": "latest",
        "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
      }
    ],
    "id": 1
  }
  )
  print(response.json()['result'])
  ```
</CodeGroup>
