← Home

Queryly API

AI-powered data analysis. Upload files, ask questions in plain English, get real code, charts, and insights. Multi-persona analyst swarm for deeper analysis.

Base URL: https://getqueryly.com

Quick Start

# 1. Upload a dataset
curl -X POST https://getqueryly.com/api/data-scientist/upload \
  -F "session_id=my_session_1" \
  -F "file=@sales_data.csv"

# 2. Ask a question
curl -X POST https://getqueryly.com/api/data-scientist/query \
  -F "session_id=my_session_1" \
  -F "query=Show average revenue by region"

# 3. Run a health check
curl https://getqueryly.com/api/data-scientist/health/my_session_1

Authentication

Queryly supports two authentication methods: API keys for server-to-server calls, and Firebase ID tokens for user sessions.

API Key Authentication

Generate an API key from the dashboard. Include it in the X-API-Key header.

curl -H "X-API-Key: dmk_your_key_here" \
  https://getqueryly.com/api/makes/limits

Bearer Token Authentication

For user-specific endpoints, use the Firebase ID token from sign-in.

curl -H "Authorization: Bearer eyJhbGciOi..." \
  https://getqueryly.com/api/auth/me

Rate Limits

Limits are per-day and reset at midnight UTC. Anonymous users get 5 uses/day.

TierDaily LimitPrice
Anonymous5 uses/dayFree
Free (registered)10 uses/dayFree
Starter100 uses/dayGHS 29/mo
Developer500 uses/dayGHS 99/mo
Business1,000 uses/dayGHS 249/mo

Pay-as-you-go credits are also available and never expire.

Upload File

POST /api/data-scientist/upload

Upload a CSV, Excel, JSON, PDF, or text file. Returns an overview of the data and a session ID for querying.

ParamTypeRequiredDescription
session_idstringYesUnique session identifier (e.g., ds_1234567890_abc)
fileFileYesFile to upload. Max 50MB. CSV, XLSX, XLS, JSON, PDF, TXT, MD, PARQUET.
curl -X POST https://getqueryly.com/api/data-scientist/upload \
  -F "session_id=ds_1720000000_abc12" \
  -F "file=@sales_data.csv"

Response

{
  "session_id": "ds_1720000000_abc12",
  "load_info": {
    "rows": 4520,
    "columns": 12,
    "column_names": ["date", "region", "product", "revenue", ...],
    "dtypes": {"date": "object", "revenue": "float64", ...}
  },
  "overview": "📊 **Dataset Loaded**\n\nYour file has **4,520 rows** and **12 columns**.\n\nColumns: date, region, product, revenue, units_sold, ..."
}

Query Data

POST /api/data-scientist/query

Ask a natural language question about your data. The AI writes and executes real Python code to produce results with charts.

ParamTypeRequiredDescription
session_idstringYesSession ID from upload
querystringYesNatural language question
curl -X POST https://getqueryly.com/api/data-scientist/query \
  -F "session_id=ds_1720000000_abc12" \
  -F "query=Show average salary by department as a bar chart"

Response

{
  "text": "The average salary by department is:\n- Engineering: $95,400\n- Marketing: $72,300\n- Sales: $68,100\n\nA bar chart has been generated.",
  "charts": ["/outputs/ds_1720000000_abc12/salary_bar_chart.png"],
  "code_executed": true,
  "session_id": "ds_1720000000_abc12"
}

Generate Code

POST /api/data-scientist/generate

Generate Python analysis code without executing it. Useful for previewing what the AI would do.

ParamTypeRequiredDescription
session_idstringYesSession ID from upload
querystringYesWhat to generate code for

Health Check

GET /api/data-scientist/health/{session_id}

Run a data quality health check. Scores completeness, consistency, accuracy, and timeliness across all dimensions.

curl https://getqueryly.com/api/data-scientist/health/ds_1720000000_abc12

Response

