Skip to content

AlberaMarc/formforge-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

FormForge API

API Status License: MIT

Convert JSON form schemas into styled, accessible HTML forms with a simple REST API.

Live Site  ·  API Docs  ·  Blog  ·  Status


Features

  • 3 Themes — Modern, Corporate, and Playful styles ready to embed
  • 10 Field Types — text, email, number, textarea, select, checkbox, radio, date, tel, url
  • Client-Side Validation — Required fields, email format, number ranges, pattern matching
  • ARIA Accessible — Semantic labels, keyboard navigation, screen reader support
  • Responsive Design — Mobile-first, adapts to any container width
  • Free Tier — 20 forms per day at zero cost, no credit card required

Quick Start

1. Get Your API Key

curl -X POST https://formforge-api.vercel.app/api/signup \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com"}'

2. Generate a Form

curl -X POST https://formforge-api.vercel.app/api/json-to-form \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Contact Us",
    "theme": "modern",
    "fields": [
      {"name": "name", "type": "text", "label": "Full Name", "required": true},
      {"name": "email", "type": "email", "label": "Email Address", "required": true},
      {"name": "message", "type": "textarea", "label": "Message", "required": true},
      {"name": "subscribe", "type": "checkbox", "label": "Subscribe to newsletter"}
    ]
  }'

3. Embed the HTML

Paste the returned HTML into your page — no external scripts or stylesheets needed.

<div id="contact-form">
  <!-- Paste the API response HTML here -->
</div>

API Endpoints

Method Endpoint Description
POST /api/signup Create a free-tier API key
POST /api/json-to-form Generate an HTML form from a JSON schema

Example Request & Response

Request

curl -X POST https://formforge-api.vercel.app/api/json-to-form \
  -H "Authorization: Bearer ff_abc123" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Contact Us",
    "theme": "modern",
    "fields": [
      {"name": "name", "type": "text", "label": "Full Name", "required": true},
      {"name": "email", "type": "email", "label": "Email Address", "required": true},
      {"name": "message", "type": "textarea", "label": "Message", "required": true},
      {"name": "subscribe", "type": "checkbox", "label": "Subscribe to newsletter"}
    ]
  }'

Response (200 OK)

{
  "ok": true,
  "html": "<!DOCTYPE html><html>...</html>",
  "usage": {
    "used": 1,
    "limit": 20,
    "remaining": 19
  }
}

The html field contains a complete, self-contained HTML document with inline CSS and JavaScript — ready to embed or serve as a standalone page.


Supported Field Types

Type Description Validation
text Single-line text input Required, min/max length
email Email address input Format validation
number Numeric input Min/max value, step
textarea Multi-line text input Required, min/max length
select Dropdown menu Required selection
checkbox Single checkbox toggle Required acceptance
radio Radio button group Required selection
date Date picker Min/max date
tel Telephone number input Pattern matching
url URL input Format validation

Themes

Theme Style Colors
Modern Clean, minimal design with sharp edges Emerald accents, white background
Corporate Professional layout with structured spacing Navy blue, light gray tones
Playful Rounded corners, friendly feel Purple gradients, soft shadows

Set the theme in your request body:

{ "theme": "modern" }

Pricing

Tier Rate Limit Price
Free 20 forms / day $0 Included with signup
Builder 300 forms / day $14 / month Upgrade
Enterprise Unlimited $39 / month Upgrade

All tiers include every theme, all field types, and full validation support.


Links


Related Products

Product Description Link
DocForge API Document format conversion (Markdown, CSV, JSON, TXT to HTML) docforge-api.vercel.app
ReportForge API Professional report generation from CSV/JSON data reportforge-api.vercel.app

License

MIT

About

Free REST API for generating styled, accessible HTML forms from JSON definitions. 4 themes, 10 field types, WCAG compliant.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors