Skip to main content
GET
/
legacy
/
logs
/
get-logs
Get Event Logs by Address and/or Topic(s)
curl --request GET \
  --url http://localhost/api/legacy/logs/get-logs
{
  "message": "<string>",
  "result": [
    {
      "address": "<string>",
      "blockNumber": "<string>",
      "data": "<string>",
      "gasPrice": "<string>",
      "gasUsed": "<string>",
      "logIndex": "<string>",
      "timeStamp": "<string>",
      "topics": [
        "<string>"
      ],
      "transactionHash": "<string>",
      "transactionIndex": "<string>"
    }
  ],
  "status": "0"
}

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.

Query Parameters

fromBlock

Start block: integer or the sentinel "latest"

Pattern: ^-?([1-9][0-9]*|0)$
toBlock

End block: integer or the sentinel "latest"

Pattern: ^-?([1-9][0-9]*|0)$
address
string
Pattern: ^0x([A-Fa-f0-9]{40})$
topic0
string
Pattern: ^0x[0-9a-fA-F]{64}$
topic1
string
Pattern: ^0x[0-9a-fA-F]{64}$
topic2
string
Pattern: ^0x[0-9a-fA-F]{64}$
topic3
string
Pattern: ^0x[0-9a-fA-F]{64}$
topic0_1_opr
enum<string>
Available options:
and,
or
topic0_2_opr
enum<string>
Available options:
and,
or
topic0_3_opr
enum<string>
Available options:
and,
or
topic1_2_opr
enum<string>
Available options:
and,
or
topic1_3_opr
enum<string>
Available options:
and,
or
topic2_3_opr
enum<string>
Available options:
and,
or
apikey
string

API key for rate limiting or for sensitive endpoints

key
string

Secret key for getting access to restricted resources

Response

200 - application/json

Event logs

message
string
required

Human-readable status string — OK on success, a descriptive error message otherwise.

result
LogItem · object[] · null · null
required

Endpoint-specific payload on success; null on error.

status
enum<string>
required

1 = OK, 0 = error, 2 = pending.

Available options:
0,
1,
2