Developer-friendly API

API Documentation

Integrate LottoLabs.ai analytics directly into your applications. Upload data, run analyses, and retrieve results programmatically with our RESTful API.

Quick Start

1

Get your API key

Sign up for a Plus or Pro plan, then generate an API key from your Dashboard → Settings → API Keys.

2

Make your first request

Upload a CSV file and run a full analysis with a single API call.

cURL
curl -X POST https://api.lottolabs.ai/api/v1/analyze \
  -H "Authorization: Bearer ll_sk_your_api_key_here" \
  -H "Content-Type: multipart/form-data" \
  -F "file=@your-data.csv" \
  -F "analysis_type=full"
3

Get your results

The API returns detected patterns, anomalies, correlations, and trend analyses in a structured JSON response.

Response (JSON)
{
  "id": "anl_8k2j4f9s1m",
  "status": "completed",
  "results": {
    "total_patterns": 7,
    "total_anomalies": 3,
    "processing_time_ms": 2340
  }
}

Authentication

All API requests require an API key passed in the Authorization header as a Bearer token. API keys begin with the ll_sk_ prefix.

Header
Authorization: Bearer ll_sk_your_api_key_here

Keep your API key secret. Never expose it in client-side code or public repositories. If compromised, rotate it immediately from your dashboard.

Endpoints

POST/api/v1/analyze

Upload a dataset and run AI-powered analysis. Returns detected patterns, anomalies, trends, and statistical summaries.

Request
curl -X POST https://api.lottolabs.ai/api/v1/analyze \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: multipart/form-data" \
  -F "file=@dataset.csv" \
  -F "analysis_type=full" \
  -F "options={\"detect_anomalies\": true, \"trend_periods\": 12}"
Response
{
  "id": "anl_8k2j4f9s1m",
  "status": "completed",
  "dataset": {
    "rows": 15420,
    "columns": 8,
    "file_name": "dataset.csv"
  },
  "results": {
    "patterns": [
      {
        "type": "trend",
        "column": "revenue",
        "direction": "upward",
        "confidence": 0.94,
        "description": "Consistent upward trend with 12% month-over-month growth"
      }
    ],
    "anomalies": [
      {
        "row": 8847,
        "column": "revenue",
        "value": 284500,
        "expected_range": [42000, 68000],
        "severity": "high"
      }
    ],
    "trend_analysis": {
      "periods": 12,
      "values": [52400, 54100, 56800, 59200, ...]
    },
    "summary": {
      "total_patterns": 7,
      "total_anomalies": 3,
      "processing_time_ms": 2340
    }
  }
}
GET/api/v1/datasets

List all datasets in your account. Supports pagination and filtering by status or date range.

Request
curl https://api.lottolabs.ai/api/v1/datasets \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -G -d "page=1" -d "limit=20" -d "status=analyzed"
Response
{
  "data": [
    {
      "id": "ds_3f8a2k1n",
      "name": "Q1 Sales Data",
      "rows": 15420,
      "columns": 8,
      "status": "analyzed",
      "created_at": "2026-03-10T14:30:00Z",
      "last_analysis": "2026-03-10T14:32:34Z"
    },
    {
      "id": "ds_9m4b7h2x",
      "name": "Customer Metrics",
      "rows": 8750,
      "columns": 12,
      "status": "analyzed",
      "created_at": "2026-03-08T09:15:00Z",
      "last_analysis": "2026-03-08T09:17:12Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 12,
    "has_more": false
  }
}
GET/api/v1/results/:id

Retrieve the full analysis results for a specific dataset. Includes patterns, anomalies, trend analyses, and visualisation data.

Request
curl https://api.lottolabs.ai/api/v1/results/anl_8k2j4f9s1m \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{
  "id": "anl_8k2j4f9s1m",
  "dataset_id": "ds_3f8a2k1n",
  "status": "completed",
  "created_at": "2026-03-10T14:32:34Z",
  "results": {
    "patterns": [...],
    "anomalies": [...],
    "correlations": [
      {
        "columns": ["ad_spend", "revenue"],
        "coefficient": 0.87,
        "p_value": 0.001,
        "relationship": "strong_positive"
      }
    ],
    "distributions": {
      "revenue": {
        "mean": 48200,
        "median": 45800,
        "std_dev": 12400,
        "skewness": 0.34
      }
    }
  },
  "charts": {
    "trend_url": "https://api.lottolabs.ai/charts/tr_...",
    "distribution_url": "https://api.lottolabs.ai/charts/ds_..."
  }
}
POST/api/v1/analyze-trends

Run a trend analysis model on an existing dataset. Specify the target column and number of future periods to analyze.

Request
curl -X POST https://api.lottolabs.ai/api/v1/analyze-trends \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "dataset_id": "ds_3f8a2k1n",
    "target_column": "revenue",
    "periods": 6,
    "confidence_interval": 0.95,
    "model": "auto"
  }'
Response
{
  "id": "trnd_5n7c3k9w",
  "dataset_id": "ds_3f8a2k1n",
  "model_used": "prophet_ensemble",
  "target_column": "revenue",
  "trend_values": [
    {
      "period": 1,
      "value": 52400,
      "lower_bound": 48100,
      "upper_bound": 56700
    },
    {
      "period": 2,
      "value": 54100,
      "lower_bound": 49200,
      "upper_bound": 59000
    },
    {
      "period": 3,
      "value": 56800,
      "lower_bound": 50800,
      "upper_bound": 62800
    }
  ],
  "accuracy_metrics": {
    "mape": 4.2,
    "rmse": 2140,
    "r_squared": 0.91
  }
}

Rate Limits

PlanAPI RequestsNote
FreeN/AAPI access not included
Plus1,000 / month~33 requests per day
Pro50,000 / month~1,667 requests per day
Lifetime50,000 / monthSame as Pro tier

Rate limits are applied per API key. If you exceed your limit, the API returns a 429 Too Many Requests response with a Retry-After header. Upgrade your plan for higher limits.

Ready to integrate?

Get your API key and start building with LottoLabs.ai in minutes. API access is available on Plus and Pro plans.