> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.galleon8.com/api-reference/advanced-api/api-endpoints/nft-api/ankr-get-nft-metadata/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.galleon8.com/_mcp/server. # ankr_getNFTMetadata POST https://advanced-api-docs-proxy.galleon8.workers.dev Content-Type: application/json Retrieves metadata for the specified NFT (ERC721/ERC1155/ENS/POAP). Reference: https://docs.galleon8.com/api-reference/advanced-api/api-endpoints/nft-api/ankr-get-nft-metadata ## Request ### Body (application/json) This endpoint expects an object. - `contractAddress` (string, required) — Address of the NFT contract the metadata belongs to. Supports ENS. - `blockchain` (enum, optional) — Name of the blockchain. - Allowed values: `arbitrum`, `avalanche`, `avalanche_fuji`, `bsc`, `eth`, `eth_goerli`, `fantom`, `optimism`, `polygon`, `polygon_mumbai`, `polygon_zkevm`, `syscoin` - `forceFetch` (boolean, optional) — Get NFT metadata from the contract (true) or database (false). - `tokenId` (string, optional) — Token ID of the NFT the metadata belongs to. Created by the contract when minting the NFT. ## Response ### 200 Result returned by ankr_getNFTMetadata. - `attributes` (AnkrGetNftMetadataResultAttributes, required, nullable) — Attributes of the NFT. - `metadata` (AnkrGetNftMetadataResultMetadata, required, nullable) — Metadata of the NFT. ## Types ### AnkrGetNftMetadataResultAttributes Attributes of the NFT. - `contractType` (enum, optional) - Allowed values: `ERC721`, `ERC1155` - `description` (string, optional) — Description of the NFT. - `imageUrl` (string, optional) — URL to the thumbnails of the NFT. Usually, an IPFS link. - `name` (string, optional) — Name of the NFT. - `tokenUrl` (string, optional) — URL to the page with NFT details. - `traits` (list of AnkrGetNftMetadataResultAttributesTraitsItems, optional) — Array of pre-defined NFT traits: trait types and their value. ### AnkrGetNftMetadataResultMetadata Metadata of the NFT. - `blockchain` (enum, optional) — Supported blockchain identifier. - Allowed values: `arbitrum`, `avalanche`, `avalanche_fuji`, `bsc`, `eth`, `eth_goerli`, `fantom`, `optimism`, `polygon`, `polygon_mumbai`, `polygon_zkevm`, `syscoin` - `collectionName` (string, optional) — Name of the collection the NFT belongs to. - `collectionSymbol` (string, optional) — Symbol of the collection the NFT belongs to. - `contractAddress` (string, optional) — Blockchain address, ENS name, or contract address where supported. - `contractType` (enum, optional) - Allowed values: `ERC721`, `ERC1155` - `tokenId` (string, optional) — URL to the page with NFT details. ### AnkrGetNftMetadataResultAttributesTraitsItems - `trait_type` (string, optional) — Specific trait type (e.g., eye color). - `value` (string, optional) — Specific trait value (e.g., blue). ## Examples **Request** ```json [ "0x8d01c8ee82e581e55c02117a676b5bbd4734fabb", "avalanche", false, "23240" ] ``` **Response** ```json { "jsonrpc": "2.0", "id": "1", "result": { "attributes": { "contractType": "ERC721", "description": "Rock #23240, can be used to play Rock Game", "imageUrl": "https://ipfs.io/ipfs/QmPktcEDiRD9qNwc497mwQkJ3zYFQtHwFooPLkgDdRqU4R/23240.png", "name": "Rock 23240", "tokenUrl": "https://ipfs.io/ipfs/QmYen4cGUc3gF9UQnCycq2AADYLYzoM6mvVzoajAXTr7vH/rock23240.json", "traits": [ { "trait_type": "face", "value": "Brown" }, { "trait_type": "nose", "value": "Regular Nose" }, { "trait_type": "mouth", "value": "Chinstrap" }, { "trait_type": "eyes", "value": "Big Shades" }, { "trait_type": "hair", "value": "Stringy Hair" }, { "trait_type": "accessories", "value": "Earring" } ] }, "metadata": { "blockchain": "avalanche", "collectionName": "Rock", "collectionSymbol": "ROCK", "contractAddress": "0x8d01c8ee82e581e55c02117a676b5bbd4734fabb", "contractType": "ERC721", "tokenId": "23240" } } } ``` **SDK Code** ```python import requests url = "https://advanced-api-docs-proxy.galleon8.workers.dev/" payload = ["0x8d01c8ee82e581e55c02117a676b5bbd4734fabb", "avalanche", False, "23240"] headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://advanced-api-docs-proxy.galleon8.workers.dev/'; const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '["0x8d01c8ee82e581e55c02117a676b5bbd4734fabb","avalanche",false,"23240"]' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://advanced-api-docs-proxy.galleon8.workers.dev/" payload := strings.NewReader("[\n \"0x8d01c8ee82e581e55c02117a676b5bbd4734fabb\",\n \"avalanche\",\n false,\n \"23240\"\n]") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://advanced-api-docs-proxy.galleon8.workers.dev/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = 'application/json' request.body = "[\n \"0x8d01c8ee82e581e55c02117a676b5bbd4734fabb\",\n \"avalanche\",\n false,\n \"23240\"\n]" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://advanced-api-docs-proxy.galleon8.workers.dev/") .header("Content-Type", "application/json") .body("[\n \"0x8d01c8ee82e581e55c02117a676b5bbd4734fabb\",\n \"avalanche\",\n false,\n \"23240\"\n]") .asString(); ``` ```php request('POST', 'https://advanced-api-docs-proxy.galleon8.workers.dev/', [ 'body' => '[ "0x8d01c8ee82e581e55c02117a676b5bbd4734fabb", "avalanche", false, "23240" ]', 'headers' => [ 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://advanced-api-docs-proxy.galleon8.workers.dev/"); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "[\n \"0x8d01c8ee82e581e55c02117a676b5bbd4734fabb\",\n \"avalanche\",\n false,\n \"23240\"\n]", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Content-Type": "application/json"] let parameters = ["0x8d01c8ee82e581e55c02117a676b5bbd4734fabb", "avalanche", false, "23240"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://advanced-api-docs-proxy.galleon8.workers.dev/")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```