API Testing and Sandbox Environment Guide

Smart Money API ၏ ပြည့်စုံသော sandbox environment ဖြင့် စမ်းသပ်မှုများကို ကျွမ်းကျင်စွာ လုပ်ဆောင်ပါ။ အချက်အလက်များကို စမ်းသပ်ရန်၊ တိကျသော တုံ့ပြန်မှုများနှင့် စမ်းသပ်မှုအတွက် လိုအပ်သော rate limits များကို အသုံးပြု၍ အန္တရာယ်မရှိဘဲ ဖွံ့ဖြိုးနိုင်ပါသည်။

မတ်လ ၂၁၊ ၂၀၂၆ တွင် ထုတ်ဝေသည် ၁၄ မိနစ် ဖတ်ရန် ဖွံ့ဖြိုးမှု

Sandbox Environment အကျဉ်းချုပ်

Smart Money API သည် ဖွံ့ဖြိုးမှုနှင့် စမ်းသပ်မှုများအတွက် ပြည့်စုံသော sandbox environment ကို ပံ့ပိုးပေးသည်။ Sandbox သည် production API ၏ တည်ဆောက်ပုံကို ထင်ဟပ်စေသော်လည်း အချက်အလက်များကို စမ်းသပ်ရန်အတွက်သာ အသုံးပြုပြီး rate limits များကို ပိုမိုလွယ်ကူစွာ အသုံးပြုနိုင်စေရန် ပြုလုပ်ထားသည်။

အဓိက လက္ခဏာများ-

  • Production နှင့် တူညီသည် — အလားတူ endpoints, authentication, တုံ့ပြန်မှု format
  • စမ်းသပ်ဒေတာသာ — အစစ်အမှန် account များ သို့မဟုတ် live market များကို ဘယ်သောအခါမှ မထိခိုက်စေပါ
  • High Rate Limits — ၁၀,၀၀၀ requests/hour (production တွင် ၁,၀၀၀ သာ)
  • Deterministic Responses — စမ်းသပ်မှုများအတွက် တသမတ်တည်း တုံ့ပြန်မှုများ
  • သီးသန့် Accounts — Production user data များနှင့် သီးခြားဖြစ်သည်

အကောင်းဆုံးအလေ့အကျင့်- ဖွံ့ဖြိုးမှု၊ စမ်းသပ်မှုနှင့် staging အားလုံးအတွက် sandbox environment ကို အသုံးပြုပါ။ Production ကို sandbox တွင် စမ်းသပ်ပြီးမှသာ အသုံးပြုပါ။

Sandbox အင်္ဂါရပ်များ

လက်တွေ့ကျသော စမ်းသပ်ဒေတာ

Sandbox တွင် ကျပန်းမပြောင်းလဲသော cryptocurrency market data များ ပါဝင်သည်-

  • သမိုင်းကြောင်း market data (လက်တွေ့ကျသော OHLCV ၆ လ)
  • ပုံမှန်ရွေ့လျားမှုပုံစံရှိသော whale wallet addresses များ
  • တစ်နာရီတစ်ကြိမ် ပြန်လည်သတ်မှတ်သော funding rates
  • စမ်းသပ်မှုအတွက် deterministic liquidation patterns

စမ်းသပ်မှုဆိုင်ရာ အင်္ဂါရပ်များ

စမ်းသပ်အင်္ဂါရပ်များ
// Deterministic test symbols
// စမ်းသပ်သော symbols အားလုံးသည် TEST_ ဖြင့် စသည်
TEST_BTC, TEST_ETH, TEST_SOL, etc.
// အခြေအနေများကို စမ်းသပ်ရန် magic timestamps
GET /v1/derivatives/funding-heatmap?
timestamp=1234567890000 // စမ်းသပ်ဒေတာကို ပြန်ပေးသည်
// အမှားများကို ဖြစ်ပေါ်စေရန်
X-Test-Error: rate_limit_exceeded
X-Test-Error: service_unavailable

စမ်းသပ်မှုဆိုင်ရာ ကိရိယာများ

  • ဒေတာ ပြန်လည်သတ်မှတ်ခြင်း — စမ်းသပ်အကောင့်အားလုံးကို အစအခြေသို့ ပြန်လည်သတ်မှတ်ပါ
  • အချိန်ထိန်းချုပ်မှု — မတူညီသော market အခြေအနေများကို စမ်းသပ်ပါ
  • အမှားထည့်သွင်းမှု — တိကျသော အမှားတုံ့ပြန်မှုများကို ဖြစ်ပေါ်စေပါ
  • Rate Limit စမ်းသပ်မှု — Rate limit တုံ့ပြန်မှုများကို ဖြစ်ပေါ်စေပါ
၃၀ စက္ကန့်အတွင်း API key ရယူပါ

တည်ဆောက်ရန် အဆင်သင့်ဖြစ်ပြီလား။ အခမဲ့ API key (တစ်နေ့ ၅၀ ခေါ်ဆိုမှု၊ ကတ်မလိုအပ်) ကို ရယူပြီး whale၊ funding နှင့် on-chain data များကို စတင်ရယူပါ။

