Rate Limiting နှင့် Quotas

Smart Money API ၏ rate limits များ၊ subscription tier အလိုက် နေ့စဉ် quotas များနှင့် API အသုံးပြုမှုကို အများဆုံးအထိရောက်ဆုံးဖြစ်စေရန် optimization နည်းဗျူဟာများကို နားလည်ပါ။

Overview

Smart Money API သည် ဝန်ဆောင်မှုအရည်အသွေးနှင့် အသုံးပြုသူအားလုံးအတွက် တရားမျှတမှုကို သေချာစေရန် နေ့စဉ် request quotas များကို အကောင်အထည်ဖော်ထားသည်။ Subscription tier တစ်ခုစီတွင် ကွဲပြားသော နေ့စဉ် limit ပါရှိသည်။ သင့်နေ့စဉ် quota ကို ကျော်လွန်သောအခါ၊ quota ပြန်လည်သတ်မှတ်သည့် UTC midnight အထိ 429 Too Many Requests error ကို ရရှိမည်ဖြစ်သည်။

Rate limits များကို API key တစ်ခုစီအတွက် သီးသန့်အသုံးပြုသည်။ Key တစ်ခုစီတွင် သီးခြား quota ရှိသည်။ သင့်အနေဖြင့် ကွဲပြားသော applications များအတွက် key များစွာကို ဖန်တီးနိုင်ပြီး တစ်ခုစီ၏ အသုံးပြုမှုကို သီးသန့်စောင့်ကြည့်နိုင်သည်။

Quotas by Subscription Tier

Tier Daily Requests Price Features
Free 200 requests/day $0 BTC, ETH, SOL, funding rates, liquidations
Trader 1,000 requests/day $29/month All symbols, whale positions, OI data
Pro 5,000 requests/day $79/month Confirmation scores, on-chain data, webhooks
Enterprise Custom Custom Dedicated support, custom integrations

Rate Limit Response Headers

API response တိုင်းတွင် သင့်၏လက်ရှိ quota status ကို ဖော်ပြသော headers များ ပါဝင်သည်-

HTTP Headers
X-Requests-Limit: 200 X-Requests-Remaining: 147 X-Requests-Reset: 1711116000 X-Requests-Reset-ISO: 2026-03-22T00:00:00Z
Header Description
X-Requests-Limit တစ်နေ့တာ ခွင့်ပြုထားသော request အရေအတွက် (ဥပမာ- Trader အတွက် 200)
X-Requests-Remaining လက်ရှိနေ့အတွင်း ကျန်ရှိသော requests အရေအတွက်
X-Requests-Reset Quota ပြန်လည်သတ်မှတ်မည့် Unix timestamp
X-Requests-Reset-ISO Quota reset ဖြစ်မည့် ISO 8601 timestamp

Checking Quota Before Making Requests

Python
import requests from datetime import datetime def check_quota_before_request(api_key): response = requests.head( "https://api.smartmoneyapi.com/v1/whales/events", headers={"Authorization": f"Bearer {api_key}"} ) limit = int(response.headers.get("X-Requests-Limit", 0)) remaining = int(response.headers.get("X-Requests-Remaining", 0)) reset_unix = int(response.headers.get("X-Requests-Reset", 0)) reset_time = datetime.fromtimestamp(reset_unix) percent_used = (limit - remaining) / limit * 100 print(f"Quota: {remaining}/{limit} requests ({percent_used:.1f}% used)") print(f"Resets at: {reset_time}") if remaining < 5: print("WARNING: Approaching quota limit!") return False return True # Check before making requests if check_quota_before_request("sk_live_abc123xyz789"): print("Safe to proceed with API calls")

Daily Rate Window

Rate limits များသည် 24-hour rolling window အပေါ်တွင် အလုပ်လုပ်သည်။ သင့် quota သည် နေ့စဉ် UTC midnight (00:00 UTC) တွင် ပြန်လည်သတ်မှတ်သည်။ အတိအကျ reset အချိန်ကို X-Requests-Reset-ISO header တွင် ဖော်ပြထားသည်။

