# Event logs APIs

### Get Event Logs by address, block number in range and topic

#### **URI**

<table data-header-hidden><thead><tr><th width="119"></th><th></th></tr></thead><tbody><tr><td><strong>network</strong></td><td><strong>uri</strong></td></tr><tr><td><em>Mainnet</em></td><td>GET https://explorerapi.wemix.com/v1/event-logs</td></tr><tr><td><em>Testnet</em></td><td>GET https://explorerapi.test.wemix.com/v1/event-logs</td></tr></tbody></table>

#### **REQUEST PARAMETER**

* **HEADER**

| **key**   | **value** | **required** |
| --------- | --------- | ------------ |
| *api-key* | api-key   | true         |

* **QUERY STRING**

<table data-header-hidden><thead><tr><th></th><th width="198"></th><th></th><th></th></tr></thead><tbody><tr><td><strong>key</strong></td><td><strong>type</strong></td><td><strong>value</strong></td><td><strong>required</strong></td></tr><tr><td><em>address</em></td><td>String</td><td>Contract address</td><td>true</td></tr><tr><td><em>limit</em></td><td>Number</td><td>Maximum number of record will retrieve                                               Default: 50, Max: 1000</td><td>false</td></tr><tr><td><em>offset</em></td><td>Number</td><td>Start retrieve record                                                Default: 0</td><td>false</td></tr><tr><td><em>start_block</em></td><td>Number</td><td><p>Get event logs from block number</p><p>Default: null</p></td><td>false</td></tr><tr><td><em>end_block</em></td><td>Number</td><td><p>Get event logs to block number</p><p>Default: null</p></td><td>false</td></tr><tr><td><em>type</em></td><td>String</td><td>Type of message call:<br>- single<br>- combine</td><td>false</td></tr><tr><td><em>topic_0</em></td><td>String</td><td>topic 0</td><td>true</td></tr><tr><td><em>topic_1</em></td><td>String</td><td>topic 1</td><td>false</td></tr><tr><td><em>topic_2</em></td><td>String</td><td>topic 2</td><td>false</td></tr><tr><td><em>topic_3</em></td><td>String</td><td>topic 3</td><td>false</td></tr><tr><td><em>operand</em></td><td>String</td><td>Type of query:                      - and                                          - or</td><td>false</td></tr></tbody></table>

#### **REQUEST SAMPLE**

```
GET https://explorerapi.wemix.com/v1/event-logs?address=0xeAD50432B7DCb8402208a65bc58951b8ccEF9F08
api-key: 1ba5e446edf1997f67b51bf9e60b3fbba6fa1bf84301115292805d7e24f43539
```

#### RESPONSE PARAMETER

<table data-header-hidden><thead><tr><th width="238"></th><th></th><th></th></tr></thead><tbody><tr><td><strong>key</strong></td><td><strong>type</strong></td><td><strong>value</strong></td></tr><tr><td><em>status</em></td><td>String</td><td>Status of request</td></tr><tr><td><em>message</em></td><td>String</td><td>Message of request</td></tr><tr><td><em>results</em></td><td>List&#x3C;Object></td><td>Results of request</td></tr><tr><td><em>results.count</em></td><td>String</td><td>Total count of event-log</td></tr><tr><td><em>results.data</em></td><td>List&#x3C;Object></td><td>List of data</td></tr><tr><td><em>results.data.timestamp</em></td><td>String</td><td>UTC time when the transaction occurred</td></tr><tr><td><em>results.data.address</em></td><td>String</td><td>Address that relate to this event log</td></tr><tr><td><em>results.data.data</em></td><td>String</td><td>Data of event log</td></tr><tr><td><em>results.data.method</em></td><td>String</td><td>Method of this event log</td></tr><tr><td><em>results.transaction_hash</em></td><td>String</td><td>Transaction hash</td></tr><tr><td><em>results.log_name</em></td><td>String</td><td>Name of log</td></tr><tr><td><em>results.log_abi</em></td><td>String</td><td>Abi of event_log</td></tr><tr><td><em>results.data.transaction_index</em></td><td>String</td><td>Index of transaction</td></tr><tr><td><em>results.data.log_index</em></td><td>String</td><td>Index of log</td></tr><tr><td><em>results.data.topics_count</em></td><td>String</td><td>Number of topic</td></tr><tr><td><em>results.data.topic_0</em></td><td>String</td><td>Value of topic 0</td></tr><tr><td><em>results.data.topic_1</em></td><td>String</td><td>Value of topic 1</td></tr><tr><td><em>results.data.topic_2</em></td><td>String</td><td>Value of topic 2</td></tr><tr><td><em>results.data.topic_3</em></td><td>String</td><td>Value of topic 3</td></tr></tbody></table>

#### **RESPONSE SAMPLE**

````
```json
{
    "status": "200",
    "message": "success",
    "results": {
        "count": "214201",
        "data": [
            {
                "timestamp": "2023-08-10T10:11:05Z",
                "address": "0xead50432b7dcb8402208a65bc58951b8ccef9f08",
                "data": "0x0000000000000000000000009c2d3bb8565c2fc4335c1068dd0b6ca60fb4ecab",
                "method": "0xcdb6c50f",
                "transaction_hash": "0x2098c1cf552111f2a55ea022d832a9bd7a73c5661e62881334aab6e56353bced",
                "log_name": null,
                "log_abi": null,
                "address_type": null,
                "address_extra": null,
                "transaction_index": "0",
                "log_index": "0",
                "topics_count": "1",
                "topic_0": "0xcdb6c50fc95430ac4511195bb0a3cb943f34705415ec82960792a7545a6850bb",
                "topic_1": null,
                "topic_2": null,
                "topic_3": null
            },
            ...
        ]
    }
}
````


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wemix.com/en/dapp-developer/api-reference/event-logs-apis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
