API Documentation
Access your generated business data programmatically via our REST API. Perfect for testing, training, Power BI integration, Python scripts, or custom dashboards.
Base URL
All endpoints return JSON. CORS is enabled for cross-origin requests.
🔓 Authentication
Current (PoC): No authentication required. Access is open.
Future versions will support API keys for secure access.
Endpoints
/api/export/{scenarioId}/finance.jsonReturns aggregated finance data including P&L summary, monthly cash flow, cost breakdown, and margin analysis. Visualizations are inspired by IBCS© with AC, PY, PL, and FC comparisons.
Example Request
curl https://tellingcube.com/api/export/abc12345-1234-5678-9abc-def012345678/finance.jsonResponse Structure
{
"plSummary": {
"revenue": { "actual": 1234567, "previousYear": 1100000, "plan": 1300000, ... },
"cogs": { "actual": 456789, ... },
"payroll": { "actual": 234567, ... },
"profit": { "actual": 543211, ... }
},
"monthlyCashFlow": [
{ "month": "2024-01-01", "cashIn": 123456, "cashOut": 98765, "netCash": 24691 },
...
],
"costBreakdown": { "payroll": 234567, "payrollPercent": 19.0, ... },
"marginAnalysis": { "grossMargin": 63.0, "netMargin": 44.0, ... }
}/api/export/{scenarioId}/sales.jsonReturns aggregated sales data including monthly revenue, product performance, top customers, and trend analysis. Includes variance data inspired by IBCS©.
Parameters
| Name | Type | Description |
|---|---|---|
topN | integer | Number of top customers to return (default: 10) |
Example Request
curl "https://tellingcube.com/api/export/abc12345-1234-5678-9abc-def012345678/sales.json?topN=5"Response Structure
{
"revenueByMonth": [
{ "month": "2024-01-01", "revenue": 98765, "previousYear": 87654, "plan": 100000, ... },
...
],
"revenueByProduct": [
{ "productId": "PROD-001", "revenue": 234567, "unitsSold": 1234, ... },
...
],
"topCustomers": [
{ "counterpartyId": "CUST-001", "totalRevenue": 45678, "transactionCount": 23 },
...
],
"trendAnalysis": { "avgGrowthRate": 5.2, "maxMonth": "2024-08", "minMonth": "2024-02" }
}/api/export/{scenarioId}/hr.jsonWORKFORCEReturns workforce analytics including headcount, tenure, turnover rates, salary distribution, and employee roster. All employee data is synthetically generated - no real individuals. Optional anonymization replaces names with Employee_001, etc.
Parameters
| Name | Type | Description |
|---|---|---|
anonymize | boolean | Replace names with Employee_001, Employee_002, etc. (default: false) |
Example Request
curl "https://tellingcube.com/api/export/abc12345-1234-5678-9abc-def012345678/hr.json?anonymize=true"Response Structure
{
"scenarioId": "abc12345-...",
"exportedAt": "2024-03-15T10:30:00.000Z",
"synthetic": true,
"summary": {
"headcount": 45,
"avgTenure": 24,
"turnoverRate": 12.5,
"avgSalary": 4500,
"totalPayroll": 202500,
"genderDistribution": { "male": 25, "female": 18, "diverse": 2 }
},
"headcountByDepartment": [
{ "department": "Engineering", "count": 15, "percentage": 33.3 },
...
],
"headcountByMonth": [
{ "month": "2024-01", "headcount": 42, "hires": 3, "terminations": 1, "netChange": 2 },
...
],
"salaryByDepartment": [
{ "department": "Engineering", "avgSalary": 5200, "minSalary": 4000, "maxSalary": 7500, "headcount": 15, "totalPayroll": 78000 },
...
],
"turnoverByMonth": [
{ "month": "2024-01", "turnoverRate": 2.4, "hires": 3, "terminations": 1 },
...
],
"employees": [
{ "id": "emp-001", "name": "Employee_001", "department": "Engineering", "role": "Developer", "salary": 5000, ... },
...
]
}/api/export/{scenarioId}/hr.csvDOWNLOADDownload employee roster as CSV file. Opens directly in Excel or any spreadsheet tool. Includes synthetic employee data (names, departments, roles, salaries, tenure). All data is AI-generated - no real individuals.
Parameters
| Name | Type | Description |
|---|---|---|
anonymize | boolean | Replace names with Employee_001, Employee_002, etc. |
Example Request
curl -O "https://tellingcube.com/api/export/abc12345-1234-5678-9abc-def012345678/hr.csv?anonymize=true"CSV Columns
/api/export/{scenarioId}/events.jsonRAW DATAReturns all raw business events - the foundation of tellingCube data. Perfect for testing, training ML models, or building custom analytics. Each event represents an atomic business transaction (sale, payment, hire, etc.).
Parameters
| Name | Type | Description |
|---|---|---|
eventType | string | Filter by event type (e.g., "sale", "payroll_payment") |
timePeriod | string | Filter by period (e.g., "2024-01") |
Example Request
curl "https://tellingcube.com/api/export/abc12345-1234-5678-9abc-def012345678/events.json?eventType=sale"Response Structure
{
"scenarioId": "abc12345-1234-5678-9abc-def012345678",
"eventCount": 1234,
"events": [
{
"id": "event-uuid",
"eventType": "sale",
"eventDate": "2024-03-15T00:00:00.000Z",
"timePeriod": "2024-03",
"productId": "PROD-001",
"productGroup": "Electronics",
"counterpartyId": "CUST-042",
"region": "Vienna",
"amountEur": 1234.56,
"quantity": 10,
"unitPrice": 123.46,
"metadata": { ... }
},
...
]
}/api/export/{scenarioId}/events.csvDOWNLOADDownload all raw events as CSV file. Opens directly in Excel, Google Sheets, or any data analysis tool. Same data as the JSON endpoint, in tabular format.
Parameters
| Name | Type | Description |
|---|---|---|
eventType | string | Filter by event type |
timePeriod | string | Filter by period |
Example Request
curl -O "https://tellingcube.com/api/export/abc12345-1234-5678-9abc-def012345678/events.csv"CSV Columns
Error Codes
| Code | HTTP Status | Description |
|---|---|---|
INVALID_SCENARIO_ID | 400 | scenarioId is not a valid UUID |
SCENARIO_NOT_FOUND | 404 | Scenario does not exist or has no data |
QUERY_ERROR | 500 | Internal server error |
Usage Examples
import requests
import pandas as pd
SCENARIO_ID = "abc12345-1234-5678-9abc-def012345678"
BASE_URL = "https://tellingcube.com/api/export"
# Get raw events (best for ML/testing)
events = requests.get(f"{BASE_URL}/{SCENARIO_ID}/events.json").json()
print(f"Total Events: {events['eventCount']}")
# Or download as CSV for pandas
df = pd.read_csv(f"{BASE_URL}/{SCENARIO_ID}/events.csv")
print(df.groupby('Event Type')['Amount (EUR)'].sum())
# Get aggregated finance/sales data
finance = requests.get(f"{BASE_URL}/{SCENARIO_ID}/finance.json").json()
print(f"Total Revenue: EUR {finance['plSummary']['revenue']['actual']:,}")
# Get workforce/HR data (with anonymization)
hr = requests.get(f"{BASE_URL}/{SCENARIO_ID}/hr.json?anonymize=true").json()
print(f"Headcount: {hr['summary']['headcount']}, Turnover: {hr['summary']['turnoverRate']}%")const SCENARIO_ID = "abc12345-1234-5678-9abc-def012345678";
const BASE_URL = "https://tellingcube.com/api/export";
// Get raw events (best for testing/training)
const events = await fetch(`${BASE_URL}/${SCENARIO_ID}/events.json`)
.then(res => res.json());
console.log(`Total Events: ${events.eventCount}`);
// Filter by event type
const sales = events.events.filter(e => e.eventType === 'sale');
console.log(`Sale Events: ${sales.length}`);
// Get aggregated finance data
const finance = await fetch(`${BASE_URL}/${SCENARIO_ID}/finance.json`)
.then(res => res.json());
console.log(`Total Revenue: EUR ${finance.plSummary.revenue.actual.toLocaleString()}`);
// Get workforce/HR data (with anonymization)
const hr = await fetch(`${BASE_URL}/${SCENARIO_ID}/hr.json?anonymize=true`)
.then(res => res.json());
console.log(`Headcount: ${hr.summary.headcount}, Avg Salary: EUR ${hr.summary.avgSalary}`);📊 Power BI Integration
Use Get Data - Web and enter the API URL. Power BI will automatically parse the JSON response. For refreshable reports, use Web.Contents with the API URL.
📐 About Scenario Notation (inspired by IBCS©)
Our data uses scenario notation inspired by IBCS© (International Business Communication Standards):
Actual
Current year actual figures (2024)
Previous Year
Last year actual figures (2023)
Plan
Ambitious budget targets set before the period
Forecast
Realistic expectations updated during the period