---
title: "Get contract by id"
method: GET
path: "/api/v1/contracts/{contractIdOrAddress}"
tags: ["contracts"]
---

# Get contract by id

`GET /api/v1/contracts/{contractIdOrAddress}`

Return the contract information given an id

## Path parameters

- `contractIdOrAddress` string, required

## Query parameters

- `timestamp` string[]

## Response `200`

OK

- ContractResponse
  - `admin_key` Key, nullable — The public key which controls access to various network entities.
    - `_type` 'ECDSA_SECP256K1' | 'ED25519' | 'ProtobufEncoded'
    - `key` string
  - `auto_renew_account` string, nullable — Network entity ID in the format of `shard.realm.num`
  - `auto_renew_period` integer, nullable
  - `contract_id` string, nullable — Network entity ID in the format of `shard.realm.num`
  - `created_timestamp` string, nullable — A Unix timestamp in seconds.nanoseconds format
  - `deleted` boolean
  - `evm_address` string, binary — A network entity encoded as an EVM address in hex.
  - `expiration_timestamp` string, nullable — A Unix timestamp in seconds.nanoseconds format
  - `file_id` string, nullable — Network entity ID in the format of `shard.realm.num`
  - `max_automatic_token_associations` integer, nullable
  - `memo` string
  - `nonce` integer, nullable — The nonce of the contract
  - `obtainer_id` string, nullable — Network entity ID in the format of `shard.realm.num`
  - `permanent_removal` boolean, nullable
  - `proxy_account_id` string, nullable — Network entity ID in the format of `shard.realm.num`
  - `timestamp` TimestampRange — A timestamp range an entity is valid for
    - `from` string — The inclusive from timestamp in seconds
    - `to` string, nullable — The exclusive to timestamp in seconds
  - `bytecode` string, binary, nullable — The contract bytecode in hex during deployment
  - `runtime_bytecode` string, binary, nullable — The contract bytecode in hex after deployment

## Other responses

- `400` — Invalid parameter
- `404` — Not Found

---

[API](https://skmtc.dev/hedera/apis/mirror-node-rest-api.md) · [All operations](https://skmtc.dev/hedera/apis/mirror-node-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hedera/mirror-node-rest-api/revisions/45f5ccac560c/schema)
