getTokensByContractAddress

Get a list of NFTs of an ERC721 contract.

Request

curl -X GET http://eth-mainnet.api.henesis.io/nft/v1/contracts/<contractAddress>/tokens?clientId=<clientId>&page=<page>&size=<size>&order_by=<order_by>&order_direction=<order_direction>&accountAddresses=<accountAddress1>,<accountAddress2>

Response

{
"data": {
"address": "0x273f7f8e6489682df756151f5525576e322d51a3",
"name": "MyCryptoHeroes:Hero",
"symbol": "MCHH",
"totalSupply": "15712",
"tokens": [
{
"id": "40020032",
"contractAddress": "0x273f7f8e6489682df756151f5525576e322d51a3",
"owner": "0x185b257aa51fdc45176cf1ffac6a0bfb5cf28afd",
"uri": "https://www.mycryptoheroes.net/metadata/hero/40020032"
},
...
{
"id": "40090027",
"contractAddress": "0x273f7f8e6489682df756151f5525576e322d51a3",
"owner": "0x138a35ee20e40f019e7e7c00386ab2ef42d66d1e",
"uri": "https://www.mycryptoheroes.net/metadata/hero/40090027"
}
]
},
"pagination": {
"totalCount": 10515,
"prevUrl": "http://api.henesis.io/nft/v1/contracts/0x273f7f8e6489682df756151f5525576e322d51a3/tokens?page=0&size=15&order_by=transfer_block_number&order_direction=desc&accountAddresses=0x138a35ee20e40f019e7e7c00386ab2ef42d66d1e",
"nextUrl": "http://api.henesis.io/nft/v1/contracts/0x273f7f8e6489682df756151f5525576e322d51a3/tokens?page=2&size=15&order_by=transfer_block_number&order_direction=desc&accountAddresses=0x138a35ee20e40f019e7e7c00386ab2ef42d66d1e "
}
}

Path Parameters

Name

Type

Description

contractAddress

string

The address of account for which you want to retrieve ERC721 tokens

Query Parameters

Name

Type

Description

clientId

string

The id required for authentication

page

integer

The page of results to return

size

integer

The number of ERC721 tokens to return in one request, specified as an integer from 1 to 200

order_by

string

The field by which the results is sorted Available Values:

transfer_block_number : Based on the block number where the transfer occurred (default)

order_direction

string

The order direction Available Values:

asc: Ascending Order

desc: Descending Order (default)

contractAddresses

List<string>

The contract addresses to filter This field returns only the ERC721 tokens of the specified contract among the tokens owned by the account

Response Fields

data : The response of getTokensByContractAddress API call

Name

Type

Description

address

string

The address of ERC721 contract

name

string

The name of ERC721 contract

symbol

string

The symbol of ERC721 token

totalSupply

string

The totalSupply of ERC721 token

tokens

List<Object>

The array of ERC721 tokens

Each tokens has the following fields:

Name

Type

Description

id

string

The id of ERC721 token

contractAddress

string

The address of ERC721 contract

owner

string

The owner of ERC721 token

uri

string

The uri of ERC721 token

pagination: The pagination information of ERC721 token list

Name

Type

Description

totalCount

long

The number of all elements in this API request

prevUrl

string

The previous url of this API request

nextUrl

string

The next url of this API request

If prevUrl or nextUrl does not exist, it would be displayed as "".

Errors

If an error occurs, the following message is returned.

{
"error": {
"message": "Not Supported Contract",
"code": 404
}
}

The types of error handled are as follows.

code

message

description

404

Not Supported Contract

Occurs when requesting a not supported contract

401

Unauthorized user

Occurs when requesting with an unregistered clientId

400

Invalid parameter in [parameter]

Occurs when the value of the requested parameter is invalid