561 Group Market

HTML to Parsed JSON Document Tree

Parse HTML into ordered JSON document nodes using native HTML error recovery. Retain document mode, doctype IDs, element namespaces, attributes, text/comments and separate inert template content. Include original UTF-16 source spans; implied nodes have null spans. This is the parsed DOM carrier, not original lexical markup or browser rendering. Limits65536 input UTF-8 bytes,8192 nodes/attributes,depth64,1048576 result JSON bytes. No fetching or script execution.

Price
from $0.0012 USDC per request (starting price; the 402 response quotes the exact amount for your input)
Network
Base mainnet, eip155:8453, settled in USDC through the Coinbase CDP facilitator
Method and URL
POST https://market.561.group/v1/data/html-to-json-tree
Response type
application/json
Seller
Causeway Services (561 Group)

Input contract

Input that fails this contract is refused with a 4xx status before any payment is requested.

{
  "maxBytes": 1048576,
  "bodySchema": {
    "type": "object",
    "required": [
      "html"
    ],
    "properties": {
      "html": {
        "type": "string",
        "maxLength": 65536,
        "description": "Maximum65536decoded UTF-8 bytes; full JSON escaping fits the request envelope."
      }
    },
    "additionalProperties": false
  }
}

Example request

{
  "method": "POST",
  "url": "https://market.561.group/v1/data/html-to-json-tree",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  },
  "body": {
    "html": "<!doctype html><p>A &amp; B<svg><text>猫</text></svg><template><b>inert</b></template>"
  }
}

Output

{
  "schema": {
    "type": "object",
    "required": [
      "document",
      "sourceByteLength",
      "offsetUnit"
    ],
    "properties": {
      "document": {
        "type": "object",
        "required": [
          "kind",
          "mode",
          "children"
        ],
        "properties": {
          "kind": {
            "const": "document"
          },
          "mode": {
            "enum": [
              "no-quirks",
              "quirks",
              "limited-quirks"
            ]
          },
          "children": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        },
        "description": "Native parsed ordered nodes, including implied elements, namespace/attribute metadata, doctype public/system IDs and separate template fragment content. Source offsets are null for implied nodes."
      },
      "sourceByteLength": {
        "type": "integer",
        "minimum": 0
      },
      "offsetUnit": {
        "const": "UTF-16 code units"
      }
    }
  },
  "example": {
    "document": {
      "kind": "document",
      "mode": "no-quirks",
      "children": [
        {
          "kind": "doctype",
          "name": "html",
          "publicId": "",
          "systemId": "",
          "source": {
            "start": 0,
            "end": 15
          }
        },
        {
          "kind": "element",
          "name": "html",
          "namespace": "http://www.w3.org/1999/xhtml",
          "attributes": [],
          "children": [
            {
              "kind": "element",
              "name": "head",
              "namespace": "http://www.w3.org/1999/xhtml",
              "attributes": [],
              "children": [],
              "source": null
            },
            {
              "kind": "element",
              "name": "body",
              "namespace": "http://www.w3.org/1999/xhtml",
              "attributes": [],
              "children": [
                {
                  "kind": "element",
                  "name": "p",
                  "namespace": "http://www.w3.org/1999/xhtml",
                  "attributes": [],
                  "children": [
                    {
                      "kind": "text",
                      "value": "A & B",
                      "source": {
                        "start": 18,
                        "end": 27
                      }
                    },
                    {
                      "kind": "element",
                      "name": "svg",
                      "namespace": "http://www.w3.org/2000/svg",
                      "attributes": [],
                      "children": [
                        {
                          "kind": "element",
                          "name": "text",
                          "namespace": "http://www.w3.org/2000/svg",
                          "attributes": [],
                          "children": [
                            {
           
… (truncated; the full contract is in /v1/catalog)

How to buy with x402

  1. Send the request without payment. The server answers 402 Payment Required with a base64 JSON PAYMENT-REQUIRED header holding the amount, asset, network and payee.
  2. Have your wallet sign an EIP-3009 transferWithAuthorization for exactly those terms (an x402 client library does this for you).
  3. Repeat the identical request with the signed payload in the PAYMENT-SIGNATURE header.
  4. The server verifies, runs the operation, settles, and returns 200 with the result and a PAYMENT-RESPONSE header carrying the settlement receipt.

Read the price without paying

curl --include --request POST --header 'accept: application/json' --header 'content-type: application/json' --data-raw '{"html":"<!doctype html><p>A &amp; B<svg><text>猫</text></svg><template><b>inert</b></template>"}' --url 'https://market.561.group/v1/data/html-to-json-tree'

This request authorizes nothing; it returns the live payment terms. Read the full explanation of x402.

Machine-readable