surchi-sdk package is the official Python client for the SURCHI API. It ships with both a synchronous client for scripting and standard web frameworks and an asynchronous client built on httpx for high-throughput applications and async frameworks such as FastAPI or asyncio-based pipelines.
Installation
Requirements
- Python 3.8 or later — the SDK uses
dataclasses,typing, andasynciofeatures available from 3.8 onwards. httpx— installed automatically as a dependency. You do not need to install it separately.
Initialization
You can construct either the synchronousSurchi client or the asynchronous AsyncSurchi client. Both accept the same constructor arguments.
Tokens Module
Useclient.tokens to look up token metadata, prices, and holder data for any address across supported networks.
Wallets Module
client.wallets surfaces on-chain behavior, profit/loss calculations, and current portfolio composition for any wallet address.
Contracts Module
client.contracts runs the SURCHI AI audit engine against a contract address and returns a structured report covering honeypot detection, ownership risks, and a plain-language summary.
Async Usage
UseAsyncSurchi when you need to run multiple requests concurrently or when you’re inside an async framework. The async client supports the context manager protocol so connections are properly closed when the block exits.
Error Handling
Import the exception classes fromsurchi.exceptions to handle rate limits, missing resources, and general API errors independently.