Get Token Price
This endpoint allows you to fetch real-time price information for Chia Asset Tokens (CAT)
Endpoint
- Mainnet
- Testnet
GET https://api.spacescan.io/token/price/{asset_id}?currency={currency_code}
GET https://api-testnet11.spacescan.io/token/price/{asset_id}?currency={currency_code}
Parameters
Parameter | Type | Description | Required |
---|---|---|---|
asset_id | string | The unique identifier (TAIL hash) of the CAT | Yes |
currency | string | Currency code (e.g., USD, EUR, USD, etc.) | No |
Use api.spacescan.io
for free tier access. See our API Plans for rate limits and features.
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/token/price/{asset_id}?currency=USD" \
-H "x-api-key: YOUR_API_KEY"
Live API Test
- Mainnet
- Testnet
Request Example
- cURL
- Python
- JavaScript
- Mainnet
- Testnet
import requests
asset_id = "8c77de1427156b98fb15cce77d908f79bd69f6b4b8e3a60d8e051dac481b5365"
currency = "USD"
url = f"https://api.spacescan.io/token/price/{asset_id}?currency={currency}"
response = requests.get(url)
data = response.json()
print(data)
import requests
asset_id = "8c77de1427156b98fb15cce77d908f79bd69f6b4b8e3a60d8e051dac481b5365"
currency = "USD"
url = f"https://api-testnet11.spacescan.io/token/price/{asset_id}?currency={currency}"
response = requests.get(url)
data = response.json()
print(data)
- Mainnet
- Testnet
const assetId = "8c77de1427156b98fb15cce77d908f79bd69f6b4b8e3a60d8e051dac481b5365";
const currency = "USD";
const url = https://api.spacescan.io/token/price/${assetId}?currency=${currency}
;
fetch(url)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
const assetId = "8c77de1427156b98fb15cce77d908f79bd69f6b4b8e3a60d8e051dac481b5365";
const currency = "USD";
const url = https://api-testnet11.spacescan.io/token/price/${assetId}?currency=${currency}
;
fetch(url)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
Response
Failed to load API response. Please try again later.
Response Schema
Field | Type | Description |
---|---|---|
status | string | The status of the API request |
price | object | Price information for the CAT |
Price Object (if requested)
Field | Type | Description |
---|---|---|
[currency] | string | Price in specified currency (e.g., "usd": 0.02624364935709997) |
xch | string | Price in XCH |
Error Responses
HTTP Status Code | Meaning |
---|---|
400 | Bad Request -- Invalid parameters |
429 | Too Many Requests -- Rate limit exceeded |
500 | Internal Server Error |
503 | Service Unavailable |