Official Python SDK for the Augmentry API
Project description
Augmentry Python SDK
Official Python SDK for the Augmentry API - Access Solana market data, wallet analytics, and trading insights.
Installation
pip install augmentry
Quick Start
Async Usage (Recommended)
import asyncio
from augmentry import AugmentryClient
async def main():
async with AugmentryClient(api_key="your_api_key") as client:
# Get market stats
market_stats = await client.get_market_stats()
print(f"Total Volume: {market_stats['total_volume']}")
# Get new tokens
new_tokens = await client.get_new_tokens(limit=10)
for token in new_tokens:
print(f"Token: {token['name']} - {token['symbol']}")
# Get wallet PnL
wallet_pnl = await client.get_wallet_pnl("wallet_address_here")
print(f"Total PnL: {wallet_pnl['total_pnl']}")
# Run async function
asyncio.run(main())
Synchronous Usage
from augmentry import SyncAugmentryClient
# Create client
client = SyncAugmentryClient(api_key="your_api_key")
# Get market stats
market_stats = client.get_market_stats()
print(f"Total Volume: {market_stats['total_volume']}")
# Get new tokens
new_tokens = client.get_new_tokens(limit=10)
for token in new_tokens:
print(f"Token: {token['name']} - {token['symbol']}")
# Get wallet PnL
wallet_pnl = client.get_wallet_pnl("wallet_address_here")
print(f"Total PnL: {wallet_pnl['total_pnl']}")
Authentication
Get your API key from the Augmentry Dashboard and initialize the client:
from augmentry import AugmentryClient
client = AugmentryClient(
api_key="ak_your_api_key_here",
base_url="https://data.augmentry.io", # Optional, this is the default
timeout=10 # Optional timeout in seconds
)
Available Endpoints
Market Data
get_market_stats()- Get overall market statisticsget_dashboard_stats()- Get dashboard metricsget_launchpad_stats()- Get launchpad statistics
Token Information
get_all_tokens(limit=None)- Get all tokensget_new_tokens(limit=None)- Get newly created tokensget_migrated_tokens(limit=None)- Get migrated tokens
Wallet Analytics
get_wallet_basic(address)- Get basic wallet informationget_wallet_pnl(address, days=None)- Get wallet PnL dataget_wallet_token_pnl(address, token)- Get PnL for specific tokenget_wallet_trades(address, limit=None)- Get wallet trade historyget_wallet_chart(address, days=None)- Get wallet performance chartget_wallets_batch_pnl(addresses)- Get PnL for multiple wallets
Top Traders
get_top_traders_all(page=None)- Get all top tradersget_top_traders_for_token(token)- Get top traders for specific tokenget_top_traders_by_timeframe(timeframe)- Get top traders by timeframe
First Buyers
get_first_buyers(token)- Get first buyers for a tokenget_tokens_batch_first_buyers(tokens)- Get first buyers for multiple tokens
AI Analysis
get_ai_analysis(token_address)- Get AI analysis for a token
API Usage
get_usage_stats(days=30)- Get your API usage statisticsget_recent_usage(limit=50)- Get recent API usage
Health Check
health_check()- Check API health status
Error Handling
The SDK provides specific exception types for different error scenarios:
from augmentry import AugmentryClient, AugmentryError, AuthenticationError, RateLimitError
try:
async with AugmentryClient(api_key="invalid_key") as client:
data = await client.get_market_stats()
except AuthenticationError:
print("Invalid API key")
except RateLimitError:
print("Rate limit exceeded")
except AugmentryError as e:
print(f"API error: {e}")
Examples
Analyze Top Performing Wallets
import asyncio
from augmentry import AugmentryClient
async def analyze_top_wallets():
async with AugmentryClient(api_key="your_api_key") as client:
# Get top traders
top_traders = await client.get_top_traders_all()
# Analyze top 5 wallets
for trader in top_traders['data'][:5]:
wallet_address = trader['wallet_address']
# Get detailed PnL
pnl_data = await client.get_wallet_pnl(wallet_address, days=7)
# Get recent trades
trades = await client.get_wallet_trades(wallet_address, limit=10)
print(f"Wallet: {wallet_address}")
print(f"7-day PnL: ${pnl_data['total_pnl']:.2f}")
print(f"Recent trades: {len(trades)}")
print("---")
asyncio.run(analyze_top_wallets())
Monitor New Token Launches
import asyncio
from augmentry import AugmentryClient
async def monitor_new_tokens():
async with AugmentryClient(api_key="your_api_key") as client:
# Get latest tokens
new_tokens = await client.get_new_tokens(limit=20)
for token in new_tokens:
# Get first buyers for each token
first_buyers = await client.get_first_buyers(token['mint'])
# Get AI analysis
try:
analysis = await client.get_ai_analysis(token['mint'])
sentiment = analysis.get('sentiment', 'Unknown')
except:
sentiment = 'N/A'
print(f"Token: {token['name']} ({token['symbol']})")
print(f"Market Cap: ${token.get('market_cap', 0):,.2f}")
print(f"First Buyers: {len(first_buyers)}")
print(f"AI Sentiment: {sentiment}")
print("---")
asyncio.run(monitor_new_tokens())
Track Portfolio Performance
import asyncio
from augmentry import AugmentryClient
async def track_portfolio(wallet_addresses):
async with AugmentryClient(api_key="your_api_key") as client:
# Get batch PnL data
batch_pnl = await client.get_wallets_batch_pnl(wallet_addresses)
total_pnl = 0
for wallet_data in batch_pnl['data']:
wallet_pnl = wallet_data['total_pnl']
total_pnl += wallet_pnl
print(f"Wallet: {wallet_data['wallet_address']}")
print(f"PnL: ${wallet_pnl:,.2f}")
print(f"\nTotal Portfolio PnL: ${total_pnl:,.2f}")
# Example usage
wallets = ["wallet1", "wallet2", "wallet3"]
asyncio.run(track_portfolio(wallets))
Rate Limits
The API has rate limits in place. The SDK will automatically handle rate limit errors by raising a RateLimitError exception. You should implement appropriate backoff strategies in your application.
Support
- Documentation: https://docs.augmentry.io
- API Dashboard: https://augmentry.io/dashboard
- Issues: GitHub Issues
- Email: support@augmentry.io
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file augmentry-1.0.0.tar.gz.
File metadata
- Download URL: augmentry-1.0.0.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
337fdb5a4f3a00403af884c3f64554ed14c3fd4df70937f3aa1fd8e77b6ed828
|
|
| MD5 |
9a2213ed8a6c00305803738ed11b45c5
|
|
| BLAKE2b-256 |
e18ea718e380fd9d9806bb934d2ca44b98d72a2848aea0783da9639ecf130e67
|
File details
Details for the file augmentry-1.0.0-py3-none-any.whl.
File metadata
- Download URL: augmentry-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30aff1a2c94751e7db9c816307e404468de21d887ab3ab49fb9f69057dc72114
|
|
| MD5 |
e171741dc909a5a09f76f85f02b1bbbd
|
|
| BLAKE2b-256 |
2109f0792df884cd83e2abbbc3bf0fb0f300be565aa9c107aa174cca8b8b556c
|