Json To Liquid API
https://api.findutils.com/api/tools/json-to-liquid/execute Turn structured data into Shopify Liquid. The input can be JSON, a JavaScript object literal (unquoted keys, single quotes, trailing commas, comments), a Python dict (True/False/None, tuples), a PHP array (=> pairs, array()) or YAML; auto detects which. Two outputs: an assigns block that recreates the data with {% assign %} and {% capture %} (nested keys flattened to snake_case names, scalar arrays as split strings, arrays of objects as parallel arrays, deeper structures as JSON strings), and a rendering template skeleton with {{ paths }}, {% for %} loops and {% if %} guards for the same object as it would arrive in a theme. Every lossy mapping is listed in warnings. Liquid has no object or array literals, so the assigns block is the honest community mapping, not a lossless encoding. The browser page at /developers/json-to-liquid/ previews the result with LiquidJS.
Request body
application/json-
source
string required
The data as text: JSON, a JS object literal, a Python dict, a PHP array or YAML.
-
language
string optional
Which dialect the source is written in. auto (default) tries JSON, then a JS/Python/PHP literal, then YAML. One of
auto · json · javascript · python · php · yaml. Default"auto". -
root
string optional
Optional variable that holds the data in the theme, such as product or section.settings. The template reads root.key and the assigns become root_key. Default: top-level keys are the variables.
-
escape_html
boolean optional
Add | escape to every output in the template skeleton. Default false. Default
false.
Example arguments
Verified{
"source": "{ shop: { name: 'Acme', open: true }, tags: ['new', 'sale'] }"
} More Data tools
- Api Docs Generator Return API documentation generated from a list of endpoints, as Markdown (with table of contents, request/response examples) or as an OpenAP
- Bookmarks Html To Csv Convert a browser bookmarks.html export from Chrome, Firefox, Edge, Safari or any other browser that writes the Netscape bookmark format int
- Csv To Bookmarks Html Convert a CSV of links into a Netscape bookmarks.html file that Chrome, Firefox, Edge and Safari import.
- Csv To Json Parse CSV text into an array of objects keyed by the header row.
- Csv To Ndjson Convert CSV into newline-delimited JSON (NDJSON, JSON Lines, .jsonl): one JSON object per line, keyed by the header row.
- Csv To Sql Convert CSV text into SQL INSERT statements, optionally preceded by a CREATE TABLE.