Contracts API

Event logs brief: counts per event and the newest logs of a contract

How many logs a contract emitted in a block range, which events, and the newest five in full, undecoded. A few KB.

GET/api/external/contract-analysis/event-logs-brief/{chain}/{address}

What it returns

The brief of event-logs; prefer it unless you need every log. Same chains, parameters and 400s. It counts the logs, gives the first and last block and time, the 10 event signatures (topics[0]) with the most logs, and the 5 newest logs in full, undecoded. truncated is the full answer's: when true the counts are of the rows it listed.

Chains

  • BNB Chain BNB
  • Ethereum ETH
  • Stable STABLE
  • Base BASE
  • Robinhood Chain RHC
  • Arc ARC
  • Scroll SCROLL

Request

Send your key in the x-dex-data-key header. Replace each <placeholder> with a real value.

curl -H "x-dex-data-key: $DEXDATA_API_KEY" \
  "https://api.dexdata.io/api/external/contract-analysis/event-logs-brief/BNB/<address>?fromBlock=<fromBlock>&toBlock=<toBlock>"
Parameters
ParameterDescription
fromBlock

query · integer · required

Range start, inclusive.
toBlock

query · integer · required

Range end, inclusive.
topic0

query · string · optional

Event signature hash, 0x + 64 hex.
topic1

query · string · optional

topic2

query · string · optional

topic3

query · string · optional

chain

path · string · required

ETH, BNB, BASE, STABLE, RHC, ARC and SCROLL; every other chain returns 400.
address

path · string · required

The contract address that emitted the logs.

Response fields

A JSON response. Every field is always present; null means the value could not be established, never zero.

Response fields of Event logs brief: counts per event and the newest logs of a contract
FieldTypeDescription
truncatedbooleanThe full answer's: true when it hit its row cap, so more logs match and the counts are of the rows listed.
logCountintegerLogs in the full answer.
firstBlockinteger | nullBlock of the oldest log listed; null when none.
lastBlockinteger | nullBlock of the newest log listed; null when none.
firstAtinteger | nullWhen the oldest log's block was mined, Unix seconds; null when unknown or none.
lastAtinteger | nullWhen the newest log's block was mined, Unix seconds; null when unknown or none.
eventsobject[]Up to 10 event signatures, most logs first.
events[].topic0string | nullThe event signature hash; null for an anonymous event.
events[].logsintegerLogs listed with it.
latestobject[]The 5 newest logs, oldest first, each exactly as the full answer lists it.
latest[].addressstring | null
latest[].topicsstring[]topics[0] is the event signature hash; the rest are indexed arguments.
latest[].datastring | nullRaw ABI-encoded, non-indexed arguments. NOT decoded.
latest[].blockinteger | null
latest[].blockHashstring | null
latest[].atinteger | nullUnix SECONDS. Always null on RHC and SCROLL.
latest[].gasPriceRawstring | nullRAW wei, decimal string. Always null on RHC, ARC and SCROLL.
latest[].gasUsedRawstring | nullRAW wei, decimal string. Always null on RHC, ARC and SCROLL.
latest[].logIndexinteger | null
latest[].transactionHashstring | null
latest[].transactionIndexinteger | nullAlways null on SCROLL.

Start building with DexData today

Sign in, create a key and make your first call in a minute. Free credits every month, and you only pay for calls that succeed.

Get a free API key