Documentation
API Reference
Complete guide to the Bagged API: authentication, integration examples, and rate limits.
Quick Start
Base URL
https://bagged-api-production.up.railway.appAuth Header
x-api-key: bg_...Get API Key
Join waitlist →Authentication
All endpoints require the x-api-key header with your API key.
curl -H "x-api-key: bg_your_api_key" \
"https://api.bagged.life/wallet/3gQPWzizoKG4hH6ZuLEgCTScPwTHbBeQMiQHHuAAsdkD/pnl?chain=solana"Integration Guides
🐍 Python
Use the requests library to fetch wallet P&L data:
import requests
API_KEY = "bg_your_api_key_here"
BASE_URL = "https://api.bagged.life"
def get_wallet_pnl(address, chain="solana"):
headers = {"x-api-key": API_KEY}
response = requests.get(
f"{BASE_URL}/wallet/{address}/pnl",
params={"chain": chain},
headers=headers
)
return response.json()
pnl = get_wallet_pnl("3gQPWzizoKG...")
print("Realized P&L:", pnl['realizedPnlUsd'])📘 JavaScript / TypeScript
const BASE_URL = "https://api.bagged.life";
async function getWalletPnL(address, chain = "solana") {
const response = await fetch(
`${BASE_URL}/wallet/${address}/pnl?chain=${chain}`,
{ headers: { "x-api-key": process.env.REACT_APP_API_KEY } }
);
return response.json();
}
// Example usage
const pnl = await getWalletPnL("3gQPWzizo...", "solana");
console.log("Realized P&L:", pnl.realizedPnlUsd);🐚 cURL
curl -H "x-api-key: bg_your_api_key" \
"https://api.bagged.life/wallet/3gQPWzizoKG.../pnl?chain=solana"Rate Limits
| Tier | Requests/Month | Per Day |
|---|---|---|
| Free | 50,000 | ~1,600 |
| Builder | 500,000 | ~16,000 |
| Growth | 5,000,000 | ~160,000 |