{
  "overall_score": 82,
  "dimensions": {
    "completeness": {"score": 85, "detail": "3.2% missing values"},
    "consistency": {"score": 90, "detail": "No type mismatches"},
    "accuracy": {"score": 78, "detail": "2 outlier regions detected"},
    "timeliness": {"score": 75, "detail": "Data spans 2023-2025"}
  },
  "summary": "Your data is in good shape with minor issues.",
  "fixes": ["Fill 145 missing email values", "Review 12 salary outliers"]
}

Insights

GET /api/data-scientist/insights/{session_id}

Mine actionable insights from your data. Finds correlations, trends, anomalies, and patterns automatically.

curl https://getqueryly.com/api/data-scientist/insights/ds_1720000000_abc12

Analyst Swarm

POST /api/data-scientist/swarm

Deploy multiple AI analyst personas. Each analyzes independently, then findings are cross-validated and consolidated.

<>No
ParamTypeRequiredDescription
session_idstringYesSession ID from upload
querystringYesAnalysis question for the swarm
depthstringquick, standard, or deep (default: standard)
curl -X POST https://getqueryly.com/api/data-scientist/swarm \
  -F "session_id=ds_1720000000_abc12" \
  -F "query=Analyze this data thoroughly and provide key insights" \
  -F "depth=deep"

Response

{
  "persona_names": ["Statistician", "BI Analyst", "Domain Expert"],
  "persona_results": {
    "statistician": {"name": "Statistician", "output": "Revenue follows a right-skewed distribution..."},
    "bi_analyst": {"name": "BI Analyst", "output": "Q4 shows 23% growth over Q3..."},
    "domain_expert": {"name": "Domain Expert", "output": "The engineering department drives 62%..."}
  },
  "consensus": {"text": "Key finding: Revenue is growing 15% QoQ driven by..."}
}

Available Personas

GET /api/data-scientist/personas

List all available analyst personas and their roles.

PersonaRole
statisticianStatistical analysis, distributions, significance tests
bi_analystBusiness intelligence, KPIs, revenue drivers
data_engineerData quality, missing values, schema validation
domain_expertDomain-specific insights and recommendations
economistPricing, optimization, market dynamics

List Sessions

GET /api/sessions

List all active sessions for the current user.

Session History

GET /api/sessions/{session_id}/history

Get query history for a session.

Delete Session

DELETE /api/data-scientist/session/{session_id}

Delete a session and all its data.

User Info

GET /api/auth/me

Get current user info. Requires Bearer token.

curl -H "Authorization: Bearer eyJhbGciOi..." \
  https://getqueryly.com/api/auth/me

Response

{
  "uid": "abc123",
  "email": "user@example.com",
  "displayName": "John",
  "provider": "password",
  "tier": "free",
  "dailyLimit": 10
}

API Keys

POST /api/keys/generate

Generate a new API key. Requires Bearer token.

GET /api/keys

List all API keys for the current user.

POST /api/keys/{key_hash}/revoke

Revoke an API key.

POST /api/keys/{key_hash}/rotate

Rotate an API key (generates a new key, invalidates the old one).

Pricing

GET /api/pricing

Get all pricing plans and pay-as-you-go options.

curl https://getqueryly.com/api/pricing

Usage Limits

GET /api/makes/limits

Check current usage and remaining daily limit.

curl https://getqueryly.com/api/makes/limits

Response

{
  "tier": "free",
  "limit": 10,
  "used": 3,
  "remaining": 7,
  "balance": 0,
  "total_available": 7
}
GET /api/makes/stats

Get detailed usage statistics.

Payments

Queryly uses Paystack for payments. All amounts are in GHS (Ghanaian Cedis).

POST /api/pay/initialize

Initialize a Paystack payment for subscription or pay-as-you-go credits.

POST /api/pay/verify

Verify a completed Paystack payment and activate subscription/credits.

Chat

POST /api/chat

Send a message to the AI chat. Context-aware conversations about your data.

GET /api/chat/history

Get chat history for the current session.

Service Health

GET /health

Check service health, uptime, and system status.

curl https://getqueryly.com/health

Response

{
  "status": "ok",
  "service": "Queryly",
  "version": "2.0",
  "firebase": "connected",
  "queue": {"waiting": 0, "running": 0, "capacity": 3},
  "disk_gb": 65.4,
  "uptime": "active"
}