Authentication & Setup
This guide explains how to authenticate with Starbloom APIs and set up your environment properly.
Getting API Keys​
Starbloom uses API keys to:
- Authenticate requests
- Track usage
- Apply appropriate rate limits
- Enable access to specific data streams
To get your API key, contact our team.
Authentication Methods​
REST API Authentication​
All REST API requests require:
- An
Authorizationheader with your API key - An
Originheader with your registered domain (optional but highly recommended)
- Shell
- Javascript
# Using curl in your shell of choice
curl -H 'Authorization: Bearer $STARBLOOM_API_KEY' 'https://api.starbloom.ai/api/v1/data/starbloom.uniswapv2.0_0_0.pair_Swap'
const headers = {
'Authorization': `Bearer ${STARBLOOM_API_KEY}`,
'Origin': 'https://your-registered-domain.com'
};
// Example REST API call
const response = await fetch('https://api.starbloom.ai/api/v1/data/starbloom.uniswapv2.0_0_0.pair_Swap', {
headers
});
caution
When making requests from a browser, the Origin header is automatically set and cannot be overridden. Make sure your registered domain matches your actual domain.
WebSocket Authentication​
For WebSocket connections, include your API key as a header or as a url param
- Shell
- Javascript
wscat -H 'Authorization: Bearer $STARBLOOM_API_KEY' -c wss://stream.starbloom.ai/ws/v1
# send subscribe command
> {"jsonrpc": "2.0", "id": 1, "method": "subscribe", "params": {"topics": ["starbloom.uniswapv2.0_0_0.pair_Swap"]}}
// WebSocket connection with authentication
const ws = new WebSocket(
`wss://stream.starbloom.ai/ws/v1?api_key_<api_key>`
);
Troubleshooting​
Common authentication issues and solutions:
-
401 Unauthorized
- Check if your API key is valid
- Ensure the Authorization header is properly formatted
- Verify you're using the correct environment (production/development)
-
403 Forbidden
- Verify your Origin header matches your registered domain
- Check if your API key has the necessary permissions
-
429 Too Many Requests
- You've exceeded your rate limit
- Implement rate limiting on your side
- Consider upgrading your plan
Next Steps​
- Learn about your first integration
- Read more on authentication
Need help? Join our Discord community (coming soon) or email us at [email protected].