$npx -y skills add agiprolabs/claude-trading-skills --skill birdeye-apiSolana token market data via Birdeye — prices, OHLCV, trades, token metadata, security checks, and trader activity
| 1 | # Birdeye API — Solana Market Data |
| 2 | |
| 3 | Birdeye aggregates market data across all Solana DEXes (and 13 other chains). Prices, OHLCV candles, trade history, token metadata, security info, and wallet analytics. Primary data source for Solana token research and historical analysis. |
| 4 | |
| 5 | **Note**: For real-time trading systems, use Yellowstone gRPC (see `yellowstone-grpc` skill). Birdeye is best for historical data, research, and analysis workflows. |
| 6 | |
| 7 | ## Quick Start |
| 8 | |
| 9 | ### 1. Get an API Key |
| 10 | |
| 11 | Sign up at [birdeye.so](https://birdeye.so) — free tier: 30K compute units/month, 1 req/sec. |
| 12 | |
| 13 | ```bash |
| 14 | export BIRDEYE_API_KEY="your-api-key" |
| 15 | ``` |
| 16 | |
| 17 | ### 2. Install Dependencies |
| 18 | |
| 19 | ```bash |
| 20 | uv pip install httpx pandas python-dotenv |
| 21 | ``` |
| 22 | |
| 23 | ### 3. First Request |
| 24 | |
| 25 | ```python |
| 26 | import httpx, os |
| 27 | |
| 28 | API_KEY = os.environ["BIRDEYE_API_KEY"] |
| 29 | headers = {"X-API-KEY": API_KEY, "x-chain": "solana", "accept": "application/json"} |
| 30 | |
| 31 | # Get SOL price |
| 32 | resp = httpx.get( |
| 33 | "https://public-api.birdeye.so/defi/price", |
| 34 | headers=headers, |
| 35 | params={"address": "So11111111111111111111111111111111111111112"}, |
| 36 | ) |
| 37 | price = resp.json()["data"]["value"] |
| 38 | print(f"SOL: ${price}") |
| 39 | ``` |
| 40 | |
| 41 | ## Core Endpoints |
| 42 | |
| 43 | All endpoints use base URL `https://public-api.birdeye.so` with `X-API-KEY` and `x-chain` headers. |
| 44 | |
| 45 | ### Token Price |
| 46 | |
| 47 | ```python |
| 48 | # Single token price (10 CU) |
| 49 | GET /defi/price?address=TOKEN_MINT |
| 50 | |
| 51 | # Multiple token prices (variable CU) |
| 52 | POST /defi/multi_price |
| 53 | Body: {"addresses": ["MINT1", "MINT2", "MINT3"]} |
| 54 | |
| 55 | # Price at specific timestamp (10 CU) |
| 56 | GET /defi/historical_price_unix?address=TOKEN_MINT&unixtime=1700000000 |
| 57 | |
| 58 | # Historical price series (60 CU) |
| 59 | GET /defi/history_price?address=TOKEN_MINT&address_type=token&type=15m&time_from=T1&time_to=T2 |
| 60 | ``` |
| 61 | |
| 62 | ### OHLCV Candles |
| 63 | |
| 64 | The primary endpoint for backtesting data. |
| 65 | |
| 66 | ```python |
| 67 | # Token OHLCV (40 CU, max 1000 candles per request) |
| 68 | GET /defi/ohlcv?address=TOKEN_MINT&type=15m&time_from=T1&time_to=T2 |
| 69 | ``` |
| 70 | |
| 71 | **Timeframes**: `1m, 3m, 5m, 15m, 30m, 1H, 2H, 4H, 6H, 8H, 12H, 1D, 3D, 1W, 1M` |
| 72 | |
| 73 | Response: |
| 74 | ```json |
| 75 | { |
| 76 | "data": { |
| 77 | "items": [ |
| 78 | {"o": 23.5, "h": 24.1, "l": 23.2, "c": 23.8, "v": 1234567.89, "unixTime": 1692175200, "type": "15m"} |
| 79 | ] |
| 80 | }, |
| 81 | "success": true |
| 82 | } |
| 83 | ``` |
| 84 | |
| 85 | **Pagination for long history**: Max 1000 candles per request. At 15m intervals, 1000 candles ≈ 10.4 days. Slide `time_from`/`time_to` windows for longer history. |
| 86 | |
| 87 | ```python |
| 88 | # Pair OHLCV (40 CU) |
| 89 | GET /defi/ohlcv/pair?address=PAIR_ADDRESS&type=1H&time_from=T1&time_to=T2 |
| 90 | ``` |
| 91 | |
| 92 | ### Token Overview |
| 93 | |
| 94 | Comprehensive metadata + market data in one call. |
| 95 | |
| 96 | ```python |
| 97 | # Token overview (30 CU) |
| 98 | GET /defi/token_overview?address=TOKEN_MINT |
| 99 | ``` |
| 100 | |
| 101 | Returns: `name`, `symbol`, `decimals`, `logoURI`, `liquidity`, `price`, `mc` (market cap), `supply`, price changes (30m/1h/2h/4h/6h/8h/12h/24h), trade counts, buy/sell volumes, unique wallets, and social links. |
| 102 | |
| 103 | See `references/birdeye_endpoints.md` for full field listing. |
| 104 | |
| 105 | ### Token Security |
| 106 | |
| 107 | Pre-trade safety check — essential before entering any new token. |
| 108 | |
| 109 | ```python |
| 110 | # Token security (50 CU) |
| 111 | GET /defi/token_security?address=TOKEN_MINT |
| 112 | ``` |
| 113 | |
| 114 | Returns: |
| 115 | - `creatorAddress`, `ownerAddress` — who controls the token |
| 116 | - `top10HolderPercent` — concentration risk |
| 117 | - `mutableMetadata` — can metadata be changed? |
| 118 | - `freezeable`, `freezeAuthority` — can tokens be frozen? |
| 119 | - `transferFeeEnable` — Token-2022 transfer fees? |
| 120 | - `isToken2022` — which token program? |
| 121 | - `lockInfo` — LP lock details |
| 122 | |
| 123 | **Quick safety checks**: |
| 124 | - Mintable = `ownerAddress != null` (supply can increase) |
| 125 | - Renounced = `ownerAddress == null` (no mint authority) |
| 126 | - Mutable = `mutableMetadata == true` |
| 127 | - Freezeable = `freezeable == true` |
| 128 | |
| 129 | ### Trades |
| 130 | |
| 131 | ```python |
| 132 | # Recent trades for a token (10 CU) |
| 133 | GET /defi/txs/token?address=TOKEN_MINT&limit=50&tx_type=swap |
| 134 | |
| 135 | # Trades by time range (15 CU) |
| 136 | GET /defi/txs/token/seek_by_time?address=TOKEN_MINT&after_time=UNIX_TS&limit=50 |
| 137 | # WARNING: do NOT pass both before_time and after_time — returns 422 |
| 138 | ``` |
| 139 | |
| 140 | Trade response fields: `txHash`, `source` (DEX), `blockUnixTime`, `owner` (trader), `from` (token sent), `to` (token received) with amounts and prices. |
| 141 | |
| 142 | ### Top Traders |
| 143 | |
| 144 | ```python |
| 145 | # Top traders for a token (30 CU) |
| 146 | GET /defi/v2/tokens/top_traders?address=TOKEN_MINT&time_frame=24h&sort_by=volume&limit=10 |
| 147 | ``` |
| 148 | |
| 149 | Returns: `owner`, `volume`, `volumeBuy`, `volumeSell`, `trade`, `tradeBuy`, `tradeSell`, `tags` (e.g., `"arbitrage-bot"`, `"sniper-bot"`). |
| 150 | |
| 151 | ### New Listings |
| 152 | |
| 153 | ```python |
| 154 | # New token listings (80 CU) |
| 155 | GET /defi/v2/tokens/new_listing?time_to=UNIX_TS&limit=10&meme_platform_enabled=true |
| 156 | ``` |
| 157 | |
| 158 | Returns tokens listed within ~3 days with liquidity ≥ $10. Set `meme_platform_enabled=true` to include PumpFun tokens. |
| 159 | |
| 160 | ### Trending Tokens |
| 161 | |
| 162 | ```python |
| 163 | # Trending tokens (50 CU) |
| 164 | GET /defi/token_trending?sort_by=rank&sort_type=asc&limit=20 |
| 165 | ``` |
| 166 | |
| 167 | ### Token Holders |
| 168 | |
| 169 | ```python |
| 170 | # Token holders (50 CU) |
| 171 | GET /defi/v3/token/holder?address=TOKEN_MINT |
| 172 | ``` |
| 173 | |
| 174 | ### Sea |