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>"
}NFT API
Get NFT metadata
Get the metadata associated with the specified NFT.
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
Example:
"demo"
Query Parameters
chain network id, see list of details
The address of the NFT contract
Pattern:
^0[xX]{1}[a-fA-F0-9]{40}$NFT token id in hex or num string
⌘I