List contract results from a contract on the network
curl --request GET \
--url https://mainnet.mirrornode.hedera.com/api/v1/contracts/{contractIdOrAddress}/resultsimport requests
url = "https://mainnet.mirrornode.hedera.com/api/v1/contracts/{contractIdOrAddress}/results"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://mainnet.mirrornode.hedera.com/api/v1/contracts/{contractIdOrAddress}/results', 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://mainnet.mirrornode.hedera.com/api/v1/contracts/{contractIdOrAddress}/results",
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://mainnet.mirrornode.hedera.com/api/v1/contracts/{contractIdOrAddress}/results"
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://mainnet.mirrornode.hedera.com/api/v1/contracts/{contractIdOrAddress}/results")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.mirrornode.hedera.com/api/v1/contracts/{contractIdOrAddress}/results")
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{
"results": [
{
"access_list": "0xabcd",
"address": "0x25fe26adc577cc89172e6156c9e24f7b9751b762",
"amount": 10,
"block_gas_used": 2000,
"block_hash": "0x6ceecd8bb224da491",
"block_number": 10,
"bloom": "0x549358c4c2e573e02410ef7b5a5ffa5f36dd7398",
"call_result": "0x2b048531b38d2882e86044bc972e940ee0a01938",
"chain_id": "0x0127",
"contract_id": "0.0.2",
"created_contract_ids": [
"0.0.2"
],
"error_message": "Out of gas",
"failed_initcode": "0x856739",
"from": "0x0000000000000000000000000000000000001f41",
"function_parameters": "0xbb9f02dc6f0e3289f57a1f33b71c73aa8548ab8b",
"gas_consumed": 35000,
"gas_limit": 100000,
"gas_price": "0x4a817c800",
"gas_used": 80000,
"hash": "0xfebbaa29c513d124a6377246ea3506ad917d740c21a88f61a1c55ba338fc2bb1",
"max_fee_per_gas": "0x5",
"max_priority_fee_per_gas": "0x100",
"nonce": 1,
"r": "0xd693b532a80fed6392b428604171fb32fdbf953728a3a7ecc7d4062b1652c043",
"result": "SUCCESS",
"s": "0x24e9c602ac800b983b035700a14b23f78a253ab762deab5dc27e3555a750b355",
"status": 1,
"timestamp": "1586567700.453054000",
"to": "0x0000000000000000000000000000000000001f41",
"transaction_index": 1,
"type": 2,
"v": 1
}
],
"links": {
"next": null
}
}{
"_status": {
"messages": [
{
"message": "Invalid parameter: account.id"
},
{
"message": "Invalid Transaction id. Please use \\shard.realm.num-sss-nnn\\ format where sss are seconds and nnn are nanoseconds"
}
]
}
}{
"_status": {
"messages": [
{
"message": "Not found"
}
]
}
}Smart Contracts
List contract results from a contract on the network
Returns a list of all ContractResults for a contract’s function executions.
GET
/
api
/
v1
/
contracts
/
{contractIdOrAddress}
/
results
List contract results from a contract on the network
curl --request GET \
--url https://mainnet.mirrornode.hedera.com/api/v1/contracts/{contractIdOrAddress}/resultsimport requests
url = "https://mainnet.mirrornode.hedera.com/api/v1/contracts/{contractIdOrAddress}/results"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://mainnet.mirrornode.hedera.com/api/v1/contracts/{contractIdOrAddress}/results', 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://mainnet.mirrornode.hedera.com/api/v1/contracts/{contractIdOrAddress}/results",
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://mainnet.mirrornode.hedera.com/api/v1/contracts/{contractIdOrAddress}/results"
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://mainnet.mirrornode.hedera.com/api/v1/contracts/{contractIdOrAddress}/results")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.mirrornode.hedera.com/api/v1/contracts/{contractIdOrAddress}/results")
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{
"results": [
{
"access_list": "0xabcd",
"address": "0x25fe26adc577cc89172e6156c9e24f7b9751b762",
"amount": 10,
"block_gas_used": 2000,
"block_hash": "0x6ceecd8bb224da491",
"block_number": 10,
"bloom": "0x549358c4c2e573e02410ef7b5a5ffa5f36dd7398",
"call_result": "0x2b048531b38d2882e86044bc972e940ee0a01938",
"chain_id": "0x0127",
"contract_id": "0.0.2",
"created_contract_ids": [
"0.0.2"
],
"error_message": "Out of gas",
"failed_initcode": "0x856739",
"from": "0x0000000000000000000000000000000000001f41",
"function_parameters": "0xbb9f02dc6f0e3289f57a1f33b71c73aa8548ab8b",
"gas_consumed": 35000,
"gas_limit": 100000,
"gas_price": "0x4a817c800",
"gas_used": 80000,
"hash": "0xfebbaa29c513d124a6377246ea3506ad917d740c21a88f61a1c55ba338fc2bb1",
"max_fee_per_gas": "0x5",
"max_priority_fee_per_gas": "0x100",
"nonce": 1,
"r": "0xd693b532a80fed6392b428604171fb32fdbf953728a3a7ecc7d4062b1652c043",
"result": "SUCCESS",
"s": "0x24e9c602ac800b983b035700a14b23f78a253ab762deab5dc27e3555a750b355",
"status": 1,
"timestamp": "1586567700.453054000",
"to": "0x0000000000000000000000000000000000001f41",
"transaction_index": 1,
"type": 2,
"v": 1
}
],
"links": {
"next": null
}
}{
"_status": {
"messages": [
{
"message": "Invalid parameter: account.id"
},
{
"message": "Invalid Transaction id. Please use \\shard.realm.num-sss-nnn\\ format where sss are seconds and nnn are nanoseconds"
}
]
}
}{
"_status": {
"messages": [
{
"message": "Not found"
}
]
}
}Path Parameters
The ID or hex encoded EVM address (with or without 0x prefix) associated with this contract.
Pattern:
^(\d{1,10}\.){0,2}(\d{1,10}|(0x)?[A-Fa-f0-9]{40})$Query Parameters
The block's hash. If multiple values are provided the last value will be the only value used.
Pattern:
^(eq:)?(0x)?([0-9A-Fa-f]{64}|[0-9A-Fa-f]{96})$The block's number
Pattern:
^(eq:)?(\d{1,19}|0x[a-fA-f0-9]+)$Account ID or EVM address executing the contract
Pattern:
^\d{1,10}\.\d{1,10}\.\d{1,10}|(0x)?[A-Fa-f0-9]{40}$Whether to include child transactions or not
The maximum number of items to return
Required range:
1 <= x <= 100The order in which items are listed
Available options:
asc, desc The consensus timestamp as a Unix timestamp in seconds.nanoseconds format with an optional comparison operator. See unixtimestamp.com for a simple way to convert a date to the 'seconds' part of the Unix time.
Pattern:
^((eq|gt|gte|lt|lte|ne):)?\d{1,10}(.\d{1,9})?$The transaction index in the block
Required range:
x >= 0Was this page helpful?