API Testing and Sandbox Environment Guide

Master testing with Smart Money API's comprehensive sandbox environment. Develop without risk using realistic test data, deterministic responses, and generous rate limits for experimentation.

Published March 21, 2026 14 min read Development

Sandbox Environment Overview

Smart Money API provides a full-featured sandbox environment for development and testing. The sandbox mirrors production API structure but uses synthetic data and generous rate limits, allowing you to develop confidently before going live.

Key characteristics:

  • Identical to Production — Same endpoints, authentication, response format
  • Test Data Only — Never affects real accounts or live markets
  • High Rate Limits — 10,000 requests/hour vs 1,000 in production
  • Deterministic Responses — Consistent test fixtures for reproducible testing
  • Isolated Accounts — Separate from production user data

Best Practice: All development, testing, and staging should use the sandbox environment. Only use production after thorough sandbox validation.

Sandbox Features

Realistic Test Data

Sandbox contains realistic cryptocurrency market data that doesn't change randomly:

  • Historical market data (6 months of realistic OHLCV)
  • Fixed whale wallet addresses with consistent movement patterns
  • Stable funding rates that reset hourly
  • Deterministic liquidation patterns for testing edge cases

Test-Specific Features

Test Features
// Deterministic test symbols
// All test symbols start with TEST_
TEST_BTC, TEST_ETH, TEST_SOL, etc.
// Magic timestamps for simulating scenarios
GET /v1/derivatives/funding-heatmap?
timestamp=1234567890000 // Returns fixed test data
// Force errors for exception handling testing
X-Test-Error: rate_limit_exceeded
X-Test-Error: service_unavailable

Test Utilities

  • Data Reset — Reset all test accounts to initial state
  • Time Control — Simulate different market conditions
  • Error Injection — Force specific error responses
  • Rate Limit Testing — Trigger rate limit responses
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 →

Test Credentials

Getting Test API Keys

Create a test account through the dashboard to generate sandbox API keys:

Test Key Format
// Test keys have different prefix
sk_test_1234567890abcdef // Test API key
sk_live_1234567890abcdef // Production API key
// Automatically routes to appropriate environment
GET https://api.smartmoneyapi.com/v1/whales
-H "Authorization: Bearer sk_test_xxx"
# Routes to sandbox automatically

Pre-Configured Test Keys

Use these public test keys for quick experimentation (rate limited):

Key Permissions Limit
sk_test_demo Read all 100/hour
sk_test_trader Read + alerts 500/hour
sk_test_pro Full access 5000/hour

Never use test keys in production. They have limited functionality and rate limits.

Test Data and Fixtures

Available Test Symbols

Sandbox includes these test trading pairs with realistic historical data:

Test Symbols
// Cryptocurrency pairs
TEST_BTCUSDT, TEST_ETHUSDT, TEST_BNBUSDT
TEST_SOLSDT, TEST_ARBUSDT, TEST_OPUSDT
// Query test symbols
GET /v1/symbols?test_only=true

Test Whale Wallets

Pre-configured test wallets with deterministic behavior:

  • Accumulator Wallet — Consistently buying, good for bullish testing
  • Distributor Wallet — Consistently selling, good for bearish testing
  • Oscillator Wallet — Alternates buy/sell, good for range-bound testing
  • Volatility Wallet — Random large transactions for stress testing

Resetting Test Data

Reset Test Data
// Reset all test accounts to initial state
POST /v1/test/reset
-H "Authorization: Bearer sk_test_xxx"
// Reset specific resource
POST /v1/test/reset?resource=whales
// Response
{
"status": "reset_complete",
"timestamp": 1709980800000
}

Sandbox Endpoints

Base URLs

Environment URLs
// Sandbox (test mode)
https://api.smartmoneyapi.com/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 Reset test data to initial state
POST /test/inject-error Inject specific error for testing
POST /test/simulate-time Simulate different market conditions
GET /test/status Check sandbox environment health

Response Mocking

Injecting Test Errors

Force specific error responses for exception handling testing:

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 200 4/min Hobby projects
Production Trader 3,000 30/min Professional trading
Production Pro 15,000 60/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.smartmoneyapi.com/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.smartmoneyapi.com/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

Test full workflow in sandbox before production deployment:

  1. Deploy to staging with sandbox credentials
  2. Run full test suite against sandbox
  3. Test error handling with error injection
  4. Verify rate limiting behavior
  5. Check response time and latency
  6. Only then promote to production

Load Testing

Load Test with Apache Bench
// Sandbox allows high load testing
ab -n 5000 -c 100 \
-H "Authorization: Bearer sk_test_pro" \
https://api.smartmoneyapi.com/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

Use environment variables to switch between sandbox and production:

Environment Setup
// .env.sandbox
SMARTMONEY_API_KEY=sk_test_demo
SMARTMONEY_API_URL=https://api.smartmoneyapi.com/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.smartmoneyapi.com
  • 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)