Skip to main content

Installation

pip install agentscore

Quick start

from agentscore import AgentScore

client = AgentScore(api_key="your-api-key")

# Summary lookup (free tier)
summary = client.reputation("0xdb5aa553feeb2c3e3d03e8360b36fb0f7e480671")
print(summary.score, summary.grade)

# Full lookup with decision (paid tier)
full = client.reputation(
    "0xdb5aa553feeb2c3e3d03e8360b36fb0f7e480671",
    view="full",
    min_grade="B",
    min_transactions=5,
)

if not full.decision.allow:
    print("Denied:", full.decision.reasons)

API reference

Constructor

AgentScore(
    api_key: str,
    base_url: str = "https://api.agentscore.sh",
    timeout: float = 10.0,
)

client.reputation(address, **kwargs)

Look up a wallet’s reputation.
result = client.reputation(
    address,
    view="full",           # "summary" (default) or "full"
    min_grade="B",         # optional, paid
    min_transactions=5,    # optional, paid
)

client.batch(addresses, **kwargs)

Score multiple wallets. Paid tier only.
result = client.batch(
    addresses=[
        "0xdb5aa553feeb2c3e3d03e8360b36fb0f7e480671",
        "0x447e981bd3d8267499860ff0f9afbc9f8ffcc514",
    ],
    policy={"min_grade": "B", "min_transactions": 5},
    view="summary",
)

for r in result.results:
    print(r.address, r.decision.allow, r.decision.reasons)

client.health()

health = client.health()
print(health.status)  # "healthy"

client.stats()

stats = client.stats()
print(f"{stats.wallets_scored} wallets scored")

Async support

from agentscore import AsyncAgentScore

client = AsyncAgentScore(api_key="your-api-key")

result = await client.reputation("0xdb5aa553feeb2c3e3d03e8360b36fb0f7e480671")

Error handling

from agentscore import AgentScoreError

try:
    rep = client.reputation("0xinvalid")
except AgentScoreError as e:
    print(e.code)     # "invalid_address"
    print(e.message)  # "The provided wallet address is not a valid EVM address."
    print(e.status)   # 400

Environment variable

The SDK reads AGENTSCORE_API_KEY from the environment if no api_key is passed:
export AGENTSCORE_API_KEY=sk_live_abc123...
client = AgentScore()  # uses AGENTSCORE_API_KEY