Docs 1.0.0PyPIPython
Getting Started
Labs API for Python, v1
Install
Shell
pip install labs-api-python
Set your API key (authenticated endpoints)
Recommended: store your key in the environment as LABS_API_KEY.
Shell
1# Windows (PowerShell)2$env:LABS_API_KEY = "YOUR_API_KEY"34# Linux/macOS5export LABS_API_KEY="YOUR_API_KEY"
Initialize the client
Create a LabsApiClient and start calling endpoints.
Python
1from labs import LabsApiClient23# Uses the LABS_API_KEY environment variable if present4client = LabsApiClient()56# Or pass the key directly7client = LabsApiClient(api_key="YOUR_API_KEY")89# Synchronous usage10bots = client.list_bots(limit=5)11print(bots)
Async Client
For high-performance applications, use the AsyncLabsApiClient.
Python
1import asyncio2from labs import AsyncLabsApiClient34async def main():5 async with AsyncLabsApiClient() as client:6 bots = await client.list_bots(limit=5)7 print(bots)89asyncio.run(main())
Post bot stats (requires API key)
Python
1with LabsApiClient() as client:2 res = client.post_stats(3 bot_id="YOUR_BOT_CLIENT_ID",4 guild_count=1500,5 user_count=250000,6 )7 print(res)
Next steps
Need more help?
Ask in our Discord or email support@conscherry.com.