Skip to main content

Get contract source

Retrieves the Clarity source code of a given contract, along with the block height it was published in, and the MARF proof for the data

Path Parameters
contract_address string REQUIRED

Stacks address

Example: SP6P4EJF0VG8V0RB3TQQKJBHDQKEF6NVRD1KZE3C
contract_name string REQUIRED

Contract name

Example: satoshibles
Query Parameters
proof integer

Returns object without the proof field if set to 0

tip string

The Stacks chain tip to query from

Responses
200

Success

Schema OPTIONAL
source string
publish_height integer
proof string
get_contract_source
GET /v2/contracts/source/:contract_address/:contract_name
contract_address — path
contract_name — path
proof — query
tip — query
https://api.mainnet.hiro.so
curl -L 'https://api.mainnet.hiro.so/v2/contracts/source/:contract_address/:contract_name' \
-H 'Accept: application/json'