curl -X GET "https://api.credprotocol.com/api/v2/agents/count" \
-H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch('https://api.credprotocol.com/api/v2/agents/count', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();
console.log(`Total agents: ${data.total}`);
import requests
response = requests.get(
'https://api.credprotocol.com/api/v2/agents/count',
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
data = response.json()
print(f"Total agents: {data['total']}")
{
"total": 42
}
{
"detail": "Failed to read from Identity Registry contract"
}
Agents
Get Agent Count
Get the total number of agents registered in the ERC-8004 Identity Registry
GET
/
api
/
v2
/
agents
/
count
curl -X GET "https://api.credprotocol.com/api/v2/agents/count" \
-H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch('https://api.credprotocol.com/api/v2/agents/count', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();
console.log(`Total agents: ${data.total}`);
import requests
response = requests.get(
'https://api.credprotocol.com/api/v2/agents/count',
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
data = response.json()
print(f"Total agents: {data['total']}")
{
"total": 42
}
{
"detail": "Failed to read from Identity Registry contract"
}
Overview
Returns the total number of AI agents minted in the ERC-8004 Identity Registry on Base. This is useful for understanding the size of the registry and for paginating through the full agent list.This is a free endpoint (0 Cred Units). It reads directly from the on-chain Identity Registry contract on Base.
Authentication
| Method | Header | Cost |
|---|---|---|
| API Token | Authorization: Bearer YOUR_API_KEY | 0 Cred Units |
| x402 Payment | X-PAYMENT: <signed_payment> | Free |
Response
integer
Total number of agents currently registered in the Identity Registry
curl -X GET "https://api.credprotocol.com/api/v2/agents/count" \
-H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch('https://api.credprotocol.com/api/v2/agents/count', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();
console.log(`Total agents: ${data.total}`);
import requests
response = requests.get(
'https://api.credprotocol.com/api/v2/agents/count',
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
data = response.json()
print(f"Total agents: {data['total']}")
{
"total": 42
}
{
"detail": "Failed to read from Identity Registry contract"
}
Performance
- Response Time: Typically under 1 second
- Data Source: On-chain
totalSupply()call to the Identity Registry on Base (chain 8453)