Batch Operations

API တောင်းဆိုချက်များစွာကို batch operation တစ်ခုတည်းဖြင့် လုပ်ဆောင်ပါ။ API ခေါ်ဆိုမှုများကို ၉၀% အထိ လျှော့ချနိုင်ပြီး အများအပြားဒေတာများရယူခြင်းနှင့် ဆန်းစစ်ခြင်းအတွက် စွမ်းဆောင်ရည်မြှင့်တင်ပါ။

Overview

Batch operations များဖြင့် API တောင်းဆိုချက်များစွာကို HTTP တောင်းဆိုချက်တစ်ခုတည်းဖြင့် ပို့နိုင်ပါသည်။ ၎င်းသည် API ခေါ်ဆိုမှုအရေအတွက်ကို လျှော့ချပေးပြီး latency ကိုတိုးတက်စေကာ အများအပြားဒေတာရယူခြင်း၊ symbols များစွာကို စောင့်ကြည့်ခြင်း သို့မဟုတ် batch analysis ပြုလုပ်ခြင်းအတွက် အကောင်းဆုံးဖြစ်သည်။ 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

တောင်းဆိုချက် ID အလိုက် index လုပ်ထားသော batch response object တစ်ခုတည်းဖြင့် အဖြေအားလုံးကို လက်ခံရရှိပါမည်။

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

တောင်းဆိုချက် ၁၀၀ ကို batch တစ်ခုဖြင့် ပို့ခြင်းသည် API call ၁၀၀ အစား ၁ ကြိမ်သာ ဖြစ်သည်။ အများအပြားအသုံးပြုမှုအတွက် quota ကို အများကြီးသက်သာစေပါသည်။

Improved Performance

HTTP တောင်းဆိုချက် ၁၀၀ အစား တစ်ကြိမ်တည်းသာ လိုအပ်သည်။ Bulk operations များအတွက် latency နည်းပြီး ဒေတာရယူမှု ပိုမိုမြန်ဆန်စေပါသည်။

Atomic Transactions

Batch တစ်ခုအတွင်းရှိ တောင်းဆိုချက်အားလုံးကို အတူတကွ လုပ်ဆောင်ပါသည်။ Batch operations တစ်လျှောက် အစိတ်အပိုင်းပျက်ကွက်မှုများ မရှိပါ။

Easier Error Handling

Batch တစ်ခုလုံးကို unit တစ်ခုအနေဖြင့် ကိုင်တွယ်ရင်း တောင်းဆိုချက်တစ်ခုစီအတွက် အဖြေအခြေအနေများကို လုပ်ဆောင်နိုင်ပါသည်။

Use Cases

Monitoring multiple trading pairs: Symbols ၅၀ အတွက် whale positions များကို batch တောင်းဆိုချက်တစ်ခုဖြင့် ရယူပါ။

Daily reporting: သက်ဆိုင်ရာဒေတာအားလုံး (funding rates, OI, liquidations) ကို batch တစ်ခုတည်းဖြင့် စုဆောင်းပါ။

Portfolio analysis: Symbols နှင့် exchanges များစွာကို ထိရောက်စွာ ဆန်းစစ်ပါ။

Webhook processing: Webhook events များစွာကို batch လုပ်ကာ API calls တစ်ကြိမ်တည်းဖြင့် ဆန်းစစ်ပါ။

Optimize Your Queries

API quota အသုံးပြုမှုကို လျှော့ချရန်နှင့် ထိရောက်မှုအများဆုံးရရှိရန် batch operations များကို အသုံးပြုပါ။

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 →