← Back to all products
$29
Form API Builder
Auto-generate REST APIs from form definitions with CRUD endpoints, webhooks, and API key auth.
JSONMarkdownPython
📄 Product Preview
Try the interactive reader and demo tools below, or get the full product with all content unlocked.
📖 Interactive Reader (Free Preview) ⚙ Try Demo Tools 📦 Download Free Sample📁 File Structure 9 files
form-api-builder/
├── LICENSE
├── README.md
├── examples/
│ └── api_config.json
├── free-sample.zip
├── guide/
│ ├── 01_features.md
│ ├── 02_api-endpoints.md
│ └── 03_example-testing-the-api.md
├── index.html
└── src/
└── form_api_builder.py
📖 Documentation Preview README excerpt
Form API Builder
Auto-generate REST APIs from form definitions — CRUD endpoints, pagination, webhooks, and API key auth. Pure Python, zero dependencies.
Part of the [Form Forge](https://form-forge.codevault.dev) toolkit by CodeVault.
Features
- Auto-generated CRUD endpoints: GET, POST, PUT, DELETE from form definitions
- JSON file store: persistent storage with no database required
- Pagination: page/per_page query parameters on list endpoints
- Webhooks: notify external URLs on create/update/delete with HMAC signatures
- API key authentication: protect endpoints with configurable API keys
- CORS support: configurable cross-origin headers
- Field validation: validate submissions against form field definitions
- Schema endpoint: GET
/api/{form}/schemareturns the form definition - Built on
http.server— zero external dependencies, Python 3.10+ stdlib only
Quick Start
# Start the API server with a form config
python src/form_api_builder.py --config examples/api_config.json --port 8080
# Start with the built-in demo
python src/form_api_builder.py --demo
# Print the generated schema
python src/form_api_builder.py --config examples/api_config.json --schema
CLI Reference
| Flag | Description |
|---|---|
--config FILE | JSON configuration file with form definitions |
--port N | Port to run the server on (default: 8000) |
--host HOST | Host to bind to (default: 0.0.0.0) |
--schema | Print the API schema and exit (don't start server) |
--demo | Start with a built-in demo configuration |
API Endpoints
For each form defined in your config, the following endpoints are generated:
| Method | Endpoint | Description |
|---|---|---|
GET | /api/{slug} | List all submissions (paginated) |
POST | /api/{slug} | Create a new submission |
GET | /api/{slug}/{id} | Get a specific submission |
PUT | /api/{slug}/{id} | Update a submission |
DELETE | /api/{slug}/{id} | Delete a submission |
GET | /api/{slug}/schema | Get the form schema definition |
Pagination
GET /api/contacts?page=2&per_page=10
... continues with setup instructions, usage examples, and more.
📄 Code Sample .py preview
src/form_api_builder.py
#!/usr/bin/env python3
"""
Form API Builder — Auto-Generate REST APIs from Form Definitions
=================================================================
Define a form in JSON, get a complete REST API with CRUD operations,
webhook support, data storage (JSON files), and input validation.
Uses Python's built-in http.server — no framework required.
Part of the Form Forge toolkit by DataNest.
License: MIT
"""
from __future__ import annotations
import argparse
import hashlib
import html
import http.server
import json
import logging
import os
import re
import secrets
import sys
import time
import urllib.parse
import urllib.request
from dataclasses import dataclass, field
from datetime import datetime, timezone
from typing import Any
logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s")
logger = logging.getLogger(__name__)
# ---------------------------------------------------------------------------
# Constants
# ---------------------------------------------------------------------------
DEFAULT_PORT = 8080
DATA_DIR = "api_data"
DEFAULT_HOST = "0.0.0.0"
# ---------------------------------------------------------------------------
# Data store (JSON-file backed)
# ---------------------------------------------------------------------------
class JSONStore:
"""Simple JSON-file-backed data store.
Each form gets its own JSON file. Records are dicts with
# ... 506 more lines ...