Example: Trader Tier (1,000 requests/day)

  • Day 1 (Mar 21): 200 requests available at 00:00 UTC
  • 10:30 UTC: Made 75 requests, 125 remaining
  • 15:45 UTC: Made 100 more requests, 25 remaining
  • 23:59 UTC: Still 25 requests remaining (can't carry over)
  • Day 2 (Mar 22, 00:00 UTC): Quota resets to 200

Optimization Strategies

1. Cache API Responses

Whale positions များသည် စက္ကန့်တိုင်း မပြောင်းလဲပါ။ 30-60 စက္ကန့်အတွင်း results များကို cache လုပ်ပြီး API calls အသစ်များလုပ်မည့်အစား cached data များကို အသုံးပြုပါ။

Python
import requests import time class CachedClient: def __init__(self, api_key, cache_ttl=60): self.api_key = api_key self.cache_ttl = cache_ttl self.cache = {} self.cache_time = {} def get_whale_positions(self, symbol): cache_key = f"whales:{symbol}" now = time.time() # Return cached data if still fresh if cache_key in self.cache: age = now - self.cache_time[cache_key] if age < self.cache_ttl: print(f"Served from cache (age: {age:.1f}s)") return self.cache[cache_key] # Fetch fresh data response = requests.get( f"https://api.smartmoneyapi.com/v1/whales/events?symbol={symbol}", headers={"Authorization": f"Bearer {self.api_key}"} ) data = response.json() self.cache[cache_key] = data self.cache_time[cache_key] = now return data # Usage: Cache for 60 seconds client = CachedClient("sk_live_abc123xyz789", cache_ttl=60) whales1 = client.get_whale_positions("BTCUSDT") # API call whales2 = client.get_whale_positions("BTCUSDT") # From cache whales3 = client.get_whale_positions("BTCUSDT") # From cache

2. Use WebSocket for Real-Time Data

WebSocket connections များသည် rate limit ကို မထိခိုက်စေဘဲ အချက်အလက်များကို ချက်ချင်းပို့ပေးသည်။ Streams များကို subscribe လုပ်ပြီး အချက်အလက်များ update ဖြစ်သည့်အချိန်တိုင်း လက်ခံရရှိခြင်းဖြင့် REST API calls အရေအတွက်ကို လျှော့ချနိုင်သည်။

3. Batch Requests Strategically

Symbol တစ်ခုစီအတွက် သီးသန့် request များလုပ်မည့်အစား symbol များစွာပါသော request တစ်ခုတည်းကို လုပ်ဆောင်ပါ။ ၎င်းသည် API calls များကို 10x အထိ လျှော့ချပေးနိုင်သည်။

4. Use Filtering at Request Time

Query parameters တွင် filters (symbol, exchange, min_position_size) များကို အသုံးပြုပြီး သင်လိုအပ်သည့် အချက်အလက်များကို တစ်ခါတည်းရယူပါ။ Post-processing လုပ်စရာမလိုတော့ပါ။

Handling Rate Limit Errors

Retry with Exponential Backoff

Python
import requests import time def request_with_retry(url, api_key, max_retries=5): for attempt in range(max_retries): try: response = requests.get( url, headers={"Authorization": f"Bearer {api_key}"}, timeout=10 ) if response.status_code == 200: return response.json() elif response.status_code == 429: # Rate limited - back off exponentially wait_time = min(2 ** attempt, 300) # Max 5 minutes reset_time = response.headers.get("X-Requests-Reset-ISO") print(f"Rate limited. Retrying in {wait_time}s (resets at {reset_time})") time.sleep(wait_time) elif response.status_code >= 500: # Server error - retry wait_time = 2 ** attempt print(f"Server error {response.status_code}. Retrying in {wait_time}s") time.sleep(wait_time) else: # Other error - don't retry raise Exception(f"HTTP {response.status_code}: {response.text}") except requests.exceptions.Timeout: wait_time = 2 ** attempt print(f"Timeout. Retrying in {wait_time}s") time.sleep(wait_time) raise Exception("Max retries exceeded") # Usage data = request_with_retry( "https://api.smartmoneyapi.com/v1/whales/events", "sk_live_abc123xyz789" ) print(data)

Ready to Upgrade?

Free tier နှင့် မလုံလောက်ဘူးလား? Trader သို့မဟုတ် Pro တို့သို့ upgrade လုပ်ပြီး confirmation scores နှင့် on-chain data ကဲ့သို့သော အဆင့်မြင့် features များနှင့် ပိုမိုမြင့်မားသော quotas များကို ရယူပါ။

View Pricing

Optimize Your API Usage Today

Caching များကို အကောင်အထည်ဖော်ပါ၊ real-time data အတွက် WebSocket ကို အသုံးပြုပါ၊ rate limits များကို ကျွမ်းကျင်စွာ ကိုင်တွယ်ပါ။

Read Documentation
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 →