Luna

API docs

Base URL https://api-veri.lunafzai.com. Authenticate with the header X-API-Key (shown right after checkout). All requests are JSON, max 200 KB.

POST /v1/generate

Body: {"schema": {...}, "seed": 42} or {"spec": {...}}. Returns application/zip with one CSV per table, spec.json, quality.json. The rows requested are deducted from your quota. Same spec + same seed = identical output.

Schema format

{"tables": [
  {"name": "orders", "rows": 8000, "description": "web shop orders",   // optional, ≤300 chars
   "columns": [
     {"name": "order_id", "type": "bigint", "description": "primary key"},
     {"name": "customer_id", "type": "bigint", "references": "customers.customer_id"},
     {"name": "coupon_code", "type": "varchar(20)", "nullable": true},
     {"name": "email", "type": "varchar(200)", "unique": true}]}]}

Allowed keys: tables, name, rows, description, columns, type, nullable, unique, references, notes, locale, format. Types: common SQL types (int, bigint, numeric, varchar, text, boolean, date, timestamp, uuid, enum, json…). Limits: 12 tables, 60 columns per table, 100,000 rows per request. Requests containing e-mail addresses, phone numbers, IBANs, card numbers or unknown keys (such as sample rows) are rejected with HTTP 400.

Spec format (spec.json)

Column types: id, uuid, int, float, category, bool, datetime, date, fk, email, name, company, text.

FieldMeaning
dist, mean, std, min, max, lam, decimalsint/float distribution: normal, lognormal, uniform, poisson, exponential. mean/std in real units.
values, weightscategory values and relative frequencies
depends_on, values_by, templates_by, weights_bycategory/text conditional on another category column
start, end, dist: recentdatetime range
after: {"col"} | {"via", "col"}, max_days_aftertime order: after a column in the same table, or after the parent row's column via a foreign key
ref, skewforeign key target table.column; skew 0 = uniform, >0 = popular parents get more children
correlations: [{"a","b","r"}]table level, Spearman target between numeric columns (Gaussian copula)
null_rate, uniqueshare of empty values; uniqueness

Errors

CodeMeaning
400invalid JSON or rejected by input policy
401missing, invalid or refunded API key
402quota exceeded (response says remaining rows)
422schema could not be interpreted; simplify descriptions or send a spec
503temporary capacity limit

Example

curl -X POST https://api-veri.lunafzai.com/v1/generate \
  -H "X-API-Key: $KEY" -H "Content-Type: application/json" \
  -d '{"schema": '"$(cat schema.json)"'}' -o data.zip
unzip data.zip   # edit spec.json, then:
curl -X POST https://api-veri.lunafzai.com/v1/generate -H "X-API-Key: $KEY" \
  -H "Content-Type: application/json" -d '{"spec": '"$(cat spec.json)"', "seed": 7}' -o v2.zip