DataSynth PL — API Docs
Generate GDPR-compliant synthetic data programmatically. 15 templates · 3 locales (PL/US/DE) · CSV, JSON, Excel.
https://datasynth.pl ·
Version: v1 ·
Auth: Bearer API Key
Overview
The DataSynth PL API lets you generate realistic, RODO/GDPR-compliant synthetic datasets on demand. Each request returns a downloadable file (CSV, JSON, or Excel) with a unique random seed — data never repeats across calls.
Every generated dataset is statistically realistic but contains no real personal data — safe to use for AI training, testing, and demos.
Authentication
All API requests require an API key passed as a Bearer token in the Authorization header.
# All requests must include this header:
Authorization: Bearer ds_live_your_api_key_here
Get your API key from the client dashboard → Klucze API. Keys start with ds_live_ and are shown only once at creation.
Quick Start
cURL
curl -X POST https://datasynth.pl/api/generate \
-H "Authorization: Bearer ds_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"template":"ecommerce_customer_pl","rows":1000,"format":"csv"}' \
--output customers.csv
Python
import requests
API_KEY = "ds_live_YOUR_KEY"
BASE_URL = "https://datasynth.pl/api/generate"
response = requests.post(
BASE_URL,
headers={"Authorization": f"Bearer {API_KEY}"},
json={
"template": "ecommerce_customer_pl",
"rows": 5000,
"format": "csv",
}
)
with open("customers.csv", "wb") as f:
f.write(response.content)
print(f"Generated {response.headers.get('X-Records-Generated')} records")
# Generated 5000 records
JavaScript / Node.js
const fs = require('fs');
const response = await fetch('https://datasynth.pl/api/generate', {
method: 'POST',
headers: {
'Authorization': 'Bearer ds_live_YOUR_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
template: 'hr_employee_us',
rows: 2000,
format: 'json',
}),
});
const buffer = await response.arrayBuffer();
fs.writeFileSync('employees.json', Buffer.from(buffer));
console.log('Done!', response.headers.get('X-Records-Generated'), 'records');
POST /api/generate
Generate a synthetic dataset and return it as a downloadable file.
Request body (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
template |
string | required | Template ID (see Templates) |
rows |
integer | required | Number of records to generate. Capped by plan limits. |
format |
string | optional | csv (default), json, xlsx (Business+) |
Response
Returns the file as a binary stream with appropriate Content-Type. Key response headers:
| Header | Value |
|---|---|
Content-Disposition | attachment; filename="datasynth_..." |
X-Records-Generated | Actual number of records in the file |
X-Template | Template ID used |
Templates
Each template generates a different type of data. The locale suffix (_pl, _us, _de) determines language, currency, and region-specific formatting.
| Template ID | Description | Fields |
|---|---|---|
ecommerce_customer_pl | 🇵🇱 E-commerce customers | id, imie, nazwisko, email, telefon, miasto, segment, ltv_pln… |
fintech_transaction_pl | 🇵🇱 Financial transactions | transaction_id, kwota_pln, kategoria, merchant, flaga_fraud… |
hr_employee_pl | 🇵🇱 HR employees | id_pracownika, stanowisko, wynagrodzenie_pln, dzial… |
medical_patient_pl | 🇵🇱 Patient records (anon.) | patient_id, wiek, bmi, diagnoza, ubezpieczenie… |
logistics_shipment_pl | 🇵🇱 Logistics shipments | shipment_id, przewoznik, status, waga_kg… |
ecommerce_customer_us | 🇺🇸 E-commerce customers | id, first_name, last_name, state, zip_code, ltv_usd… |
fintech_transaction_us | 🇺🇸 Financial transactions | transaction_id, amount_usd, method (ACH/Venmo/Zelle)… |
hr_employee_us | 🇺🇸 HR employees | employee_id, job_title, annual_salary_usd, state… |
medical_patient_us | 🇺🇸 Patient records (anon.) | patient_id, age, insurance (Medicare/Medicaid)… |
logistics_shipment_us | 🇺🇸 Logistics shipments | shipment_id, carrier (FedEx/UPS/USPS), weight_lbs… |
ecommerce_kunde_de | 🇩🇪 E-Commerce Kunden | id, vorname, nachname, bundesland, plz, ltv_eur… |
fintech_transaktion_de | 🇩🇪 Finanztransaktionen | transaktions_id, betrag_eur, methode (EC-Karte/SEPA)… |
hr_mitarbeiter_de | 🇩🇪 Mitarbeiterdaten HR | mitarbeiter_id, position, jahresgehalt_eur, bundesland… |
medical_patient_de | 🇩🇪 Patientendaten (anon.) | patienten_id, alter, krankenversicherung (Gesetzlich/Privat)… |
logistics_sendung_de | 🇩🇪 Paketsendungen | sendungs_id, paketdienst (DHL/Hermes/DPD), gewicht_kg… |
Formats
| Format | Content-Type | Plans |
|---|---|---|
csv | text/csv | Free Starter Business Enterprise |
json | application/json | Free Starter Business Enterprise |
xlsx | application/vnd.openxmlformats… | Business Enterprise |
Plan Limits
| Plan | Records/month | Max per request | API Keys | Formats |
|---|---|---|---|---|
| Free | 100 | 100 | — | CSV, JSON |
| Starter — 49 zł/mc | 100 000 | 5 000 | 3 | CSV, JSON |
| Business — 149 zł/mc | 1 000 000 | 50 000 | 10 | CSV, JSON, Excel |
| Enterprise | Unlimited | 200 000 | 20 | All formats |
Record counters reset monthly on your subscription renewal date.
Error Codes
| HTTP | Code | Meaning |
|---|---|---|
| 401 | Unauthorized | Missing or invalid API key |
| 400 | Bad Request | Unknown template ID or missing required field |
| 429 | Too Many Requests | Monthly record limit exceeded — upgrade plan or wait for reset |
| 500 | Server Error | Unexpected error — contact kontakt@datasynth.pl |
# Example error response (JSON body):
{
"error": "Przekroczono limit rekordów dla Twojego planu.",
"upgrade": "https://datasynth.pl/#cennik"
}
Python SDK (minimal)
No package yet — copy this helper class into your project:
import requests
class DataSynth:
BASE = "https://datasynth.pl/api/generate"
def __init__(self, api_key: str):
self.headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
}
def generate(self, template: str, rows: int, format: str = "csv") -> bytes:
r = requests.post(self.BASE, headers=self.headers,
json={"template": template, "rows": rows, "format": format})
r.raise_for_status()
return r.content
# Usage:
ds = DataSynth("ds_live_YOUR_KEY")
data = ds.generate("ecommerce_customer_pl", rows=5000)
open("data.csv", "wb").write(data)
JavaScript SDK (minimal)
class DataSynth {
constructor(apiKey) { this.apiKey = apiKey; }
async generate(template, rows, format = 'csv') {
const res = await fetch('https://datasynth.pl/api/generate', {
method: 'POST',
headers: {
'Authorization': `Bearer ${this.apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ template, rows, format }),
});
if (!res.ok) throw new Error(`API error ${res.status}`);
return res.blob();
}
}
// Usage (Node.js / browser):
const ds = new DataSynth('ds_live_YOUR_KEY');
const blob = await ds.generate('hr_employee_de', 2000, 'json');
// browser: create download link from blob
// node: Buffer.from(await blob.arrayBuffer())
cURL Examples
Generate 10 000 German HR records as JSON
curl -X POST https://datasynth.pl/api/generate \
-H "Authorization: Bearer ds_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"template":"hr_mitarbeiter_de","rows":10000,"format":"json"}' \
-o mitarbeiter.json
Check available templates (GET)
curl https://datasynth.pl/api/generate \
-H "Authorization: Bearer ds_live_YOUR_KEY"