curl -X GET "https://api.credprotocol.com/api/v2/agents/search?q=cred&page=1&limit=10" \
-H "Authorization: Bearer YOUR_API_KEY"
const query = 'cred';
const response = await fetch(`https://api.credprotocol.com/api/v2/agents/search?q=${query}&page=1&limit=10`, {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();
console.log(`Found ${data.total_results} agents matching "${data.query}"`);
data.agents.forEach(agent => {
console.log(`Agent #${agent.agent_id} — ${agent.metadata?.name} (owner: ${agent.owner})`);
});
import requests
response = requests.get(
'https://api.credprotocol.com/api/v2/agents/search',
params={'q': 'cred', 'page': 1, 'limit': 10},
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
data = response.json()
print(f"Found {data['total_results']} agents matching \"{data['query']}\"")
for agent in data['agents']:
name = agent['metadata']['name'] if agent.get('metadata') else 'Unknown'
print(f"Agent #{agent['agent_id']} — {name} (owner: {agent['owner']})")
{
"agents": [
{
"agent_id": 42,
"owner": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"metadata": {
"name": "Cred Score Agent",
"description": "On-chain credit scoring for DeFi protocols",
"image": "ipfs://QmExample123"
}
},
{
"agent_id": 128,
"owner": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"metadata": {
"name": "CredCheck",
"description": "Automated credential verification",
"image": "https://example.com/agent.png"
}
}
],
"total_results": 2,
"query": "cred",
"page": 1,
"limit": 10
}
{
"detail": "page must be >= 1"
}
{
"detail": [
{
"type": "missing",
"loc": ["query", "q"],
"msg": "Field required"
}
]
}
{
"detail": "Failed to search agents"
}
Agents
Search Agents
Search agents by name or description
GET
/
api
/
v2
/
agents
/
search
curl -X GET "https://api.credprotocol.com/api/v2/agents/search?q=cred&page=1&limit=10" \
-H "Authorization: Bearer YOUR_API_KEY"
const query = 'cred';
const response = await fetch(`https://api.credprotocol.com/api/v2/agents/search?q=${query}&page=1&limit=10`, {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();
console.log(`Found ${data.total_results} agents matching "${data.query}"`);
data.agents.forEach(agent => {
console.log(`Agent #${agent.agent_id} — ${agent.metadata?.name} (owner: ${agent.owner})`);
});
import requests
response = requests.get(
'https://api.credprotocol.com/api/v2/agents/search',
params={'q': 'cred', 'page': 1, 'limit': 10},
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
data = response.json()
print(f"Found {data['total_results']} agents matching \"{data['query']}\"")
for agent in data['agents']:
name = agent['metadata']['name'] if agent.get('metadata') else 'Unknown'
print(f"Agent #{agent['agent_id']} — {name} (owner: {agent['owner']})")
{
"agents": [
{
"agent_id": 42,
"owner": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"metadata": {
"name": "Cred Score Agent",
"description": "On-chain credit scoring for DeFi protocols",
"image": "ipfs://QmExample123"
}
},
{
"agent_id": 128,
"owner": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"metadata": {
"name": "CredCheck",
"description": "Automated credential verification",
"image": "https://example.com/agent.png"
}
}
],
"total_results": 2,
"query": "cred",
"page": 1,
"limit": 10
}
{
"detail": "page must be >= 1"
}
{
"detail": [
{
"type": "missing",
"loc": ["query", "q"],
"msg": "Field required"
}
]
}
{
"detail": "Failed to search agents"
}
Overview
Search across all registered agents in the ERC-8004 Identity Registry by name or description. Returns paginated results with agent metadata. The search uses a pre-built Redis index that is refreshed every 30 minutes, making queries instant even across 20,000+ agents. Matching is case-insensitive substring search on the agent’s name and description fields.This is a free endpoint (0 Cred Units).
Authentication
| Method | Header | Cost |
|---|---|---|
| API Token | Authorization: Bearer YOUR_API_KEY | 0 Cred Units |
| x402 Payment | X-PAYMENT: <signed_payment> | Free |
Query Parameters
Response
curl -X GET "https://api.credprotocol.com/api/v2/agents/search?q=cred&page=1&limit=10" \
-H "Authorization: Bearer YOUR_API_KEY"
const query = 'cred';
const response = await fetch(`https://api.credprotocol.com/api/v2/agents/search?q=${query}&page=1&limit=10`, {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();
console.log(`Found ${data.total_results} agents matching "${data.query}"`);
data.agents.forEach(agent => {
console.log(`Agent #${agent.agent_id} — ${agent.metadata?.name} (owner: ${agent.owner})`);
});
import requests
response = requests.get(
'https://api.credprotocol.com/api/v2/agents/search',
params={'q': 'cred', 'page': 1, 'limit': 10},
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
data = response.json()
print(f"Found {data['total_results']} agents matching \"{data['query']}\"")
for agent in data['agents']:
name = agent['metadata']['name'] if agent.get('metadata') else 'Unknown'
print(f"Agent #{agent['agent_id']} — {name} (owner: {agent['owner']})")
{
"agents": [
{
"agent_id": 42,
"owner": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"metadata": {
"name": "Cred Score Agent",
"description": "On-chain credit scoring for DeFi protocols",
"image": "ipfs://QmExample123"
}
},
{
"agent_id": 128,
"owner": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"metadata": {
"name": "CredCheck",
"description": "Automated credential verification",
"image": "https://example.com/agent.png"
}
}
],
"total_results": 2,
"query": "cred",
"page": 1,
"limit": 10
}
{
"detail": "page must be >= 1"
}
{
"detail": [
{
"type": "missing",
"loc": ["query", "q"],
"msg": "Field required"
}
]
}
{
"detail": "Failed to search agents"
}
Performance
- Response Time: Typically under 100ms (reads from a pre-built Redis index)
- Index Freshness: Updated every 30 minutes by a background task
- Data Source: Agent metadata from on-chain
tokenURI()calls, cached in Redis