Skip to main content

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:

  1. An Authorization header with your API key
  2. An Origin header with your registered domain (optional but highly recommended)
# 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'
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

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"]}}

Troubleshooting​

Common authentication issues and solutions:

  1. 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)
  2. 403 Forbidden

    • Verify your Origin header matches your registered domain
    • Check if your API key has the necessary permissions
  3. 429 Too Many Requests

    • You've exceeded your rate limit
    • Implement rate limiting on your side
    • Consider upgrading your plan

Next Steps​

Need help? Join our Discord community (coming soon) or email us at [email protected].