Skip to main content

Fetch a user

Information, created collections, owned items, sales or activities

Information

You would have to use the user query with the below parameters :

You can request any user information, such as his name (if available on Kalao), a description, avatar, and much more

Graphql Example

Request

query User($userAddress: Address!) {
user(address: $userAddress) {
address
name
metadata{liked_nfts, owned_nfts}
facebook
}
}

Example Parameters

{ "userAddress": "0x26acae237d5b2ab062faf58508cf638547b7233a" }
With CURL
curl -X POST -H 'content-type: application/json' \
-d '{"query":"query User($userAddress: Address!) {\n user(address: $userAddress) {\n address\n name\n metadata {\n liked_nfts\n owned_nfts\n } facebook\n }\n }","variables":{"userAddress":"0x26acae237d5b2ab062faf58508cf638547b7233a"},"operationName":"User"}' \
https://public-api.dev.kalao.io/query

Response

{
"data":{
"user":{
"address":"0x26acae237d5b2ab062faf58508cf638547b7233a",
"name":"K4RL M@RX 🛠️",
"metadata":{
"liked_nfts":6,
"owned_nfts":48
},
"facebook":"yoloprofile.rt"
}
}
}

Created collections

You would have to use the search query with the below parameters :

  • Owner address,

  • And the collections target.

Returns a list of collection(s).

Graphql Example

Request

query UserCollections($owner: Address!) {
search(
input: {target: collections, owner: $owner}
pagination: {page: 1, size: 4}
) {
collections {
collection {
address
}
stats {
total_minted
}
}
}
}

Example Parameters

{ "owner": "0x2468cE7D3545504f80c742Df251264b1DbEee213" }
With CURL
curl -X POST -H 'content-type: application/json' \
-d '{"query":"query UserCollections($owner: Address!) {\n search(input: {\n target: collections\n owner: $owner\n } pagination: {\n page: 1\n size: 4\n }) {\n collections {\n collection {\n address\n }\n stats {\n total_minted\n }\n }\n }\n }","variables":{"owner":"0x2468cE7D3545504f80c742Df251264b1DbEee213"},"operationName":"UserCollections"}' \
https://public-api.dev.kalao.io/query

Response

{
"data": {
"search": {
"collections": [
{
"collection": {
"address": "0xbe35e8f8f5361264ad4781555eeaa559db203f28"
},
"stats": {
"total_minted": "15"
}
},
{
"collection": {
"address": "0x90789f9ed0567c6bd09e471849f2f5086d660909"
},
"stats": {
"total_minted": "2"
}
},
{
"collection": {
"address": "0x23fafc529b47be57780655a7cbad09d177023c51"
},
"stats": {
"total_minted": "0"
}
}
]
}
}
}

Owned items

You would have to use the search query with the below parameters :

  • Owner address,

  • And the collectibles target.

  • Add a sort if needed, such as price from high to low (shows items for sale first)

Returns a list of nfts, type NFTPreview.

Graphql Example

Request

query OwnedNFTs($owner: Address!) {
search(
input: {
target: collectibles
owner: $owner
sort: price_desc
}
pagination: { page: 1, size: 3 }
) {
nfts {
name
collection {
address
}
sale {
unitary_price_float
}
}
}
}

Example Parameters

{ "owner": "0x2468cE7D3545504f80c742Df251264b1DbEee213" }
With CURL
curl -X POST -H 'content-type: application/json' \
-d '{"query":"query OwnedNFTs($owner: Address!) {\n search(input: {\n target: collectibles\n owner: $owner\n sort: price_desc\n } pagination: {\n page: 1\n size: 3\n }) {\n nfts {\n name\n collection {\n address\n }\n sale {\n unitary_price_float\n }\n }\n }\n }","variables":{"owner":"0x2468cE7D3545504f80c742Df251264b1DbEee213"},"operationName":"OwnedNFTs"}' \
https://public-api.dev.kalao.io/query

Response

{
"data": {
"search": {
"nfts": [
{
"name": " #942",
"collection": {
"address": "0x6e48ba71b8349940a04c7035b1c0fd6c6ea5ab21"
},
"sale": {
"unitary_price_float": 14
}
},
{
"name": " #121",
"collection": {
"address": "0x6e48ba71b8349940a04c7035b1c0fd6c6ea5ab21"
},
"sale": {
"unitary_price_float": 13
}
},
{
"name": "MEOW",
"collection": {
"address": "0xfb150c658091bd6079d1942dd4dd5373a58ff3e4"
},
"sale": {
"unitary_price_float": 9
}
}
]
}
}
}

User sales

Please report to Search sales by user.

User activities

Please report to Fetch activities by user.