Quickstart

Get up and running with the BlueHive API in under five minutes. This guide walks you through installation, authentication, and your first API call.

1

Get your API key

Log in to your BlueHive dashboard and navigate to Settings → API Keys. Create a new key and copy the secret — you will not be able to see it again.

Important: Keep your API key secret. Never expose it in client-side code or commit it to version control. Use environment variables instead.

2

Install an SDK

Choose your language and install the BlueHive SDK.

npm install @bluehive/sdk
3

Make your first request

Initialize the client with your API key and make a call. Here is a complete example that checks the API health and searches for providers.

import BlueHive from '@bluehive/sdk';

const client = new BlueHive({
  apiKey: process.env.BLUEHIVE_API_KEY,
});

// Check API health
const health = await client.health.check();
console.log(health.status); // "ok"

// Search for providers near a zip code
const result = await client.providers.lookup({
  zipCode: '46802',
  radius: 25,
  serviceType: 'drug-test',
});

console.log(`Found ${result.count} providers`);
for (const provider of result.providers) {
  console.log(`  ${provider.name} - ${provider.distance}mi`);
}
Chat with Bea