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
string
required
Search query (matches against agent name or description). Minimum 1 character.
integer
default:"1"
Page number (must be >= 1)
integer
default:"20"
Number of agents per page (1-100)
Response
array
Array of matching agent objects on this page
integer
The ERC-8004 agent ID (ERC-721 token ID)
string
Ethereum address of the agent’s owner (checksummed)
object
Agent registration metadata from tokenURI (null if unavailable)
string
Agent name from registration metadata
string
Agent description from registration metadata
string
Agent image URI from registration metadata
integer
Total number of agents matching the query
string
The search query that was used
integer
Current page number
integer
Number of agents per page
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