Skip to main content

Subname Statistics

Get aggregate statistics for a parent domain including total registrations, unique owners, and top holders.

Endpoint​

GET /api/subnames/{parent}/stats

Authentication​

None required — This is a public read endpoint.

Parameters​

ParameterTypeLocationRequiredDescription
parentstringpathâś…Parent ENS name (e.g., aboutme.eth)

Response​

{
"parent": "aboutme.eth",
"stats": {
"total_subnames": 156,
"unique_owners": 142,
"first_registration": "2024-01-15T10:00:00.000Z",
"latest_registration": "2024-02-10T14:00:00.000Z",
"top_owners": [
{
"owner": "0x701B4937e6c943789ffA74CC8601813b2D87B454",
"count": 5
},
{
"owner": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb0",
"count": 3
}
]
},
"links": {
"register": "https://aboutme.eth.limo",
"all_subnames": "https://api.web3identity.com/api/subnames/aboutme.eth/all",
"api_docs": "https://docs.web3identity.com/api/subnames"
},
"timestamp": "2024-02-10T14:30:00.000Z"
}

Examples​

cURL​

curl "https://api.web3identity.com/api/subnames/aboutme.eth/stats"

JavaScript​

async function getSubnameStats(parent) {
const response = await fetch(
`https://api.web3identity.com/api/subnames/${parent}/stats`
);
return response.json();
}

const stats = await getSubnameStats('aboutme.eth');
console.log(`Total subnames: ${stats.stats.total_subnames}`);
console.log(`Unique owners: ${stats.stats.unique_owners}`);
console.log(`Latest registration: ${stats.stats.latest_registration}`);

Python​

import requests

def get_subname_stats(parent: str):
response = requests.get(
f"https://api.web3identity.com/api/subnames/{parent}/stats"
)
return response.json()

stats = get_subname_stats("aboutme.eth")
print(f"Total subnames: {stats['stats']['total_subnames']}")
print(f"Unique owners: {stats['stats']['unique_owners']}")

Use Cases​

  • Analytics Dashboard: Display registration metrics
  • Leaderboard: Show top subname holders
  • Growth Tracking: Monitor registration trends over time

Response Fields​

FieldTypeDescription
total_subnamesintegerTotal registered subnames
unique_ownersintegerNumber of distinct owner addresses
first_registrationstringTimestamp of first registration
latest_registrationstringTimestamp of most recent registration
top_ownersarrayTop 5 owners by registration count

Error Responses​

StatusCodeDescription
400BAD_REQUESTInvalid parent name format
429RATE_LIMITEDRate limit exceeded
500STATS_ERRORInternal server error
  • List All — Browse all subnames
  • By Owner — View specific owner's holdings