SDK to access Xerberus GraphQL metrics API
Project description
Xerberus Metrics Python SDK
A lightweight Python SDK for accessing blockchain token metrics from the Xerberus GraphQL API.
Features
- Query token metrics with filters like chain, date, and address
- Sort and paginate metric data
- Access available chains and whitelisted tokens
- Auto-generated GraphQL queries
- Ready for deployment and integration
Installation
pip install xerberus-metrics-sdk
Or clone locally for development:
git clone https://github.com/XerberusTeam/xerberus-metrics-sdk.git
cd xerberus-metrics-sdk
pip install -e .
SETUP
Create a .env file in the root:
API_KEY=your-api-key-here
USAGE
from xerberus.client import XerberusMetricsClient
client = XerberusMetricsClient()
result = client.metrics_get(
date=["2025-03-18"],
chain=["ethereum"],
sort_by="wallet_count",
sort_order="DESC",
limit=5
)
for metric in result["metrics"]:
print(metric["token"]["symbol"], metric["wallet_count"])
GraphQL Documentation
For documentation regarding the GraphQL go to: https://xerberus.gitbook.io/documentation
Available Metrics Fields
Token Field Reference
These are the fields you can expect in the token_get() response:
| Field | Type | Description | Sortable |
|---|---|---|---|
asset_id |
Int | Internal asset identifier | ✅ |
symbol |
String | Token Symbol | ✅ |
chain |
String | Blockchain name (e.g., ETHEREUM) | ✅ |
address |
String | Token contract address | ✅ |
Metrics Fields Reference
These are the fields you can expect in the metrics_get() response:
| Field | Type | Description | Sortable |
|---|---|---|---|
asset_id |
Int | Internal asset identifier | ✅ |
chain |
String | Blockchain name (e.g., ETHEREUM) | ✅ |
partition_date |
String | Date of the metric snapshot (YYYY-MM-DD) | ✅ |
wallet_count |
Int | Number of wallets holding the token | ✅ |
wallet_count_change_1D |
Int | Wallet count change over 1 day | ✅ |
wallet_count_change_7D |
Int | Wallet count change over 7 days | ✅ |
wallet_count_change_30D |
Int | Wallet count change over 30 days | ✅ |
wallet_count_change_90D |
Int | Wallet count change over 90 days | ✅ |
wallet_count_change_365D |
Int | Wallet count change over 365 days | ✅ |
typical_price |
Float | Average token price | ✅ |
pct_price_change_1D |
Float | 1-day % price change | ✅ |
price_change_7D |
Float | 7-day price change | ✅ |
price_change_30D |
Float | 30-day price change | ✅ |
price_change_90D |
Float | 90-day price change | ✅ |
price_change_180D |
Float | 180-day price change | ✅ |
price_change_365D |
Float | 365-day price change | ✅ |
life_cycle_v1 |
Float | Token life cycle score | ✅ |
diversity |
Float | Diversity metric (wallet spread) | ✅ |
dominance |
Float | Dominance metric | ✅ |
assortativity |
Float | Assortativity metric | ✅ |
risk_rating |
String | Xerberus Risk Rating (AAA, BB, etc.) | ❌ |
risk_score |
Float | Xerberus Risk Score | ❌ |
token.symbol |
String | Token symbol (e.g., USDC, WETH) | ❌ |
token.address |
String | Token contract address | ❌ |
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xerberus_metrics_sdk-0.1.1.tar.gz.
File metadata
- Download URL: xerberus_metrics_sdk-0.1.1.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e2fe15765b2ef940b61f7af93c8591294afd6ddfdef2408f4aa459d986c00d8
|
|
| MD5 |
5245833977535b6caa7c9b47af69d80b
|
|
| BLAKE2b-256 |
ddda5e5d257b553b55628d63e03b2e6874b8008630d3377d4e2fa23ef95389fd
|
File details
Details for the file xerberus_metrics_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: xerberus_metrics_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99884894da77d7f0ce211e5ff85288fa3e814d0ce242ba97a6a118e8f0c68ef2
|
|
| MD5 |
243d6c62ab7f6ada64d6183e33344ccf
|
|
| BLAKE2b-256 |
ecb8663d3abaf0d700f76bdb20266972f3fcef052eb4ea2cacd03089cb7abcdd
|