DataSynth PL — API Docs

Generate GDPR-compliant synthetic data programmatically. 15 templates · 3 locales (PL/US/DE) · CSV, JSON, Excel.

Base URL: 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 dashboardKlucze API. Keys start with ds_live_ and are shown only once at creation.

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

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.

POST https://datasynth.pl/api/generate

Request body (JSON)

ParameterTypeRequiredDescription
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:

HeaderValue
Content-Dispositionattachment; filename="datasynth_..."
X-Records-GeneratedActual number of records in the file
X-TemplateTemplate 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 IDDescriptionFields
ecommerce_customer_pl🇵🇱 E-commerce customersid, imie, nazwisko, email, telefon, miasto, segment, ltv_pln…
fintech_transaction_pl🇵🇱 Financial transactionstransaction_id, kwota_pln, kategoria, merchant, flaga_fraud…
hr_employee_pl🇵🇱 HR employeesid_pracownika, stanowisko, wynagrodzenie_pln, dzial…
medical_patient_pl🇵🇱 Patient records (anon.)patient_id, wiek, bmi, diagnoza, ubezpieczenie…
logistics_shipment_pl🇵🇱 Logistics shipmentsshipment_id, przewoznik, status, waga_kg…
ecommerce_customer_us🇺🇸 E-commerce customersid, first_name, last_name, state, zip_code, ltv_usd…
fintech_transaction_us🇺🇸 Financial transactionstransaction_id, amount_usd, method (ACH/Venmo/Zelle)…
hr_employee_us🇺🇸 HR employeesemployee_id, job_title, annual_salary_usd, state…
medical_patient_us🇺🇸 Patient records (anon.)patient_id, age, insurance (Medicare/Medicaid)…
logistics_shipment_us🇺🇸 Logistics shipmentsshipment_id, carrier (FedEx/UPS/USPS), weight_lbs…
ecommerce_kunde_de🇩🇪 E-Commerce Kundenid, vorname, nachname, bundesland, plz, ltv_eur…
fintech_transaktion_de🇩🇪 Finanztransaktionentransaktions_id, betrag_eur, methode (EC-Karte/SEPA)…
hr_mitarbeiter_de🇩🇪 Mitarbeiterdaten HRmitarbeiter_id, position, jahresgehalt_eur, bundesland…
medical_patient_de🇩🇪 Patientendaten (anon.)patienten_id, alter, krankenversicherung (Gesetzlich/Privat)…
logistics_sendung_de🇩🇪 Paketsendungensendungs_id, paketdienst (DHL/Hermes/DPD), gewicht_kg…

Formats

FormatContent-TypePlans
csvtext/csvFree Starter Business Enterprise
jsonapplication/jsonFree Starter Business Enterprise
xlsxapplication/vnd.openxmlformats…Business Enterprise

Plan Limits

PlanRecords/monthMax per requestAPI KeysFormats
Free100100CSV, JSON
Starter — 49 zł/mc100 0005 0003CSV, JSON
Business — 149 zł/mc1 000 00050 00010CSV, JSON, Excel
EnterpriseUnlimited200 00020All formats

Record counters reset monthly on your subscription renewal date.

Error Codes

HTTPCodeMeaning
401UnauthorizedMissing or invalid API key
400Bad RequestUnknown template ID or missing required field
429Too Many RequestsMonthly record limit exceeded — upgrade plan or wait for reset
500Server ErrorUnexpected 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"
Questions? Email kontakt@datasynth.pl or open the client dashboard.