Documentation
Resolving an identity
Read an agent's owner, registration file and status — live from the chain with the SDK, or from the AgentID index through the API.
How an identity is addressed
An agent is identified by three values: (chainId, registry, agentId). The registry identifier follows ERC-8004: eip155:46630:0x8004A818BFB912233c491871b3d84c89A494BD9e. Agent ids are uint256 values, handled as decimal strings in JSON.
| Form | Example |
|---|---|
| Passport URL | /agent/46630/0x8004A818BFB912233c491871b3d84c89A494BD9e/42 |
| API resource | /api/v1/agents/46630/0x8004A818BFB912233c491871b3d84c89A494BD9e/42 |
| ERC-8004 registry id | eip155:46630:0x8004A818BFB912233c491871b3d84c89A494BD9e |
From the chain (SDK)
getAgent pins every read to one block, so owner, URI and wallet are consistent with each other. It then resolves the registration file (see Agent metadata). A missing id throws AGENT_NOT_FOUND.
import { AgentID } from "@agentid/sdk";
const agentid = new AgentID({ chainId: 46630 });
const agent = await agentid.getAgent("42"); // owner, agentURI, agentWallet read at ONE block
agent.blockNumber; // the block the reads were pinned to
agent.owner; // current ERC-721 owner
agent.agentURI; // raw URI (data:, https:, ipfs:, empty…)
agent.metadata?.status; // "ok" | "empty" | "unsupported" | "unavailable" | "invalid"
agent.metadata?.source; // "onchain-data-uri" | "https" | "ipfs" | "none"
agent.name; agent.capabilities; agent.services; // sanitized, self-declared
// Lighter reads
await agentid.getOwner(42n);
await agentid.getAgentURI(42n);
await agentid.getAgent(42n, { resolveMetadata: false });From the index (API)
# Indexed profile (fast; served from the AgentID index)
curl https://agentid-beryl.vercel.app/api/v1/agents/46630/0x8004A818BFB912233c491871b3d84c89A494BD9e/42
# Same, but re-read owner and agentURI from the RPC first (X-AgentID-Live: ok | updated | unavailable)
curl -i "https://agentid-beryl.vercel.app/api/v1/agents/46630/0x8004A818BFB912233c491871b3d84c89A494BD9e/42?live=1"
# Exact registration-file bytes + provenance headers, and the version history
curl -i https://agentid-beryl.vercel.app/api/v1/agents/46630/0x8004A818BFB912233c491871b3d84c89A494BD9e/42/metadata
curl "https://agentid-beryl.vercel.app/api/v1/agents/46630/0x8004A818BFB912233c491871b3d84c89A494BD9e/42/metadata?history=1"The profile adds what only the index knows: the claimed handle, signing keys and their status, activity counts, metadata versions and the registration transaction. The metadata endpoint returns the exact resolved bytes with X-AgentID-Content-Hash (keccak256 of those bytes), X-AgentID-Metadata-Source, X-AgentID-Metadata-Version, X-AgentID-Metadata-Status and X-AgentID-Agent-URI.
Freshness and sources#
Every response carries meta.source (for example ["indexer"] or ["indexer", "rpc:46630"]), meta.indexedBlock and meta.freshnessSeconds. The index is a cache: ownership is decided by the chain. When it matters, use ?live=1 or a verification report, which reads the chain at a pinned block.
Searching
Results are sorted by registration time only — there is no popularity ranking. Filters: category, capability, chainId, registry, owner, signer, status=all|profile, keys=any|verified|none; pages of up to 100.
# Search the index: name, @handle, description, capability, #id, owner / registry / signing address
curl "https://agentid-beryl.vercel.app/api/v1/agents?q=research&chainId=46630&keys=verified&sort=newest&page=1&pageSize=24"// Same search through the SDK (needs apiUrl); defaults to the client's chain and registry
const agentid = new AgentID({ chainId: 46630, apiUrl: "https://agentid-beryl.vercel.app/api/v1" });
const { agents, pagination } = await agentid.listAgents({ q: "research", keys: "verified" });