Links

List data NFTs

The result of following GraphQL query returns the information about data nfts.
Copy the query in the GraphiQL interface to fetch the results from the mainnet. For other networks use this table.

Query

{
nfts (skip:0, first: 10, subgraphError:deny){
id
name
symbol
owner
address
assetState
tx
block
transferable
}
}

Code snippets

Python
Javascript
The python script below can be used to run the the query. If you wish to change the network, then replace the value of variable base_url as needed.
Create script
list_dataNFTs.py
import requests
import json
query = """
{
nfts (skip:0, first: 10, subgraphError:deny){
id
name
symbol
owner
address
assetState
tx
block
transferable
}
}"""
base_url = "https://v4.subgraph.mainnet.oceanprotocol.com"
route = "/subgraphs/name/oceanprotocol/ocean-subgraph"
url = base_url + route
headers = {"Content-Type": "application/json"}
payload = json.dumps({"query": query})
response = requests.request("POST", url, headers=headers, data=payload)
result = json.loads(response.text)
print(json.dumps(result, indent=4, sort_keys=True))
Execute script
python list_dataNFTs.py
The javascript below can be used to run the the query. If you wish to change the network, then replace the value of variable baseUrl as needed.
Create script
listDatatoken.js
var axios = require('axios');
const query = `{
nfts (skip:0, first: 10, subgraphError:deny){
id
name
symbol
owner
address
assetState
tx
block
transferable
}
}`
const baseUrl = "https://v4.subgraph.mainnet.oceanprotocol.com"
const route = "/subgraphs/name/oceanprotocol/ocean-subgraph"
const url = `${baseUrl}${route}`
var config = {
method: 'post',
url: url,
headers: { "Content-Type": "application/json" },
data: JSON.stringify({ "query": query })
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Execute script
node listDatatoken.js

Response

Sample response