Skip to main content
GET
/
api
/
v1
/
contracts
List contract entities on network
curl --request GET \
  --url https://mainnet.mirrornode.hedera.com/api/v1/contracts
import requests

url = "https://mainnet.mirrornode.hedera.com/api/v1/contracts"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://mainnet.mirrornode.hedera.com/api/v1/contracts', 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",
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"

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")
.asString();
require 'uri'
require 'net/http'

url = URI("https://mainnet.mirrornode.hedera.com/api/v1/contracts")

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
{
  "contracts": [
    {
      "admin_key": {
        "_type": "ProtobufEncoded",
        "key": "15706b229b3ba33d4a5a41ff54ce1cfe0a3d308672a33ff382f81583e02bd743"
      },
      "auto_renew_account": "0.0.2",
      "auto_renew_period": 7776000,
      "contract_id": "0.0.2",
      "created_timestamp": "1586567700.453054000",
      "deleted": false,
      "evm_address": "0000000000000000000000000000000000001f41",
      "expiration_timestamp": "1586567700.453054000",
      "file_id": "0.0.2",
      "max_automatic_token_associations": 123,
      "memo": "contract memo",
      "nonce": 1,
      "obtainer_id": "0.0.2",
      "permanent_removal": true,
      "proxy_account_id": "0.0.2",
      "timestamp": {
        "from": "1586567700.453054000",
        "to": "1586567700.453054000"
      }
    }
  ],
  "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"
}
]
}
}

Query Parameters

contract.id
string

The ID of the smart contract

Pattern: ^((gte?|lte?|eq|ne)\:)?(\d{1,10}\.\d{1,10}\.)?\d{1,10}|(\d{1,10}\.){0,2}[A-Fa-f0-9]{40}$
limit
integer<int32>
default:25

The maximum number of items to return

Required range: 1 <= x <= 100
order
enum<string>
default:desc

The order in which items are listed

Available options:
asc,
desc

Response

OK

contracts
object[]