Skip to main content
GET
/
?module=logs&action=getLogs
Get Event Logs by Address/Topics/Block Range
curl --request GET \
  --url 'https://eth.blockscout.com/api/?apikey=&module=logs&action=getLogs'
{
  "status": "1",
  "message": "OK",
  "result": [
    {
      "address": "0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae",
      "topics": [
        "<string>"
      ],
      "data": "<string>",
      "blockNumber": "<string>",
      "timeStamp": "<string>",
      "gasPrice": "<string>",
      "gasUsed": "<string>",
      "logIndex": "<string>",
      "transactionHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
      "transactionIndex": "<string>"
    }
  ]
}

Authorizations

apikey
string
query
required

Optional API key for increased rate limits.

Without API key:

  • 5 requests per second (shared pool)
  • No registration required

With API key:

  • 10 requests per second per key
  • Up to 3 free keys per account
  • Get your API key at https://blockscout.com (login required)

Usage: Add apikey=YOUR_KEY to any request query string.

Query Parameters

module
enum<string>
required

Module name (must be 'logs')

Available options:
logs
action
enum<string>
required
Available options:
getLogs
fromBlock
string
required

Starting block number or 'latest'

toBlock
string
required

Ending block number or 'latest'

address
string

Contract address (address and/or topic is required) 40-character hexadecimal address hash with 0x prefix

Example:

"0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae"

topic0
string

First topic (topic and/or address is required)

topic1
string

Second topic

topic2
string

Third topic

topic3
string

Fourth topic

topic0_1_opr
enum<string>

Operator for topic0 and topic1

Available options:
and,
or
topic0_2_opr
enum<string>

Operator for topic0 and topic2

Available options:
and,
or
topic0_3_opr
enum<string>

Operator for topic0 and topic3

Available options:
and,
or
topic1_2_opr
enum<string>

Operator for topic1 and topic2

Available options:
and,
or
topic1_3_opr
enum<string>

Operator for topic1 and topic3

Available options:
and,
or
topic2_3_opr
enum<string>

Operator for topic2 and topic3

Available options:
and,
or

Response

200 - application/json

Event logs retrieved successfully

status
enum<string>

Status code (1 = OK)

Available options:
1
message
string

Response message

Example:

"OK"

result
object[]