Skip to main content

/extended/v1/contract/by_trait REST API Endpoint

Retrieves a list of contracts based on the following traits listed in JSON format - functions, variables, maps, fungible tokens and non-fungible tokens.

Updated on
Oct 4, 2023

/extended/v1/contract/by_trait REST API Endpoint

Query Parameters

trait_abi
string
REQUIRED
JSON abi of the trait.
limit
integer
max number of contracts to fetch.
offset
integer
index of first contract event to fetch.

Returns

GET list of contracts
object
limit
integer
The number of contracts to return.
offset
integer
The number of contracts to skip (starting at 0).
results
array
An array of contract objects.
tx_id
string
The transaction ID of the contract.
canonical
boolean
Set to true if the contract corresponds to the canonical chain tip.
block_height
integer
The height of the block where the contract was included.
source_code
string
The source code of the contract.
abi
string
The Application Binary Interface (ABI) of the contract.
Request
1
curl -X 'GET' \
2
'https://docs-demo.stacks-mainnet.quiknode.pro/extended/v1/contract/by_trait?trait_abi={JSON_ABI_OF_THE_TRAIT}' \
3
-H 'Content-Type: application/json'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free