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.
/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>"
| Parameter | Description |
|---|---|
fromBlockquery · integer · required | Range start, inclusive. |
toBlockquery · integer · required | Range end, inclusive. |
topic0query · string · optional | Event signature hash, 0x + 64 hex. |
topic1query · string · optional | |
topic2query · string · optional | |
topic3query · string · optional | |
chainpath · string · required | ETH, BNB, BASE, STABLE, RHC, ARC and SCROLL; every other chain returns 400. |
addresspath · 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.
| Field | Type | Description |
|---|---|---|
truncated | boolean | The full answer's: true when it hit its row cap, so more logs match and the counts are of the rows listed. |
logCount | integer | Logs in the full answer. |
firstBlock | integer | null | Block of the oldest log listed; null when none. |
lastBlock | integer | null | Block of the newest log listed; null when none. |
firstAt | integer | null | When the oldest log's block was mined, Unix seconds; null when unknown or none. |
lastAt | integer | null | When the newest log's block was mined, Unix seconds; null when unknown or none. |
events | object[] | Up to 10 event signatures, most logs first. |
events[].topic0 | string | null | The event signature hash; null for an anonymous event. |
events[].logs | integer | Logs listed with it. |
latest | object[] | The 5 newest logs, oldest first, each exactly as the full answer lists it. |
latest[].address | string | null | |
latest[].topics | string[] | topics[0] is the event signature hash; the rest are indexed arguments. |
latest[].data | string | null | Raw ABI-encoded, non-indexed arguments. NOT decoded. |
latest[].block | integer | null | |
latest[].blockHash | string | null | |
latest[].at | integer | null | Unix SECONDS. Always null on RHC and SCROLL. |
latest[].gasPriceRaw | string | null | RAW wei, decimal string. Always null on RHC, ARC and SCROLL. |
latest[].gasUsedRaw | string | null | RAW wei, decimal string. Always null on RHC, ARC and SCROLL. |
latest[].logIndex | integer | null | |
latest[].transactionHash | string | null | |
latest[].transactionIndex | integer | null | Always 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