CoreMesh Instant
PYTHON EXAMPLE

Call CoreMesh Instant from Python

Use the official Python x402 client with httpx and a locally controlled Base wallet.

pip install "x402[httpx]" eth-account

import asyncio
import os
from eth_account import Account
from x402 import x402Client
from x402.http import x402HTTPClient
from x402.http.clients import x402HttpxClient
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client

async def main():
    client = x402Client()
    account = Account.from_key(os.environ["EVM_PRIVATE_KEY"])
    register_exact_evm_client(client, EthAccountSigner(account))
    parser = x402HTTPClient(client)
    async with x402HttpxClient(client) as http:
        response = await http.get(
            "https://instant.coremesh.online/v1/domain-report",
            params={"domain": "example.com"},
        )
        await response.aread()
        print(response.json())
        print(parser.get_payment_settle_response(lambda name: response.headers.get(name)))

asyncio.run(main())
Use a dedicated buyer wallet with a strict spending limit. CoreMesh Instant never asks for or stores the buyer's private key.