The powerbot-client library provides an asynchronous Python client for interacting with the PowerBot API. It allows users to fetch market data, manage orders, and access other platform functionalities. The current version is 2.30.6 and it maintains a relatively frequent release cadence, often aligning with API updates.
pip install powerbot-clientVerified import paths — ran on the pinned version, not inferred.
This quickstart initializes the PowerBotClient with an API key from an environment variable, fetches a list of markets, prints the first three, and ensures the client connection is properly closed. It demonstrates the basic asynchronous usage pattern required by the library.
Refer to the v2.0.0+ documentation and examples. A full migration of existing v1.x code is required.
Always prepend `await` when calling methods that are `async def`.
Always ensure `await client.close()` is called, ideally within a `finally` block or an `async with` statement (if supported, current version uses explicit close).
If an event loop is already running, use `asyncio.create_task()` or `loop.run_until_complete()` instead of `asyncio.run()` for new coroutines. For simple scripts, ensure `asyncio.run()` is only called once at the top level.