Skip to main content
The 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, and asyncio features 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 synchronous Surchi client or the asynchronous AsyncSurchi client. Both accept the same constructor arguments.

Tokens Module

Use client.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

Use AsyncSurchi 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 from surchi.exceptions to handle rate limits, missing resources, and general API errors independently.