API key ရယူရန် →

စမ်းသပ်အထောက်အထားများ

စမ်းသပ် API Keys များရယူခြင်း

Dashboard မှတစ်ဆင့် စမ်းသပ်အကောင့်တစ်ခုဖန်တီးပြီး sandbox API keys များကို ထုတ်ပေးပါ-

စမ်းသပ် Key Format
// စမ်းသပ်သော keys များတွင် မတူညီသော prefix ရှိသည်
sk_test_1234567890abcdef // စမ်းသပ် API key
sk_live_1234567890abcdef // Production API key
// အလိုအလျောက် သင့်လျော်သော environment သို့ လမ်းကြောင်းပြောင်းပေးသည်
GET https://api.smartmoneyapi.com/v1/whales
-H "Authorization: Bearer sk_test_xxx"
# Sandbox သို့ အလိုအလျောက် လမ်းကြောင်းပြောင်းပေးသည်

ကြိုတင်ပြင်ဆင်ထားသော စမ်းသပ် Keys

ဤအများသုံး စမ်းသပ် keys များကို အမြန်စမ်းသပ်ရန် အသုံးပြုပါ (rate limited)-

Key ခွင့်ပြုချက်များ Limit
sk_test_demo အားလုံးဖတ်ရန် ၁၀၀/hour
sk_test_trader ဖတ်ရန် + alerts ၅၀၀/hour
sk_test_pro အပြည့်အဝ အသုံးပြုခွင့် ၅၀၀၀/hour

Production တွင် စမ်းသပ် keys များကို ဘယ်သောအခါမှ အသုံးမပြုပါနှင့်။ ၎င်းတို့တွင် လုပ်ဆောင်နိုင်စွမ်းနှင့် rate limits များ ကန့်သတ်ထားသည်။

စမ်းသပ်ဒေတာနှင့် Fixtures

ရနိုင်သော စမ်းသပ် Symbols

Sandbox တွင် ဤစမ်းသပ် trading pairs များနှင့် လက်တွေ့ကျသော သမိုင်းကြောင်း data များ ပါဝင်သည်-

စမ်းသပ် Symbols
// Cryptocurrency pairs
TEST_BTCUSDT, TEST_ETHUSDT, TEST_BNBUSDT
TEST_SOLSDT, TEST_ARBUSDT, TEST_OPUSDT
// စမ်းသပ် symbols များကို မေးမြန်းပါ
GET /v1/symbols?test_only=true

စမ်းသပ် Whale Wallets

ကြိုတင်ပြင်ဆင်ထားသော စမ်းသပ် wallets များနှင့် deterministic အပြုအမူများ-

  • Accumulator Wallet — အဆက်မပြတ် ဝယ်ယူသည်၊ bullish စမ်းသပ်မှုများအတွက် ကောင်းမွန်သည်
  • Distributor Wallet — အဆက်မပြတ် ရောင်းချသည်၊ bearish စမ်းသပ်မှုများအတွက် ကောင်းမွန်သည်
  • Oscillator Wallet — ဝယ်ယူ/ရောင်းချမှုများကို အလှည့်ကျပြုလုပ်သည်၊ range-bound စမ်းသပ်မှုများအတွက် ကောင်းမွန်သည်
  • Volatility Wallet — Stress testing အတွက် ကျပန်းကြီးမားသော ငွေလွှဲမှုများ

စမ်းသပ်ဒေတာကို ပြန်လည်သတ်မှတ်ခြင်း

စမ်းသပ်ဒေတာကို ပြန်လည်သတ်မှတ်ပါ
// စမ်းသပ်အကောင့်အားလုံးကို အစအခြေသို့ ပြန်လည်သတ်မှတ်ပါ
POST /v1/test/reset
-H "Authorization: Bearer sk_test_xxx"
// တိကျသော resource ကို ပြန်လည်သတ်မှတ်ပါ
POST /v1/test/reset?resource=whales
// တုံ့ပြန်မှု
{
"status": "reset_complete",
"timestamp": 1709980800000
}

Sandbox Endpoints

Base URLs

Environment URLs
// Sandbox (test mode)
https://api-test.smartmoney.io/v1
// Or use query parameter
https://api.smartmoneyapi.com/v1?environment=sandbox
// Production (live mode)
https://api.smartmoneyapi.com/v1

Sandbox-Only Endpoints

Endpoint Purpose
POST /test/reset စမ်းသပ်ဒေတာများကို အစအဆုံးပြန်လည်သတ်မှတ်ရန်
POST /test/inject-error စမ်းသပ်မှုအတွက် အထူးအမှားတစ်ခုထည့်သွင်းရန်
POST /test/simulate-time မတူညီသော ဈေးကွက်အခြေအနေများကို စမ်းသပ်ရန်
GET /test/status Sandbox ပတ်ဝန်းကျင်ကျန်းမာရေးကို စစ်ဆေးရန်

Response Mocking

စမ်းသပ်အမှားများထည့်သွင်းခြင်း

