API Authentication & Security
Secure authentication is critical for protecting your account and API keys. Smart Money API supports multiple authentication methods: API Key authentication, JWT tokens, and OAuth. This guide covers implementation details, security best practices, and troubleshooting common authentication issues.
API Key Authentication
API Key authentication is the simplest method, ideal for server-to-server communication. Include your API key in the X-API-Key header with every request.
API Key method characteristics:
- Simplest implementation - single header value
- No token refresh required
- Suitable for backend services with secure key storage
- Best for fixed-frequency data polling
- IP restriction recommended for security
JWT Token Flow
JWT (JSON Web Token) authentication is suitable for applications requiring user authorization. Exchange credentials for a time-limited JWT token that's included in request headers.
JWT flow process:
- Send login credentials to the authentication endpoint
- Receive JWT token (expires in 24 hours)
- Include token in Authorization header: "Bearer token_here"
- Refresh token before expiration using refresh endpoint
OAuth Integration
OAuth is recommended for third-party applications accessing user data with explicit permission. Implements standard OAuth 2.0 flow with authorization codes and refresh tokens.
OAuth enables secure delegation of permissions without sharing passwords. Users grant your application specific scopes of access (read-only, write, etc.) that can be revoked anytime.
Rate Limit Handling
All API tiers have rate limits. Monitor rate limit headers to avoid 429 (Too Many Requests) responses.
Rate Limits by Tier
- Free: 200 requests/day, 1 concurrent connection
- Trader: 3,000 requests/day, 5 concurrent connections
- Pro: 15,000 requests/day, 20 concurrent connections, batch operations
Security Best Practices
Essential security practices:
- Rotate API keys quarterly and after suspected compromises
- Restrict API keys to specific IP addresses when possible
- Use HTTPS only - never send API keys over unencrypted connections
- Monitor API usage in dashboard for anomalies
- Implement request signing for extra security on sensitive operations
- Create separate keys for development and production
- Immediately revoke keys if exposed in logs or code
Secure Your Integration
Review our security checklist and implement best practices in your integration. Start with API key setup and progress to OAuth for production applications.
View Full Security Guide