ZentraScore
On-chain ScoringFeaturesPricing
API Reference / Introduction

Getting started

ZentraScore API v1

A REST API for on-chain credit scoring. Index wallet behaviour across 18+ DeFi protocols and expose credit scores directly to your lending contracts, risk systems, and user interfaces.

Base URL

https://api.zentrascore.io/v1

Sandbox

https://sandbox.zentrascore.io/v1

Response format

JSON · ISO 8601 timestamps · Native token units

SDKs available

@zentrascore/sdk (JS/TS) · zentrascore-py · go-zentrascore

All endpoints are available on both production and sandbox. Sandbox scores are deterministic — the same address always returns the same score for testing.

Quick start

Up in 5 minutes

Install the SDK, paste your API key, and make your first score request — that's it.

1

Install the SDK

npm install @zentrascore/sdk

2

Set your API key

ZENTRASCORE_API_KEY=cs_live_xxxx

3

Make your first request

client.score.get('0x...')

# Install the JavaScript / TypeScript SDK
npm install @zentrascore/sdk

# Add your key to .env
ZENTRASCORE_API_KEY=cs_live_xxxxxxxxxxxx

# Make your first call
import ZentraScore from '@zentrascore/sdk';
const cs = new ZentraScore({ apiKey: process.env.ZENTRASCORE_API_KEY });
const result = await cs.score.get('0x71C7...');
console.log(result.score); // 734

Authentication

API Keys

All API requests require a Bearer token in the Authorization header. Keys are prefixed with cs_live_ for production and cs_test_ for sandbox.

Never expose API keys in client-side code. For browser apps, proxy requests through your backend. For smart contracts, use the on-chain oracle directly.
curl https://api.zentrascore.io/v1/score/0x71C7...
  -H "Authorization: Bearer cs_live_xxxxxxxxxxxx"

Errors & Limits

Errors & Rate Limits

ZentraScore uses conventional HTTP status codes. Errors include a machine-readable code and a human-readable message.

CodeMeaningCommon cause
200SuccessRequest completed normally
400Bad requestMissing or invalid parameter
401UnauthorizedInvalid or missing API key
404Not foundWallet has no scoring history
429Rate limitedCheck X-RateLimit-Reset header

Rate limits by plan

PlanRequests / minBatch sizeDaily queries
Consumer10100
Protocol API30050050,000
Analytics601,00010,000
EnterpriseCustomCustomUnlimited

Scoring

Get score

Retrieve the current credit score and full factor breakdown for a wallet address. Scores are cached for 1 hour; pass fresh=true to force recomputation.

GET/score/{address}

Returns the ZentraScore for a given Ethereum address. If the wallet has no history or fails hard gates (age < 180 days), returns 404.

Path parameters

NameTypeRequiredDescription
addressstringrequiredChecksummed Ethereum address (EIP-55)

Query parameters

NameTypeRequiredDescription
freshbooleanoptionalForce recomputation, costs 5× query credit
include_historybooleanoptionalInclude 12-month score history in response
chainsstring[]optionalChain IDs to include. Default: 1,42161,8453
curl -G https://api.zentrascore.io/v1/score/0x71C7656EC7ab88b098defB751B7401B5f6d8973F
  -d fresh=false -d include_history=true
  -H "Authorization: Bearer cs_live_xxxxxxxxxxxx"

Example response

{
  "address": "0x71C7656EC7ab88b098defB751B7401B5f6d8973F",
  "score": 734,
  "grade": "Good",
  "valid": true,
  "factors": {
    "repaymentHistory":  { "score": 84, "weight": 0.35 },
    "liquidationRecord": { "score": 90, "weight": 0.20 },
    "walletAge":          { "score": 55, "weight": 0.15 }
  },
  "loanTerms": { "maxLtvBps": 8000, "interestRateBps": 720 }
}

Live sandbox — paste any Ethereum address


POST/score/batch
GET/score/{address}/history
GET/score/{address}/loan-terms

Webhooks

Webhooks

Receive real-time POST requests when a wallet's score changes. Payloads are signed with HMAC-SHA256.

POST/webhooks
GET/webhooks
DEL/webhooks/{id}

On-chain Oracle

Oracle

The on-chain oracle writes scores to the CreditScoreOracle contract on each supported chain. Smart contracts read scores directly — zero API cost, fully trustless.

GET/oracle/status
POST/oracle/update

Analytics

Portfolio risk

Aggregate risk metrics for a portfolio of borrowers. Available on Analytics and Enterprise plans.

POST/analytics/portfolio