Home / API docs / HTML to Shopify Section API
Dev Tools

HTML to Shopify Section API

POST /api/liquid/section $0.01 per call USDC on Base · x402

HTML → Shopify section converter. POST static HTML; get back a drop-in theme section: headings, paragraphs, images, links, and buttons are lifted into {{ section.settings.* }} references and a matching {% schema %} is generated with your original content as the defaults — immediately editable in the Shopify theme editor. Deterministic transform, no AI; output is self-linted before it's returned.

Parameters

NameInDescription
htmlbodyrequiredStatic HTML to convert (fragment or full page), max 256 KB
namebodySection name for the schema (default: first heading)

Example request

curl -X POST "https://api.webbersites.com/api/liquid/section" \
  -H "Content-Type: application/json" \
  -d '{"html":"<section class=\"hero\"><h1>Summer Sale</h1><p>Up to 50% off.</p><a href=\"/collections/sale\">Shop now</a></section>","name":"Hero"}'
# first call returns 402 + payment requirements; an x402 client pays and retries automatically

Example response

{
    "name": "Summer Sale",
    "liquid": "<section class=\"hero\"><h1>{{ section.settings.heading }}</h1>…{% schema %}{…}{% endschema %}",
    "settings_count": 4,
    "replacements": [
        {
            "setting": "heading",
            "type": "text",
            "element": "h1",
            "from": "Summer Sale"
        }
    ],
    "lint": {
        "verdict": "clean"
    }
}
MCP tool: post_liquid_section — via npx -y webbersites-x402-mcp (local, key stays on your machine) or the remote endpoint https://api.webbersites.com/mcp.

How payment works

There is no signup and no API key. Call the endpoint; it replies 402 Payment Required with machine-readable payment requirements. Your client signs a USDC transfer authorization (EIP-3009, gasless) and retries with the X-PAYMENT header — @x402/fetch does this automatically. See the overview for a working snippet.