Skip to main content

algorand-x402-client

Python Indexer client that wraps AlgoKit Utils and py-algorand-sdk IndexerClient:

Backend Default origin Auth Data
.free Nodely / AlgoNode (AlgoKit getAlgoNodeConfig) none full archival Indexer v2
.paid https://api.algorand-indexer.xyz x402 USDC (exact / AVM) private full Indexer (genesis → tip)

The library does not reimplement Indexer REST. It injects HTTP under the official IndexerClient so lookups, searches, and pagination stay upstream.

Paid and free backends share the same Indexer contract (complete history). They differ by billing and rate limits. There is no silent “try Nodely, then pay” default — that would spend USDC on 429s.

Install

Python 3.10+:

pip install algorand-x402-client
# or: uv add algorand-x402-client

Usage

import os

from algorand_x402_client import Payer, configure_logging, create_algorand_indexer, get_logger

configure_logging()  # stderr + algorand-x402-client.log
logger = get_logger(__name__)
indexer_client = create_algorand_indexer(
    "mainnet",
    payer=Payer(mnemonic=os.environ["BUYER_MNEMONIC"]),  # omit for free-only
)

# Nodely — never sends PAYMENT-SIGNATURE, never spends USDC
account = indexer_client.free.account_info("JRG3CUVOFK3YJK3QDD4IOWKMHHRCWVTEMUSYKDN7U73FQO5ZYTCC7CEBRQ")

# x402 gateway — HTTP 402 → sign USDC → retry (search tier is $0.0001)
paid = indexer_client.paid.account_info("JRG3CUVOFK3YJK3QDD4IOWKMHHRCWVTEMUSYKDN7U73FQO5ZYTCC7CEBRQ")

logger.info("gateway network=%s", indexer_client.gateway.health()["network"])
indexer_client.close()

indexer_client.free / indexer_client.paid are py-algorand-sdk IndexerClients (health(), account_info(), search_transactions(), …). indexer_client.algorand_free is AlgorandClient.from_clients with Nodely algod + the free Indexer.

Payer must be opted into USDC: MainNet 31566704, TestNet 10458941. Default max payment is 10_000 microUSDC ($0.01).

Environment: BUYER_MNEMONIC, X402_BASE_URL, X402_NETWORK, ALGORAND_X402_LOG_FILE.

Docs

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

algorand_x402_client-0.1.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

algorand_x402_client-0.1.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file algorand_x402_client-0.1.0.tar.gz.

File metadata

  • Download URL: algorand_x402_client-0.1.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for algorand_x402_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0aa370e9852f2afb8d85754892613f46c39b9171ef37ec4a55e16c9277ce4d07
MD5 91c91b520cfdc64c491e72baaf58a54f
BLAKE2b-256 7aee3ef94fd8515a17933f3acdf01d8f64453becf3dc71e6df67652cc88217e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for algorand_x402_client-0.1.0.tar.gz:

Publisher: release.yml on thecryptomie/algorand-x402-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file algorand_x402_client-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for algorand_x402_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fec188b9920abef9c3d5d04223f61a4e61ba53dc0b9ac7ac686aa2d15dfdad7c
MD5 14f337c1009d5d641c131ca071a2cb0c
BLAKE2b-256 17b5e4416b5f5dbff15aec12ffe14a92b218792880e893772c1c2f80e6612c3e

See more details on using hashes here.

Provenance

The following attestation bundles were made for algorand_x402_client-0.1.0-py3-none-any.whl:

Publisher: release.yml on thecryptomie/algorand-x402-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.0

2 files

0.1.1

2 files

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page