Authentication
All API requests require authentication using an API key. Include your key in the Authorization header:
Authorization: Bearer your-api-key-here
You can generate API keys in your account settings. Keep your keys secure and never expose them in client-side code.
Base URL
https://api.fusionanalytics.tech/v1
Endpoints
Data Sources
GET
/datasources
List all connected data sources
// Response
{
"data": [
{
"id": "ds_abc123",
"name": "Production Database",
"type": "postgresql",
"status": "connected",
"created_at": "2024-01-15T10:30:00Z"
}
],
"meta": { "total": 1, "page": 1 }
}
POST
/datasources
Create a new data source connection
// Request
{
"name": "Analytics DB",
"type": "postgresql",
"config": {
"host": "db.example.com",
"port": 5432,
"database": "analytics",
"username": "readonly"
}
}
Queries
POST
/queries/execute
Execute a query against a data source
// Request
{
"datasource_id": "ds_abc123",
"query": "SELECT date, SUM(revenue) FROM sales GROUP BY date",
"parameters": {}
}
// Response
{
"data": {
"columns": ["date", "sum"],
"rows": [
["2024-01-01", 15420.50],
["2024-01-02", 18230.75]
]
},
"execution_time_ms": 124
}
Dashboards
GET
/dashboards
List all dashboards
GET
/dashboards/:id
Get a specific dashboard with all widgets
AI Insights
POST
/ai/query
Ask a natural language question about your data
// Request
{
"question": "What was our top selling product last month?",
"datasource_id": "ds_abc123"
}
// Response
{
"answer": "Your top selling product last month was 'Premium Widget' with 1,234 units sold.",
"query_generated": "SELECT product_name, SUM(quantity) ...",
"confidence": 0.95
}
Rate Limits
API requests are limited based on your plan:
- Starter: 1,000 requests/hour
- Professional: 10,000 requests/hour
- Enterprise: Unlimited
SDKs
We provide official SDKs for popular languages:
JavaScript
npm install @fusionanalytics/sdk
Python
pip install fusionanalytics
Ruby
gem install fusionanalytics