Generation & Mock Data

8 endpoints for generating random identifiers, fake content, QR codes, TypeScript interfaces, and fully structured mock datasets.

Endpoint Purpose
GET /v1/uuid Generate UUIDs, ULIDs, or Nano IDs
GET /v1/password-gen Generate secure random passwords
GET /v1/lorem-ipsum Generate Lorem Ipsum placeholder text
GET /v1/fake-data Generate fake emails, names, addresses, and more
GET /v1/qr-generate Generate a QR code (PNG or SVG)
POST /v1/mock-data Generate structured mock datasets (JSON, CSV, SQL, XML)
POST /v1/mock-schema Reverse-engineer a field schema from a sample object

Python SDK Examples

Generate UUIDs

from toolkitapi import DevTools

with DevTools(api_key="tk_...") as dt:
    # v4 UUIDs
    result = dt.uuid(version="v4", count=5)
    print(result["ids"])

    # ULIDs (sortable)
    result = dt.uuid(version="ulid", count=3)
    print(result["ids"])

    # Nano IDs (URL-safe, compact)
    result = dt.uuid(version="nanoid", count=3)
    print(result["ids"])

Generate secure passwords

from toolkitapi import DevTools

with DevTools(api_key="tk_...") as dt:
    result = dt.password_gen(
        length=20,
        uppercase=True,
        lowercase=True,
        numbers=True,
        symbols=True,
        count=3,
    )
    print(result["passwords"])
    print(result["strength"])    # Strength rating for each password

Generate Lorem Ipsum text

from toolkitapi import DevTools

with DevTools(api_key="tk_...") as dt:
    result = dt.lorem_ipsum(paragraphs=2)
    print(result["text"])

    # Or get a specific sentence/word count
    result = dt.lorem_ipsum(sentences=5)
    print(result["text"])

Generate fake data

from toolkitapi import DevTools

with DevTools(api_key="tk_...") as dt:
    # Supported types: email, name, address, phone, company,
    #                  url, ipv4, ipv6, mac_address, user_agent
    result = dt.fake_data(type="email", count=10)
    print(result["items"])

Generate a QR code

from toolkitapi import DevTools
import base64

with DevTools(api_key="tk_...") as dt:
    result = dt.qr_generate(
        data="https://toolkitapi.io",
        format="png",
        scale=5,
        error="M",
    )
    # result["image"] is a base64-encoded PNG
    with open("qr.png", "wb") as f:
        f.write(base64.b64decode(result["image"]))

Generate TypeScript interfaces from JSON

from toolkitapi import DevTools

sample = {
    "id": 1,
    "name": "Widget A",
    "active": True,
    "tags": ["sale", "new"],
    "meta": {"created": "2024-01-01"},
}

with DevTools(api_key="tk_...") as dt:
    result = dt.json_to_typescript(sample, root_name="Product")
    print(result["typescript"])
    # interface Product {
    #   id: number;
    #   name: string;
    #   active: boolean;
    #   tags: string[];
    #   meta: Meta;
    # }

Generate structured mock data

from toolkitapi import DevTools

fields = [
    {"name": "id", "type": "uuid"},
    {"name": "name", "type": "name"},
    {"name": "email", "type": "email"},
    {"name": "created_at", "type": "date"},
    {"name": "active", "type": "boolean"},
    {"name": "score", "type": "float", "options": {"min": 0, "max": 100}},
]

with DevTools(api_key="tk_...") as dt:
    result = dt.mock_data(
        fields=fields,
        rows=50,
        output_format="json",
        seed=42,            # reproducible output
    )
    print(result["data"])

    # Or as CSV
    result = dt.mock_data(fields=fields, rows=100, output_format="csv")
    print(result["data"])   # CSV string

    # Or as SQL INSERT statements
    result = dt.mock_data(
        fields=fields, rows=20,
        output_format="sql", table_name="users"
    )
    print(result["data"])

Reverse-engineer a mock schema from a sample

from toolkitapi import DevTools

# Have an existing object? Let the API infer the field types
sample = {
    "id": 1,
    "name": "Alice",
    "email": "[email protected]",
    "score": 87.5,
    "active": True,
}

with DevTools(api_key="tk_...") as dt:
    result = dt.mock_schema(sample)
    # Returns a fields array ready to pass back to mock_data
    print(result["fields"])

Tip

Use mock-schema to auto-detect field types from a real API response, then feed the output directly into mock-data to generate a matching test dataset.