Skip to main content
GET
/
v1
/
nft
/
metadata
Get NFT metadata
curl --request GET \
  --url https://api.chainbase.online/v1/nft/metadata \
  --header 'x-api-key: <x-api-key>'
import requests

url = "https://api.chainbase.online/v1/nft/metadata"

headers = {"x-api-key": "<x-api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};

fetch('https://api.chainbase.online/v1/nft/metadata', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.chainbase.online/v1/nft/metadata",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <x-api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.chainbase.online/v1/nft/metadata"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("x-api-key", "<x-api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.chainbase.online/v1/nft/metadata")
.header("x-api-key", "<x-api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.chainbase.online/v1/nft/metadata")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'

response = http.request(request)
puts response.read_body
{
  "code": 0,
  "message": "ok",
  "data": {
    "blockchain": "<string>",
    "contract_address": "<string>",
    "token_id": "<string>",
    "erc_type": "<string>",
    "name": "<string>",
    "owner": "<string>",
    "symbol": "<string>",
    "image_uri": "<string>",
    "mint_time": 123,
    "mint_transaction_hash": "<string>",
    "token_uri": "<string>",
    "metadata": "<unknown>",
    "traits": "<unknown>",
    "rarity_score": 123,
    "rarity_rank": 123
  }
}
{
"code": 123,
"message": "<string>"
}
{
"code": 123,
"message": "<string>"
}
{
"code": 123,
"message": "<string>"
}
{
"code": 123,
"message": "<string>"
}
{
"code": 123,
"message": "<string>"
}
{
"code": 123,
"message": "<string>"
}

Headers

x-api-key
string
required
Example:

"demo"

Query Parameters

chain_id
string
required

chain network id, see list of details

contract_address
string
required

The address of the NFT contract

Pattern: ^0[xX]{1}[a-fA-F0-9]{40}$
token_id
string
required

NFT token id in hex or num string

Response

Successful Response

code
integer
default:0
message
string
default:ok
data
NFTAsset · object