Need help with your APIs? I offer API discovery, governance & evangelism services. Explore services →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Hiro Smart Contracts API

Read-only endpoints to obtain Clarity smart contract details

Hiro Smart Contracts API is one of 26 APIs that Hiro publishes on the APIs.io network, described by a machine-readable OpenAPI specification.

Tagged areas include Smart Contracts. The published artifact set on APIs.io includes an OpenAPI specification and API documentation.

This API exposes 14 operations across 14 paths, and defines 9 schemas. It is described by OpenAPI 3.0.3, at version 1.0.3.

Requests are made against 2 base URLs: https://api.hiro.so/, https://api.testnet.hiro.so/.

14 operations 14 paths 9 schemas 11 GET3 POST

Metadata

The identity and technical contract details declared by the specification.

Specification
OpenAPI 3.0.3
API Version
1.0.3
Base URL
https://api.mainnet.hiro.so
Resource Areas
1

Paths & Operations 14

Across 14 paths, the API surfaces 14 operations — 11 GET, 3 POST. Each is listed below with its method, path, parameters, and response codes.

Smart Contracts 14

Read-only endpoints to obtain Clarity smart contract details

GET
/extended/v1/contract/by_trait
Get contracts by trait
get_contracts_by_trait 3 params → 2004XX
GET
/extended/v1/contract/{contract_id}
Get contract info
get_contract_by_id 1 param → 2004XX
GET
/extended/v1/contract/{contract_id}/events
Get contract events
get_contract_events_by_id 3 params → 2004XX
GET
/extended/v2/smart-contracts/status
Get smart contracts status
get_smart_contracts_status 1 param → 2004XX
GET
/v2/contracts/interface/{deployer_address}/{contract_name}
Get contract interface
getContractInterface 3 params → 200400404500
POST
/v2/map_entry/{deployer_address}/{contract_name}/{map_name}
Get specific data-map inside a contract
getContractDataMapEntry 5 params body → 200400404500
GET
/v2/contracts/source/{deployer_address}/{contract_name}
Get contract source
getContractSource 4 params → 200400404500
POST
/v2/contracts/call-read/{deployer_address}/{contract_name}/{function_name}
Call read-only function
callReadOnlyFunction 4 params body → 200400404500
POST
/v3/contracts/fast-call-read/{deployer_address}/{contract_name}/{function_name}
Call read-only function in fast mode (no cost and memory tracking)
fastCallReadOnlyFunction 4 params body → 200400401404408500
GET
/v2/traits/{deployer_address}/{contract_name}/{trait_deployer_address}/{trait_contract_name}/{trait_name}
Get trait implementation details
checkTraitImplementation 6 params → 200400404
GET
/v2/clarity/marf/{marf_key_hash}
Get the MARF value for a given key
getClarityMarfValue 3 params → 200400404
GET
/v2/clarity/metadata/{deployer_address}/{contract_name}/{clarity_metadata_key}
Get the contract metadata for the metadata key
getClarityMetadata 4 params → 200400404500
GET
/v2/constant_val/{deployer_address}/{contract_name}/{constant_name}
Get the value of a constant inside a contract
getConstantValue 4 params → 200400404500
GET
/v2/data_var/{principal}/{contract_name}/{var_name}
Get contract data variable
getContractDataVariable 5 params → 200400404

Schemas 9

The contract defines 9 schemas that model the data the API accepts and returns. Each schema is shown below with its type and property counts.

ReadOnlyFunctionResult
ClarityName
IsTraitImplemented
ContractSource
ReadOnlyFunctionArgs
ConstantValue
ClarityMetadata
ClarityData
ContractInterface

Specification

The full machine-readable OpenAPI contract behind this narrative.

Source

hiro-smart-contracts-api-openapi.yml Raw ↑

Other APIs Hiro publishes across the network.

Hiro Chainhooks API
Hiro Platform API
Hiro Accounts API
Hiro Atlas API
Hiro Blocks API
Hiro Blocks Proposals API
Hiro Burn Blocks API
Hiro Faucets API
Hiro Fees API
Hiro Fungible Tokens API
Hiro Info API
Hiro Mempool API