Get Total Supply
This endpoint allows you to fetch the total supply of XCH in circulation.
Endpoint
- Mainnet
- Testnet
GET https://api.spacescan.io/stats/total-supply
GET https://api-testnet11.spacescan.io/stats/total-supply
Parameters
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
network | string | No | mainnet | Network to query (mainnet, testnet) |
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/stats/total-supply" \
-H "x-api-key: YOUR_API_KEY"
Live API Test
- Mainnet
- Testnet
Request Examples
- cURL
- Python
- JavaScript
- Mainnet
- Testnet
curl -X GET "https://api.spacescan.io/stats/total-supply"
curl -X GET "https://api-testnet11.spacescan.io/stats/total-supply"
- Mainnet
- Testnet
import requests
url = "https://api.spacescan.io/stats/total-supply"
response = requests.get(url)
data = response.json()
print(data)
import requests
url = "https://api-testnet11.spacescan.io/stats/total-supply"
response = requests.get(url)
data = response.json()
print(data)
- Mainnet
- Testnet
const url = "https://api.spacescan.io/stats/total-supply";
fetch(url)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
const url = "https://api-testnet11.spacescan.io/stats/total-supply";
fetch(url)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
Response
- Mainnet
- Testnet
Failed to load API response. Please try again later.
Failed to load API response. Please try again later.
Response Schema
Field | Type | Description |
---|---|---|
status | string | Success or failure status |
total-supply | number | Total XCH supply in circulation |
Notes
- Total supply includes the pre-farm amount (21M) for XCH and ABA networks
- The value is calculated based on current blockchain height and block rewards
- Response is cached for 2 minutes