Skip to main content

🚀 Quick Start Guide

Get up and running with Starbloom in minutes. This guide will help you make your first integration with Starbloom's data infrastructure.

Prerequisites​

  • A Starbloom API key (email [email protected] to get access)
  • Basic understanding of blockchain data structures
  • (Optional) Node.js 16+ for running example code

Step 1: Get Your API Key​

const STARBLOOM_API_KEY = 'your-api-key-here';

Step 2: Choose Your Integration Method​

Starbloom offers three main ways to integrate:

Option 1: Use Existing Connectors Directly via REST API​

Best for quick integrations and exploring data:

# 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'

Option 2: Use WebSocket for Real-time Data​

Best for real-time applications:

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

Option 3: Build a Custom Connector​

Best for custom data sources or specific needs. Learn more about building connectors →

Step 3: Test Your Connection​

Here's a complete example to test your connection:

const testConnection = async () => {
try {
// Test REST API
const restResponse = await fetch(
'https://api.starbloom.ai/api/v1/data/starbloom.uniswapv2.0_0_0.pair_Swap?limit=1',
{
headers: {
'Authorization': `Bearer ${STARBLOOM_API_KEY}`
}
}
);
console.log('REST API Status:', restResponse.status);

// Test WebSocket
const ws = new WebSocket(
`wss://stream.starbloom.ai/ws/v1?api_key=<api_key>`
);

ws.onopen = () => {
console.log('WebSocket Connected!');
// Close after success
setTimeout(() => ws.close(), 1000);
};

ws.onerror = (error) => {
console.error('WebSocket Error:', error);
};
} catch (error) {
console.error('Connection Test Failed:', error);
}
};

testConnection();

Next Steps​

Now that you've made your first connection, you can:

  1. Explore available data streams
  2. Learn about authentication and rate limits
  3. Read our best practices guide
  4. Build a custom connector

Common Issues​

  • API Key Invalid: Ensure you've properly set up your API key in the headers
  • Connection Failed: Check your internet connection and firewall settings
  • Rate Limit Exceeded: Review our rate limits.

Getting Help​

If you run into any issues:

tip

Remember to keep your API key secure and never commit it to version control!