Get Event Logs by Address
curl --request GET \
--url 'https://api.etherscan.io/v2/api?apikey='import requests
url = "https://api.etherscan.io/v2/api?apikey="
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.etherscan.io/v2/api?apikey=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.etherscan.io/v2/api?apikey=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.etherscan.io/v2/api?apikey="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.etherscan.io/v2/api?apikey=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.etherscan.io/v2/api?apikey=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"status": "1",
"message": "OK",
"result": [
{
"address": "0xbd3531da5cf5857e7cfaa92426877b022e612cf8",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000c45a4b3b698f21f88687548e7f5a80df8b99d93d",
"0x00000000000000000000000000000000000000000000000000000000000000b5"
],
"data": "0x",
"blockNumber": "0xc48174",
"blockHash": "0x837e109ab8b1b40ec7d1032bff82397325d85e719b97d900fa0d9aa9745b2c27",
"timeStamp": "0x60f9ce56",
"gasPrice": "0x2e90edd000",
"gasUsed": "0x247205",
"logIndex": "0x",
"transactionHash": "0x4ffd22d986913d33927a392fe4319bcd2b62f3afe1c15a2c59f77fc2cc4c20a9",
"transactionIndex": "0x"
},
{
"address": "0xbd3531da5cf5857e7cfaa92426877b022e612cf8",
"topics": [
"0x645f26e653c951cec836533f8fe0616d301c20a17153debc17d7c3dbe4f32b28",
"0x00000000000000000000000000000000000000000000000000000000000000b5"
],
"data": "0x",
"blockNumber": "0xc48174",
"blockHash": "0x837e109ab8b1b40ec7d1032bff82397325d85e719b97d900fa0d9aa9745b2c27",
"timeStamp": "0x60f9ce56",
"gasPrice": "0x2e90edd000",
"gasUsed": "0x247205",
"logIndex": "0x1",
"transactionHash": "0x4ffd22d986913d33927a392fe4319bcd2b62f3afe1c15a2c59f77fc2cc4c20a9",
"transactionIndex": "0x"
}
]
}
Logs
Get Event Logs by Address
Retrieves event logs from a specific address, with optional block range filtering.
GET
/
v2
/
api
Get Event Logs by Address
curl --request GET \
--url 'https://api.etherscan.io/v2/api?apikey='import requests
url = "https://api.etherscan.io/v2/api?apikey="
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.etherscan.io/v2/api?apikey=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.etherscan.io/v2/api?apikey=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.etherscan.io/v2/api?apikey="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.etherscan.io/v2/api?apikey=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.etherscan.io/v2/api?apikey=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"status": "1",
"message": "OK",
"result": [
{
"address": "0xbd3531da5cf5857e7cfaa92426877b022e612cf8",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000c45a4b3b698f21f88687548e7f5a80df8b99d93d",
"0x00000000000000000000000000000000000000000000000000000000000000b5"
],
"data": "0x",
"blockNumber": "0xc48174",
"blockHash": "0x837e109ab8b1b40ec7d1032bff82397325d85e719b97d900fa0d9aa9745b2c27",
"timeStamp": "0x60f9ce56",
"gasPrice": "0x2e90edd000",
"gasUsed": "0x247205",
"logIndex": "0x",
"transactionHash": "0x4ffd22d986913d33927a392fe4319bcd2b62f3afe1c15a2c59f77fc2cc4c20a9",
"transactionIndex": "0x"
},
{
"address": "0xbd3531da5cf5857e7cfaa92426877b022e612cf8",
"topics": [
"0x645f26e653c951cec836533f8fe0616d301c20a17153debc17d7c3dbe4f32b28",
"0x00000000000000000000000000000000000000000000000000000000000000b5"
],
"data": "0x",
"blockNumber": "0xc48174",
"blockHash": "0x837e109ab8b1b40ec7d1032bff82397325d85e719b97d900fa0d9aa9745b2c27",
"timeStamp": "0x60f9ce56",
"gasPrice": "0x2e90edd000",
"gasUsed": "0x247205",
"logIndex": "0x1",
"transactionHash": "0x4ffd22d986913d33927a392fe4319bcd2b62f3afe1c15a2c59f77fc2cc4c20a9",
"transactionIndex": "0x"
}
]
}
{
"status": "1",
"message": "OK",
"result": [
{
"address": "0xbd3531da5cf5857e7cfaa92426877b022e612cf8",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000c45a4b3b698f21f88687548e7f5a80df8b99d93d",
"0x00000000000000000000000000000000000000000000000000000000000000b5"
],
"data": "0x",
"blockNumber": "0xc48174",
"blockHash": "0x837e109ab8b1b40ec7d1032bff82397325d85e719b97d900fa0d9aa9745b2c27",
"timeStamp": "0x60f9ce56",
"gasPrice": "0x2e90edd000",
"gasUsed": "0x247205",
"logIndex": "0x",
"transactionHash": "0x4ffd22d986913d33927a392fe4319bcd2b62f3afe1c15a2c59f77fc2cc4c20a9",
"transactionIndex": "0x"
},
{
"address": "0xbd3531da5cf5857e7cfaa92426877b022e612cf8",
"topics": [
"0x645f26e653c951cec836533f8fe0616d301c20a17153debc17d7c3dbe4f32b28",
"0x00000000000000000000000000000000000000000000000000000000000000b5"
],
"data": "0x",
"blockNumber": "0xc48174",
"blockHash": "0x837e109ab8b1b40ec7d1032bff82397325d85e719b97d900fa0d9aa9745b2c27",
"timeStamp": "0x60f9ce56",
"gasPrice": "0x2e90edd000",
"gasUsed": "0x247205",
"logIndex": "0x1",
"transactionHash": "0x4ffd22d986913d33927a392fe4319bcd2b62f3afe1c15a2c59f77fc2cc4c20a9",
"transactionIndex": "0x"
}
]
}
Authorizations
Enter your Etherscan API key, or set one up if you don't have one.
Query Parameters
Chain ID to query, eg 1 for Ethereum, 42161 for Arbitrum from our supported chains.
Set to logs for this endpoint.
Set to getLogs for this endpoint.
Address to check for logs.
Starting block number to search from.
Ending block number to search to.
Page number for pagination.
Number of records per page. Use the page parameter for subsequent records.
Response
200 - application/json
Successful response
1 if the request returned data, 0 otherwise. A status of 0 can indicate an error or a valid request that returned no records.
OK on success, otherwise an error description such as NOTOK. See common error messages.
Show child attributes
Show child attributes