DJD Agent Score — Python SDK
Python SDK for DJD Agent Score — reputation scoring for AI agent wallets on Base L2.
Installation
pip install djd-agent-score
With LangChain support:
pip install djd-agent-score[langchain]
Quick Start
from djd_agent_score import AgentScoreClient
client = AgentScoreClient()
score = client.get_score("0x1234...abcd")
print(f"{score.wallet}: {score.score}/100 ({score.tier})")
Usage
Free Endpoints
from djd_agent_score import AgentScoreClient
client = AgentScoreClient()
# Basic score (10 free lookups/day per IP)
score = client.get_score("0x...")
print(score.score, score.tier, score.confidence)
# Leaderboard
lb = client.get_leaderboard()
for entry in lb.leaderboard[:5]:
print(f"#{entry.rank} {entry.wallet} — {entry.score} ({entry.tier})")
# Register an agent
reg = client.register_agent(
"0x...",
name="MyAgent",
description="Autonomous trading agent",
github_url="https://github.com/user/repo",
)
Paid Endpoints (API Key Required)
client = AgentScoreClient(api_key="djd_live_...")
# Full dimensional breakdown ($0.10)
full = client.get_full_score("0x...")
print(full.dimensions.reliability.score)
print(full.sybil_flag, full.gaming_indicators)
print(full.trajectory)
# Score history with trend analysis ($0.15)
history = client.get_score_history("0x...", limit=20)
print(history.trend, history.trajectory)
# Batch scoring ($0.50 flat for 2-20 wallets)
batch = client.get_batch_scores(["0x...", "0x...", "0x..."])
for result in batch.results:
print(f"{result.wallet}: {result.score}")
# Force fresh recalculation ($0.25)
fresh = client.refresh_score("0x...")
Async Client
import asyncio
from djd_agent_score import AsyncAgentScoreClient
async def main():
async with AsyncAgentScoreClient(api_key="djd_live_...") as client:
score = await client.get_score("0x...")
print(score.tier)
asyncio.run(main())
Error Handling
from djd_agent_score import AgentScoreClient
from djd_agent_score.exceptions import RateLimitError, ValidationError, NotFoundError
client = AgentScoreClient()
try:
score = client.get_score("0xinvalid")
except ValidationError as e:
print(f"Bad request: {e}")
except RateLimitError as e:
print(f"Rate limited: {e}")
except NotFoundError as e:
print(f"Not found: {e}")
LangChain Integration
from djd_agent_score.langchain import AgentScoreToolkit
toolkit = AgentScoreToolkit(api_key="djd_live_...")
tools = toolkit.get_tools()
# Use with any LangChain agent
from langchain.agents import initialize_agent
agent = initialize_agent(tools, llm, agent="zero-shot-react-description")
agent.run("Is wallet 0x... trustworthy? Check its agent score.")
API Reference
| Method | Endpoint | Price | Description |
|---|---|---|---|
get_score(wallet) |
GET /v1/score/basic | Free (10/day) | Basic score + tier |
get_full_score(wallet) |
GET /v1/score/full | $0.10 | Full dimensional breakdown |
refresh_score(wallet) |
POST /v1/score/refresh | $0.25 | Force live recalculation |
get_score_history(wallet) |
GET /v1/score/history | $0.15 | Historical scores + trend |
get_batch_scores(wallets) |
POST /v1/score/batch | $0.50 | 2-20 wallets at once |
get_leaderboard() |
GET /v1/leaderboard | Free | Top-ranked agents |
register_agent(wallet, ...) |
POST /v1/agent/register | Free | Register on the network |
report_fraud(target, ...) |
POST /v1/report | $0.02 | Submit fraud report |
Environment Variables
| Variable | Description |
|---|---|
DJD_AGENT_SCORE_API_KEY |
API key for paid endpoints |
DJD_AGENT_SCORE_BASE_URL |
Custom API base URL (default: https://djdagentscore.dev) |
Links
- API Documentation
- OpenAPI Spec
- MCP Server — for Claude, GPT, and other LLM agents
- TypeScript SDK
License
MIT — see LICENSE.
Release files for djd-agent-score 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| djd_agent_score-0.1.0.tar.gz | 11.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| djd_agent_score-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.0 kB
Release files / djd_agent_score-0.1.0.tar.gz
| Download URL | djd_agent_score-0.1.0.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7c28a7a55fcaac7deda471b4607b55415e5ff1e495c66aff71cc0b3013ed47e4
|
|
BLAKE2b-256 checksum How to use checksums |
aac7d8b530b722bd099d557c8fdb9c398ee0770c3367dd820dc99b5f261310e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / djd_agent_score-0.1.0-py3-none-any.whl
| Download URL | djd_agent_score-0.1.0-py3-none-any.whl |
|---|---|
| Size | 14.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fd93ac49697aa051708512e0bf13416a2a4a13a2643865ea6279485c66724e2a
|
|
BLAKE2b-256 checksum How to use checksums |
504accca5f9573767202612b687dd3eb0a3c7753d27259d204e4571bc0aa78fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|