ခြွင်းချက်ကိုင်တွယ်မှုစမ်းသပ်ခြင်းအတွက် အထူးအမှားတုံ့ပြန်မှုများကို အတင်းအကျပ်ထည့်သွင်းရန်

Error Injection
// Test rate limit handling
GET /v1/whales?X-Test-Error=rate_limit_exceeded
// Test service unavailability
GET /v1/whales?X-Test-Error=service_unavailable
// Test authentication failure
GET /v1/whales?X-Test-Error=invalid_key
// Test timeout
GET /v1/whales?X-Test-Error=timeout

Available Test Errors

Error Code HTTP Status Use Case
invalid_key 401 Auth error handling
rate_limit_exceeded 429 Backoff logic testing
not_found 404 Missing resource handling
service_unavailable 503 Retry logic testing
timeout 504 Timeout handling

Sandbox Rate Limits

Rate Limit Tiers

Environment Limit/Hour Burst Purpose
Sandbox 10,000 500/min Development & testing
Production Free 1,000 50/min Hobby projects
Production Trader 10,000 400/min Professional trading
Production Pro 50,000 1000/min High-frequency systems

Testing Rate Limit Handling

Rate Limit Testing
// Trigger rate limit response in sandbox
curl -H "X-Test-Error: rate_limit_exceeded" \
https://api-test.smartmoney.io/v1/whales
// Response includes retry headers
HTTP/1.1 429 Too Many Requests
X-RateLimit-Limit: 10000
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1709984400
Retry-After: 3600

Testing Strategies

Unit Testing with Fixtures

Python Unit Test
import unittest
import requests
class TestSmartMoneyAPI(unittest.TestCase):
def setUp(self):
self.api_key = 'sk_test_demo'
self.base_url = 'https://api-test.smartmoney.io/v1'
def test_whale_tracking(self):
response = requests.get(
f'{self.base_url}/whales/TEST_BTC',
headers={'Authorization': f'Bearer {self.api_key}'}
)
self.assertEqual(response.status_code, 200)
self.assertIn('whales', response.json())

Integration Testing

Production မတင်မီ sandbox တွင် အလုပ်အလုံးစုံစမ်းသပ်ရန်

  1. Sandbox အထောက်အထားများဖြင့် staging သို့တင်ရန်
  2. Sandbox တွင် အပြည့်အဝစမ်းသပ်မှုများလုပ်ဆောင်ရန်
  3. Error injection ဖြင့် အမှားကိုင်တွယ်မှုကို စမ်းသပ်ရန်
  4. Rate limiting အပြုအမူကို အတည်ပြုရန်
  5. တုံ့ပြန်ချိန်နှင့် latency ကို စစ်ဆေးရန်
  6. ထို့နောက်မှသာ production သို့တင်ရန်

Load Testing

Apache Bench ဖြင့် Load Test
// Sandbox တွင် အမြင့်ဆုံးဝန်ကို စမ်းသပ်ခွင့်ပြုသည်
ab -n 5000 -c 100 \
-H "Authorization: Bearer sk_test_pro" \
https://api-test.smartmoney.io/v1/whales/TEST_BTC

CI/CD Integration

GitHub Actions Example

.github/workflows/test.yml
name: API Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: pip install requests pytest
- env:
SMARTMONEY_API_KEY: ${{ secrets.TEST_API_KEY }}
SMARTMONEY_ENV: sandbox
run: pytest tests/

Environment Configuration

Sandbox နှင့် production အကြား ပြောင်းလဲရန် environment variables များကို အသုံးပြုပါ။

Environment Setup
// .env.sandbox
SMARTMONEY_API_KEY=sk_test_demo
SMARTMONEY_API_URL=https://api-test.smartmoney.io/v1
SMARTMONEY_ENV=sandbox
// .env.production
SMARTMONEY_API_KEY=sk_live_xxxx
SMARTMONEY_API_URL=https://api.smartmoneyapi.com/v1
SMARTMONEY_ENV=production

Troubleshooting

Common Issues

Test Key Not Working

Problem: Getting 401 Unauthorized with test key

Solutions:

  • Verify key starts with sk_test_ (not sk_live_)
  • Check Authorization header format: "Bearer sk_test_xxx"
  • Ensure using test endpoint: api-test.smartmoney.io
  • Test key may have rate limit exceeded

Data Not Resetting

Problem: Test data doesn't reset after POST /test/reset

Solutions:

  • Reset may take up to 30 seconds to propagate
  • Check sandbox status with GET /test/status
  • Verify using correct test API key
  • Contact support if persistent

Rate Limits in Sandbox

Problem: Hitting rate limits in sandbox (shouldn't happen)

Solutions:

  • Verify using sk_test_pro key (10,000/hour)
  • Check X-RateLimit-Remaining header
  • Wait for hour boundary or use different test account
  • Contact support for temporary rate limit increase

Start Testing Today

Use our comprehensive sandbox environment for safe, isolated development. Deterministic test data, high rate limits, and complete feature parity with production.

Get Test Credentials
All plans include sandbox access. No additional cost.

Related Resources

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)