eth_getTransactionByBlockNumberAndIndex
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{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0x13c5311a78b9a8790c58f1d0d0660226352a498cc98b06e1861f1967d3a9d1b4",
"blockNumber": "0xc6331d",
"from": "0xd1af036d589b6ebfbaa184b339a30d32ef611708",
"gas": "0x11170",
"gasPrice": "0x5b7e259a7",
"maxFeePerGas": "0x5b7e259a7",
"maxPriorityFeePerGas": "0x5b7e259a7",
"hash": "0xc7ef51f0bfe85eefbb1d4d88f5a39e82fbfc94987d8cbcb515f74d80b6e44902",
"input": "0x2d2da806000000000000000000000000d1af036d589b6ebfbaa184b339a30d32ef611708",
"nonce": "0x0",
"to": "0xabea9132b05a70803a4e85094fd0e1800777fbef",
"transactionIndex": "0x11a",
"value": "0x57930b5db6a000",
"type": "0x2",
"accessList": [],
"chainId": "0x1",
"v": "0x0",
"r": "0x595619be17755f7427d07626275e4c89b8f9d5a0a668515165ea000d30f26325",
"s": "0x33d4b22c7c779fc9f04c81788cb4268d2c3f8dc9e219245570bdd384c6ca6690",
"yParity": "0x0"
}
}
Geth/Parity Proxy
eth_getTransactionByBlockNumberAndIndex
Get transaction details by block number and index.
GET
/
v2
/
api
eth_getTransactionByBlockNumberAndIndex
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{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0x13c5311a78b9a8790c58f1d0d0660226352a498cc98b06e1861f1967d3a9d1b4",
"blockNumber": "0xc6331d",
"from": "0xd1af036d589b6ebfbaa184b339a30d32ef611708",
"gas": "0x11170",
"gasPrice": "0x5b7e259a7",
"maxFeePerGas": "0x5b7e259a7",
"maxPriorityFeePerGas": "0x5b7e259a7",
"hash": "0xc7ef51f0bfe85eefbb1d4d88f5a39e82fbfc94987d8cbcb515f74d80b6e44902",
"input": "0x2d2da806000000000000000000000000d1af036d589b6ebfbaa184b339a30d32ef611708",
"nonce": "0x0",
"to": "0xabea9132b05a70803a4e85094fd0e1800777fbef",
"transactionIndex": "0x11a",
"value": "0x57930b5db6a000",
"type": "0x2",
"accessList": [],
"chainId": "0x1",
"v": "0x0",
"r": "0x595619be17755f7427d07626275e4c89b8f9d5a0a668515165ea000d30f26325",
"s": "0x33d4b22c7c779fc9f04c81788cb4268d2c3f8dc9e219245570bdd384c6ca6690",
"yParity": "0x0"
}
}
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0x13c5311a78b9a8790c58f1d0d0660226352a498cc98b06e1861f1967d3a9d1b4",
"blockNumber": "0xc6331d",
"from": "0xd1af036d589b6ebfbaa184b339a30d32ef611708",
"gas": "0x11170",
"gasPrice": "0x5b7e259a7",
"maxFeePerGas": "0x5b7e259a7",
"maxPriorityFeePerGas": "0x5b7e259a7",
"hash": "0xc7ef51f0bfe85eefbb1d4d88f5a39e82fbfc94987d8cbcb515f74d80b6e44902",
"input": "0x2d2da806000000000000000000000000d1af036d589b6ebfbaa184b339a30d32ef611708",
"nonce": "0x0",
"to": "0xabea9132b05a70803a4e85094fd0e1800777fbef",
"transactionIndex": "0x11a",
"value": "0x57930b5db6a000",
"type": "0x2",
"accessList": [],
"chainId": "0x1",
"v": "0x0",
"r": "0x595619be17755f7427d07626275e4c89b8f9d5a0a668515165ea000d30f26325",
"s": "0x33d4b22c7c779fc9f04c81788cb4268d2c3f8dc9e219245570bdd384c6ca6690",
"yParity": "0x0"
}
}
Authorizations
Your Etherscan API key.
Query Parameters
Chain ID to query, eg 1 for Ethereum, 8453 for Base from our supported chains.
Set to proxy for this endpoint.
Set to eth_getTransactionByBlockNumberAndIndex for this endpoint.
Block number in hex format.
Transaction index position in the block, in hex.
⌘I