Overview
The Cred Protocol sandbox provides mock API endpoints for development and testing. Use the sandbox to build and test your integration without consuming your API quota or waiting for real blockchain queries.Why Use the Sandbox?
Free Testing
Sandbox requests don’t count against your API quota
Instant Responses
No blockchain queries means instant responses
Consistent Data
Deterministic responses for reliable testing
No Dependencies
Test without relying on blockchain data availability
Sandbox Endpoints
| Sandbox Endpoint | Production Equivalent |
|---|---|
/api/v2/sandbox/score/address/{address} | /api/v2/score/address/{address} |
/api/v2/sandbox/score/batch/ | /api/v2/score/batch/ |
/api/v2/sandbox/report/address/{address} | /api/v2/report/address/{address} |
Getting Started
1. Use Sandbox During Development
Simply add/sandbox before the endpoint path:
2. Sandbox Response Format
Sandbox responses use the same format as production:Sandbox responses are deterministic - the same address always returns the same mock score. This makes testing reliable and reproducible.
Test Scenarios
Testing Different Score Ranges
Use these test addresses to simulate different credit scores:| Address | Mock Score | Range |
|---|---|---|
0x0000000000000000000000000000000000000001 | 935+ | excellent |
0x0000000000000000000000000000000000000002 | 770-858 | good |
0x0000000000000000000000000000000000000003 | 655-769 | fair |
0x0000000000000000000000000000000000000004 | 300-654 | low |
Testing Your UI
Use the sandbox to test how your UI handles different scenarios:CI/CD Integration
Automated Testing
Use the sandbox in your test suite for consistent, fast tests:GitHub Actions Example
Best Practices
Use environment-based switching
Use environment-based switching
Configure your application to automatically use sandbox in development:
Use configuration to manage environments
Use configuration to manage environments
Add a check to ensure you’re using the correct endpoint in production:
Test error handling
Test error handling
The sandbox returns consistent error responses too:
- Invalid addresses return 400 errors
- Missing auth returns 401 errors
- Use these to test your error handling
Don't hardcode sandbox
Don't hardcode sandbox
Never hardcode
/sandbox/ in production code:Transitioning to Production
When you’re ready to go live:1
Review Your Integration
Ensure all features work correctly with sandbox data
2
Update Configuration
Set your environment to production mode
3
Test with Production
Make a few test requests to verify production access
4
Monitor Usage
Check your Dashboard to ensure requests are being tracked correctly