Skip to main content

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 statistics
  • get_dashboard_stats() - Get dashboard metrics
  • get_launchpad_stats() - Get launchpad statistics

Token Information

  • get_all_tokens(limit=None) - Get all tokens
  • get_new_tokens(limit=None) - Get newly created tokens
  • get_migrated_tokens(limit=None) - Get migrated tokens

Wallet Analytics

  • get_wallet_basic(address) - Get basic wallet information
  • get_wallet_pnl(address, days=None) - Get wallet PnL data
  • get_wallet_token_pnl(address, token) - Get PnL for specific token
  • get_wallet_trades(address, limit=None) - Get wallet trade history
  • get_wallet_chart(address, days=None) - Get wallet performance chart
  • get_wallets_batch_pnl(addresses) - Get PnL for multiple wallets

Top Traders

  • get_top_traders_all(page=None) - Get all top traders
  • get_top_traders_for_token(token) - Get top traders for specific token
  • get_top_traders_by_timeframe(timeframe) - Get top traders by timeframe

First Buyers

  • get_first_buyers(token) - Get first buyers for a token
  • get_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 statistics
  • get_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

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

augmentry-1.0.2.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

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

augmentry-1.0.2-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file augmentry-1.0.2.tar.gz.

File metadata

  • Download URL: augmentry-1.0.2.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for augmentry-1.0.2.tar.gz
Algorithm Hash digest
SHA256 a7370437898e8f06e20eff88a1c3fa5857d1bd0cb576c35443d934897ed7fe9c
MD5 65aea1b18414f195056d34469677ad85
BLAKE2b-256 e81060edf2ff523dbc8683e6b806f62f59cf01a3623288f500caf47938cb482a

See more details on using hashes here.

File details

Details for the file augmentry-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: augmentry-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for augmentry-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 af8bfaeb4d5b3c713eac134dbb084763574898f32b1e285d8e9553338efafd9c
MD5 a6c9ad88e51eaffd6d02dbe913993dda
BLAKE2b-256 1f4407a79c9c9351612560cda18ffc6e86694d7c1600bb29f8ae04d5c819465a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page