Developer Reference
APIDOCS
Complete reference for the TensorStats API endpoints
Base URL
https://tensorstats.com/api
Market Data
Get Market Statistics
GET
/api/market-data
Response:
{
"price": 542.18,
"marketCap": 3420000000,
"volume24h": 82400000,
"totalSupply": 6309056,
"change24h": 2.34
}Subnets
List All Subnets
GET
/api/subnets?limit=10
Parameters:
| Parameter | Type | Description |
|---|---|---|
limit | integer | Number of subnets to return (default: 50) |
sort | string | Sort field (stake, validators, name) |
Get Subnet Details
GET
/api/subnets/{id}Response:
{
"id": 1,
"name": "Text Prompting",
"description": "Advanced text generation subnet",
"totalStake": 45678.23,
"validators": 128,
"github": "https://github.com/...",
"website": "https://...",
"nodes": [
{
"uid": 0,
"hotkey": "5GrwvaEF5zXb26Fz9rcQp...",
"coldkey": "5GrwvaEF5zXb26Fz9rcQp...",
"stake": 234.56,
"dailyEarnings": 12.34,
"trust": 0.8542,
"rank": 0.9234,
"consensus": 0.7821,
"incentive": 0.8912,
"dividends": 0.6789,
"emission": 45.67
}
]
}Blockchain
Get Recent Blocks
GET
/api/blocks?limit=10
Response:
[
{
"number": 2547891,
"hash": "0xa1b2c3d4e5f6...",
"timestamp": "2024-01-15T12:34:56Z",
"transactions": 25,
"validator": "validator_123"
}
]Get Block Details
GET
/api/blocks/{number}Get Transactions
GET
/api/transactions?type=transfer&limit=20
Parameters:
| Parameter | Type | Description |
|---|---|---|
type | string | Transaction type (transfer, stake, unstake) |
limit | integer | Number of transactions to return |
Staking
Submit Stake Transaction
POST
/api/stake
Request Body:
{
"subnetId": 1,
"validatorHotkey": "5GrwvaEF5zXb26Fz9rcQp...",
"amount": "100.0",
"signature": "0x1234..."
}Response:
{
"success": true,
"transactionHash": "0xabcd1234...",
"message": "Stake transaction submitted"
}Rate Limits
All API endpoints are rate limited:
- •100 requests per minute for market data endpoints
- •1000 requests per hour for subnet data endpoints
- •500 requests per hour for blockchain endpoints
- •10 requests per minute for staking endpoints
Error Responses
400 Bad Request
{
"error": "Invalid parameters",
"message": "Limit must be between 1 and 100"
}429 Too Many Requests
{
"error": "Rate limit exceeded",
"message": "Too many requests, try again later"
}