anaxer
Official Python SDK for the Anaxer Solana real-time data API.
pip install anaxer
Requires Python 3.10+.
Quickstart — async streaming
import asyncio
import anaxer
async def main():
async with anaxer.connect(api_key="...") as client:
# Plan limits from the server `connected` frame
print(client.connected.connections_per_stream)
async with client.stream("creations", exclude_mayhem=True) as sub:
async for event in sub:
print("new launch:", event.symbol, event.mint)
break
asyncio.run(main())
stream() returns a Subscription[T] handle (async-iterable + async context manager).
Prefer async with client.stream(...) as sub: so leaving the block always sends
unsubscribe. Bare async for / break also unsubscribes (via GeneratorExit).
Channels
| Channel | Yields | Filters (keyword-only, snake_case) |
|---|---|---|
trades |
SwapV1 |
sources, mints, wallets, min_volume_usd, max_volume_usd, sol_only |
creations |
CreatedV1 |
sources, enriched, exclude_mayhem |
graduations |
GraduatedV1 |
sources, exclude_mayhem, min_liquidity_sol |
prices |
PriceUpdateV1 |
sources, mints |
transfers is not wired in v1 (server ingestion deferred). TransferV1 is still
exported as a type.
Side-channel errors
Reconnect-triggering / non-fatal codes (e.g. slow_consumer) are delivered on
client.on_error(callback) and/or async for err in client.errors — they never
interrupt an open Subscription's async for. Subscription-fatal codes
(invalid_filters, …) raise from that subscription only. unauthorized is
terminal.
Quickstart — sync REST
from anaxer import Client
client = Client(api_key="...")
price = client.tokens.price("3PFaeFMXiRVYueDCnHHSKndKDDpKZhbhFjQ13JXYpump")
print(price.price.usd)
client.close()
Client is REST-only — it has no stream() method. Use it when you do not want a
WebSocket. AsyncClient (from anaxer.connect) also exposes the same REST surface
via await.
REST surface
tokens.get/batch/price/batch_price/tradescreations/iter_creationsgraduations/iter_graduationsiter_trades(mint, ...)launchpads.stats
programs() is omitted in v1 (response type not in the public schemas).
List endpoints return a Page (data, next, window). Use iter_* to walk
next across pages. Wire field from is exposed in Python as from_
(reserved word) with a Pydantic alias so round-trips keep the wire key.
Auth is always Authorization: Bearer <api_key> (same as the TypeScript SDK).
No gap recovery in v1
The WebSocket protocol has no sequence/cursor. After a disconnect the client reconnects and re-subscribes, but events during the gap are not replayed.
Config
from anaxer import Reconnect, connect
async with connect(
api_key="...",
base_url="https://api.anaxer.com", # local: http://localhost:3010
reconnect=Reconnect(base_delay=0.5, max_delay=30.0, max_retries=None),
heartbeat_interval=15.0, # 0 disables
rest_max_retries=2,
) as client:
...
Errors
All failures surface as anaxer.AnaxerError with .code, .message, .status
(HTTP only), and .subscription_id (subscription-fatal WS errors only).
SDK-local codes: connection_closed, timeout, invalid_payload (client-side
parse failure — distinct from the wire's invalid_message).
Links
- Wire contracts:
docs/api/ws-v1.md,docs/api/rest-v1.md - System doc:
docs/system/sdk-py.md - TypeScript sibling:
@anaxer/sdk
Release files for anaxer 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| anaxer-0.1.0.tar.gz | 23.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| anaxer-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 43.7 kB
Release files / anaxer-0.1.0.tar.gz
| Download URL | anaxer-0.1.0.tar.gz |
|---|---|
| Size | 23.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8698719dcb4cc0a4def2b210bcfd6e5812a048e3ff6df72bf42ce9dd48d3133
|
|
BLAKE2b-256 checksum How to use checksums |
513d7cbd0536dc574cb347735c8e76f516e3ec6e1da09817c2e60be7e1264587
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.15
|
Release files / anaxer-0.1.0-py3-none-any.whl
| Download URL | anaxer-0.1.0-py3-none-any.whl |
|---|---|
| Size | 20.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a1fb5c995185906dc307f603254a73e1850585e2ac416cd6776c10389362aada
|
|
BLAKE2b-256 checksum How to use checksums |
8e24102a7b710103adf876a5a781eb488922b293bd772240c2c4237249c6ef4a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.15
|