eth_getTransactionByHash
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": "0xf850331061196b8f2b67e1f43aaa9e69504c059d3d3fb9547b04f9ed4d141ab7",
"blockNumber": "0xcf2420",
"from": "0x00192fb10df37c9fb26829eb2cc623cd1bf599e8",
"gas": "0x5208",
"gasPrice": "0x19f017ef49",
"maxFeePerGas": "0x1f6ea08600",
"maxPriorityFeePerGas": "0x3b9aca00",
"hash": "0xbc78ab8a9e9a0bca7d0321a27b2c03addeae08ba81ea98b03cd3dd237eabed44",
"input": "0x",
"nonce": "0x33b79d",
"to": "0xc67f4e626ee4d3f272c2fb31bad60761ab55ed9f",
"transactionIndex": "0x5b",
"value": "0x19755d4ce12c00",
"type": "0x2",
"accessList": [],
"chainId": "0x1",
"v": "0x0",
"r": "0xa681faea68ff81d191169010888bbbe90ec3eb903e31b0572cd34f13dae281b9",
"s": "0x3f59b0fa5ce6cf38aff2cfeb68e7a503ceda2a72b4442c7e2844d63544383e3",
"yParity": "0x0"
}
}
Geth/Parity Proxy
eth_getTransactionByHash
Get transaction details by hash.
GET
/
v2
/
api
eth_getTransactionByHash
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": "0xf850331061196b8f2b67e1f43aaa9e69504c059d3d3fb9547b04f9ed4d141ab7",
"blockNumber": "0xcf2420",
"from": "0x00192fb10df37c9fb26829eb2cc623cd1bf599e8",
"gas": "0x5208",
"gasPrice": "0x19f017ef49",
"maxFeePerGas": "0x1f6ea08600",
"maxPriorityFeePerGas": "0x3b9aca00",
"hash": "0xbc78ab8a9e9a0bca7d0321a27b2c03addeae08ba81ea98b03cd3dd237eabed44",
"input": "0x",
"nonce": "0x33b79d",
"to": "0xc67f4e626ee4d3f272c2fb31bad60761ab55ed9f",
"transactionIndex": "0x5b",
"value": "0x19755d4ce12c00",
"type": "0x2",
"accessList": [],
"chainId": "0x1",
"v": "0x0",
"r": "0xa681faea68ff81d191169010888bbbe90ec3eb903e31b0572cd34f13dae281b9",
"s": "0x3f59b0fa5ce6cf38aff2cfeb68e7a503ceda2a72b4442c7e2844d63544383e3",
"yParity": "0x0"
}
}
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0xf850331061196b8f2b67e1f43aaa9e69504c059d3d3fb9547b04f9ed4d141ab7",
"blockNumber": "0xcf2420",
"from": "0x00192fb10df37c9fb26829eb2cc623cd1bf599e8",
"gas": "0x5208",
"gasPrice": "0x19f017ef49",
"maxFeePerGas": "0x1f6ea08600",
"maxPriorityFeePerGas": "0x3b9aca00",
"hash": "0xbc78ab8a9e9a0bca7d0321a27b2c03addeae08ba81ea98b03cd3dd237eabed44",
"input": "0x",
"nonce": "0x33b79d",
"to": "0xc67f4e626ee4d3f272c2fb31bad60761ab55ed9f",
"transactionIndex": "0x5b",
"value": "0x19755d4ce12c00",
"type": "0x2",
"accessList": [],
"chainId": "0x1",
"v": "0x0",
"r": "0xa681faea68ff81d191169010888bbbe90ec3eb903e31b0572cd34f13dae281b9",
"s": "0x3f59b0fa5ce6cf38aff2cfeb68e7a503ceda2a72b4442c7e2844d63544383e3",
"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_getTransactionByHash for this endpoint.
The transaction hash to query.
⌘I