Troubleshooting Guide
This guide covers common issues developers encounter when integrating with the CHRT API and provides step-by-step solutions.Authentication Issues
Invalid API Key Error (401)
Error Message:{"error": "Invalid API key", "code": 401}
Common Causes:
- Incorrect API key format or typo
- Using test key in live environment (or vice versa)
- Key has been revoked or expired
- Wrong authentication header format
-
Verify Key Format:
-
Check Environment Match:
- Use
pk_test_orsk_test_keys for development - Use
pk_live_orsk_live_keys for production
- Use
-
Verify Header Format:
- Check Key Status: Go to Dashboard → API Keys and verify the key is active
Forbidden Error (403)
Error Message:{"error": "Insufficient permissions", "code": 403}
Common Causes:
- API key lacks required scopes for the endpoint
- Domain/IP restrictions blocking the request
- Using public key for server-side operations
-
Check Key Scopes: Verify your key has the required permissions:
enc.tiles:read- For map tile requestsfeatures.search:read- For chart feature queriesquery.spatial:read- For spatial queries
-
Review Domain Restrictions (Public Keys):
- Ensure your domain is listed in allowed origins
- Check for typos in domain configuration
- Verify protocol (http vs https) matches
-
Check IP Restrictions (Secret Keys):
- Verify your server IP is in the allowlist
- Use CIDR notation for IP ranges:
192.168.1.0/24
-
Use Correct Key Type:
- Use secret keys for server-side API calls
- Use public keys only for client-side/browser requests
Rate Limiting Issues
Rate Limit Exceeded (429)
Error Message:{"error": "Rate limit exceeded", "code": 429, "retry_after": 60}
Understanding Rate Limits:
- Per-key limits: Based on your subscription plan
- Global limits: Protect overall system stability
- Sliding window: Resets continuously, not at fixed intervals
-
Implement Exponential Backoff:
-
Optimize Request Patterns:
- Batch multiple operations into single requests
- Cache responses to avoid repeated calls
- Use appropriate polling intervals
- Upgrade Your Plan: Higher tiers have increased rate limits
- Request Rate Limit Increase: Contact support for custom limits
Chart Data Issues
No Chart Data Available
Error Message:{"error": "No chart data available for this area", "code": 404}
Common Causes:
- Requesting data outside covered geographic areas
- Coordinates in wrong format (lat/lon swapped)
- Zoom level too high for available chart detail
-
Verify Geographic Coverage:
-
Check Coordinate Format:
-
Adjust Zoom Levels:
- Start with lower zoom levels (1-10) for broad areas
- Use higher zoom levels (11-18) only for detailed coastal areas
- Check ENC Status: Visit the ENC Status page for data availability
Outdated Chart Information
Symptoms: Chart data appears old or doesn’t match recent changes Solutions:-
Check Data Freshness:
- Clear Application Cache: Remove cached chart data from your application
- Report Data Issues: Contact support with specific coordinates and expected information
Network and Connectivity Issues
Request Timeouts
Common Causes:- Large geographic areas requiring significant processing
- Network connectivity issues
- Server maintenance or high load
-
Increase Timeout Settings:
- Reduce Request Size: Break large areas into smaller bounding boxes
- Implement Retry Logic: Retry failed requests with exponential backoff
CORS Errors (Browser Only)
Error Message:Access to fetch at 'https://api.chrt.co' from origin 'https://yourdomain.com' has been blocked by CORS policy
Solutions:
- Add Domain to API Key: Go to Dashboard → API Keys → Edit → Add your domain to allowed origins
-
Check Domain Format:
- Use Public Keys: Only public keys work with CORS/browser requests
- Development Setup: Add localhost domains for local testing
Integration Issues
Chart Tiles Not Loading
Symptoms: Map displays but chart overlays don’t appear Debugging Steps:- Check Network Tab: Look for 404 or authentication errors
-
Verify Tile URL Format:
- Test Direct Tile Access: Try accessing a tile URL directly in browser
Feature Queries Returning Empty Results
Common Issues:- Bounding box too small or in areas without chart features
- Incorrect query parameters
- Missing required scopes on API key
- Expand Search Area: Try larger bounding boxes
-
Check Query Syntax:
- Verify Feature Types: Check available feature types in documentation
Performance Optimization
Slow API Responses
Optimization Strategies:-
Implement Caching:
- Use Appropriate Precision: Don’t request more precision than needed
- Batch Requests: Combine multiple operations when possible
- CDN Integration: Use a CDN for tile caching
High Bandwidth Usage
Reduction Strategies:- Optimize Tile Requests: Only request visible tiles
- Implement Smart Caching: Cache frequently accessed data
- Use Compression: Enable gzip compression in your client
- Monitor Usage: Track bandwidth consumption in dashboard
Getting Help
Before Contacting Support
- Check Status Page: Visit https://status.chrt.co for known issues
- Review This Guide: Ensure you’ve tried relevant solutions
- Test with Different Keys: Try both test and live environments
- Check Recent Changes: Consider recent code or configuration changes
When Contacting Support
Include the following information:- API Key ID (not the full key): First and last 4 characters
- Request Details: Full API request including headers
- Error Response: Complete error message and HTTP status code
- Geographic Area: Coordinates or region affected
- Timestamp: When the issue occurred
- Browser/Environment: If relevant to the issue
Support Channels
- Documentation: https://docs.chrt.co
- Community: https://community.chrt.co
- Email: [email protected]
- Status Updates: https://status.chrt.co
Emergency Support
For production-critical issues:- Enterprise Customers: Use priority support channel
- All Users: Clearly mark emails as “URGENT” with impact description
- Status Page: Check for ongoing incidents before reporting
