Convert From NFT ID
This endpoint allows you to convert an NFT ID to a puzzle hash.
Endpoint
- Mainnet
- Testnet
GET https://api.spacescan.io/tools/convert_from_nft/{nft_id}
GET https://api-testnet11.spacescan.io/tools/convert_from_nft/{nft_id}
Parameters
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
nft_id | string | Yes | - | NFT ID starting with 'nft' |
Free API
Use api.spacescan.io
for free tier access. See our API Plans for rate limits and features.
Pro API
Use pro-api.spacescan.io
with your API key in the x-api-key
header. See our API Plans for details.
curl -X GET "https://pro-api.spacescan.io/tools/convert_from_nft/nft10lutrplp2mqrp0wg27sjmjeezzluk9a7jgmjpdv6n5qalkpy8kxqrkqag7" \
-H "x-api-key: YOUR_API_KEY"
Live API Test
- Mainnet
Request Examples
- cURL
- Python
- JavaScript
curl -X GET "https://api.spacescan.io/tools/convert_from_nft/nft10lutrplp2mqrp0wg27sjmjeezzluk9a7jgmjpdv6n5qalkpy8kxqrkqag7"
import requests
nft_id = "nft10lutrplp2mqrp0wg27sjmjeezzluk9a7jgmjpdv6n5qalkpy8kxqrkqag7"
url = f"https://api.spacescan.io/tools/convert_from_nft/{nft_id}"
response = requests.get(url)
data = response.json()
print(data)
const nftId = "nft10lutrplp2mqrp0wg27sjmjeezzluk9a7jgmjpdv6n5qalkpy8kxqrkqag7";
const url = `https://api.spacescan.io/tools/convert_from_nft/${nftId}`;
fetch(url)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
Response Schema
Field | Type | Description |
---|---|---|
status | string | Status of the request (success/failure) |
data | string | The converted puzzle hash |
Example Response
{
"status": "success",
"data": "0x7ff8b187e156c030bdc857a12dcb3910bfcb17be923720b59a9d01dfd8243d8c"
}
Error Responses
HTTP Status Code | Meaning |
---|---|
400 | Bad Request -- Invalid NFT ID format |
429 | Too Many Requests -- You're requesting too many times |
500 | Internal Server Error -- We had a problem with our server |
503 | Service Unavailable -- We're temporarily offline for maintenance |