Batch Operations

Process multiple API requests in single batch operations. Reduce API calls by up to 90% and improve performance for bulk data retrieval and analysis.

Overview

Batch operations allow you to send multiple API requests in a single HTTP request. This reduces API call counts, improves latency, and is ideal for bulk data retrieval, monitoring multiple symbols, or performing batch analysis. Send up to 100 requests per batch.

Batch Request Format

POST to /v1/batch with an array of request objects:

JSON
{ "requests": [ { "id": "req_1", "method": "GET", "path": "/v1/whales/events?symbol=BTCUSDT" }, { "id": "req_2", "method": "GET", "path": "/v1/whales/events?symbol=ETHUSDT" }, { "id": "req_3", "method": "GET", "path": "/v1/funding-rates?symbol=BTCUSDT" } ] }

Batch Response Format

Receive all responses in a single batch response object, indexed by request ID:

JSON
{ "success": true, "responses": { "req_1": { "status": 200, "data": { "total": 42, "positions": [...] } }, "req_2": { "status": 200, "data": { "total": 28, "positions": [...] } }, "req_3": { "status": 200, "data": {...} } }, "timestamp": "2026-03-21T14:35:22Z" }

Code Examples

Python: Batch Whale Positions for Multiple Symbols

Python
import requests def batch_fetch_whale_positions(api_key, symbols): """Fetch whale positions for multiple symbols in one batch""" # Build batch requests requests_list = [] for i, symbol in enumerate(symbols): requests_list.append({ "id": f"req_{i+1}", "method": "GET", "path": f"/v1/whales/events?symbol={symbol}&limit=50" }) # Send batch request response = requests.post( "https://api.smartmoneyapi.com/v1/batch", headers={ "Authorization": f"Bearer {api_key}", "Content-Type": "application/json" }, json={"requests": requests_list} ) batch_response = response.json() # Process responses results = {} for symbol, response in zip(symbols, batch_response["responses"].values()): if response["status"] == 200: results[symbol] = response["data"]["positions"] return results # Usage: Fetch 5 symbols in one batch symbols = ["BTCUSDT", "ETHUSDT", "SOLUSDT", "XRPUSDT", "ADAUSDT"] positions = batch_fetch_whale_positions("sk_live_abc123xyz789", symbols) print(f"Fetched positions for {len(positions)} symbols")

Benefits of Batch Operations

Reduced API Calls

Send 100 requests in one batch = 1 API call instead of 100. Massive quota savings for high-volume integrations.

Improved Performance

Single round-trip HTTP request instead of 100. Lower latency and faster data retrieval for bulk operations.

Atomic Transactions

All requests in a batch are processed together. No partial failures across batch operations.

Easier Error Handling

Process individual response statuses for each request while handling the batch as a unit.

Use Cases

Monitoring multiple trading pairs: Fetch whale positions for 50 symbols in one batch request.

Daily reporting: Collect all relevant data (funding rates, OI, liquidations) in a single batch.

Portfolio analysis: Analyze positions across multiple symbols and exchanges efficiently.

Webhook processing: Batch multiple webhook events into single API calls for analysis.

Optimize Your Queries

Use batch operations to maximize efficiency and reduce API quota usage.

View API Reference
Start free — 200 calls/day, no card

Get live whale flow, funding, open interest and on-chain data across 3 exchanges from one API. Free tier, no credit card, upgrade any time.

Start free →
Try the live API console → (no account needed)
Get your API key in 30 seconds

Ready to build? Grab a free API key (200 calls/day, no card) and start pulling live whale, funding and on-chain data.

Get your API key →