Developer Quickstart
BrandBard is built API-first. Whether you're building a custom dashboard, an automated reporting tool, or an autonomous AI agent, this guide will get you from zero to your first analysis result in minutes.
Table of Contents
- Authentication & Setup
- Initiate Your First Analysis
- Integration Examples (Node, Python, cURL, Next.js)
- Retrieve & Handle Responses
1. Authentication & Setup
First, navigate to the API Keys Hub and generate a new key. This key must be included in every request as an X-API-Key header.
2. Initiate Your First Analysis
To start a brand analysis, send a POST request to /api/v1/analysis. The only required parameter is the url of the website you wish to analyze.
curl -X POST https://brandbardai.com/api/v1/analysis \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://brandbardai.com"}'
3. Integration Examples
Python
Ideal for data science and backend orchestration.
import requests
url = "https://brandbardai.com/api/v1/analysis"
headers = {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"url": "https://example.com",
"brand_title": "Example Brand"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
Node.js
Perfect for lightweight agents and asynchronous workflows.
const analyzeBrand = async () => {
const response = await fetch('https://brandbardai.com/api/v1/analysis', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://example.com'
})
});
const data = await response.json();
console.log(data);
};
analyzeBrand();
Next.js (React)
A complete example of triggering an analysis from a modern frontend. Note: Never expose your API key to the client. Always route requests through a server action or API route.
API Route (app/api/analyze/route.ts):
import { NextResponse } from 'next/server';
export async function POST(request: Request) {
const { url } = await request.json();
const response = await fetch('https://brandbardai.com/api/v1/analysis', {
method: 'POST',
headers: {
'X-API-Key': process.env.BRANDBARD_API_KEY!,
'Content-Type': 'application/json',
},
body: JSON.stringify({ url }),
});
const data = await response.json();
return NextResponse.json(data, { status: response.status });
}
4. Retrieve & Handle Responses
The API will return a 201 Created status with a unique uuid. You will use this ID to poll for results or identify the payload in a webhook callback.
{
"success": true,
"data": {
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"status": "scraping",
"api_url": "https://brandbardai.com/api/v1/analysis/550e8400-e29b-41d4-a716-446655440000"
}
}
You can poll the api_url returned above. Once the status fields shifts to completed, the payload will contain the complete multi-model consensus strategy report.
Best Practice: For production applications, we highly recommend using Webhooks to receive results asynchronously rather than polling. Read our comprehensive API Docs or download our Postman Collection to start testing immediately.
Need more help? Check out our Integration FAQ for troubleshooting.