curl --request POST \
--url https://api.iotools.cloud/v1/tool/yaml-diff-comparator \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"yamlA": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: web\n labels:\n app: web\n tier: frontend\nspec:\n replicas: 2\n template:\n spec:\n containers:\n - name: web\n image: nginx:1.25\n ports:\n - containerPort: 80\n",
"yamlB": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: web\n labels:\n app: web\n env: production\nspec:\n replicas: 4\n strategy: RollingUpdate\n template:\n spec:\n containers:\n - name: web\n image: nginx:1.27\n ports:\n - containerPort: 8080\n",
"seqOrder": "position",
"looseScalars": ""
}
'{
"tool": "yaml-diff-comparator",
"tool_version": "1.0.2",
"outputs": {
"summary": [
{
"metric": "Added",
"value": "2"
},
{
"metric": "Removed",
"value": "1"
},
{
"metric": "Changed",
"value": "3"
},
{
"metric": "Documents",
"value": "1"
},
{
"metric": "Result",
"value": "6 differences"
}
],
"structuralDiff": "- metadata.labels.tier \"frontend\"\n+ metadata.labels.env \"production\"\n~ spec.replicas 2 -> 4\n~ spec.template.spec.containers[0].image \"nginx:1.25\" -> \"nginx:1.27\"\n~ spec.template.spec.containers[0].ports[0].containerPort 80 -> 8080\n+ spec.strategy \"RollingUpdate\"",
"unifiedDiff": "--- YAML A\n+++ YAML B\n@@ -4,13 +4,14 @@\n name: web\n labels:\n app: web\n- tier: frontend\n+ env: production\n spec:\n- replicas: 2\n+ replicas: 4\n+ strategy: RollingUpdate\n template:\n spec:\n containers:\n - name: web\n- image: nginx:1.25\n+ image: nginx:1.27\n ports:\n- - containerPort: 80\n+ - containerPort: 8080",
"diffHtml": "<div style=\"font-family:monospace;white-space:pre-wrap\"><div>apiVersion: apps/v1</div><div>kind: Deployment</div><div>metadata:</div><div> name: web</div><div> labels:</div><div> app: web</div><div> <span style=\"color:#b91c1c;background-color:#fee2e2;text-decoration:line-through\">tier</span><span style=\"color:#15803d;background-color:#dcfce7;text-decoration:underline\">env</span>: <span style=\"color:#b91c1c;background-color:#fee2e2;text-decoration:line-through\">frontend</span><span style=\"color:#15803d;background-color:#dcfce7;text-decoration:underline\">production</span></div><div>spec:</div><div><span style=\"color:#b91c1c;background-color:#fee2e2;text-decoration:line-through\"> replicas: 2</span></div><div><span style=\"color:#15803d;background-color:#dcfce7;text-decoration:underline\"> replicas: 4</span></div><div><span style=\"color:#15803d;background-color:#dcfce7;text-decoration:underline\"> strategy: RollingUpdate</span></div><div> template:</div><div> spec:</div><div> containers:</div><div> - name: web</div><div> image: nginx:1.2<span style=\"color:#b91c1c;background-color:#fee2e2;text-decoration:line-through\">5</span><span style=\"color:#15803d;background-color:#dcfce7;text-decoration:underline\">7</span></div><div> ports:</div><div> - containerPort: 80<span style=\"color:#15803d;background-color:#dcfce7;text-decoration:underline\">80</span></div></div>"
},
"credits_used": 5,
"credits_remaining": null
}YAML Diff Comparator
Compare two YAML documents and see exactly what changed — added, removed and modified keys with a path to each one, plus a unified line diff of the normalized YAML. Structural comparison ignores indentation, quoting and flow-vs-block formatting, and handles multi-document streams. Runs entirely in your browser.
curl --request POST \
--url https://api.iotools.cloud/v1/tool/yaml-diff-comparator \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"yamlA": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: web\n labels:\n app: web\n tier: frontend\nspec:\n replicas: 2\n template:\n spec:\n containers:\n - name: web\n image: nginx:1.25\n ports:\n - containerPort: 80\n",
"yamlB": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: web\n labels:\n app: web\n env: production\nspec:\n replicas: 4\n strategy: RollingUpdate\n template:\n spec:\n containers:\n - name: web\n image: nginx:1.27\n ports:\n - containerPort: 8080\n",
"seqOrder": "position",
"looseScalars": ""
}
'{
"tool": "yaml-diff-comparator",
"tool_version": "1.0.2",
"outputs": {
"summary": [
{
"metric": "Added",
"value": "2"
},
{
"metric": "Removed",
"value": "1"
},
{
"metric": "Changed",
"value": "3"
},
{
"metric": "Documents",
"value": "1"
},
{
"metric": "Result",
"value": "6 differences"
}
],
"structuralDiff": "- metadata.labels.tier \"frontend\"\n+ metadata.labels.env \"production\"\n~ spec.replicas 2 -> 4\n~ spec.template.spec.containers[0].image \"nginx:1.25\" -> \"nginx:1.27\"\n~ spec.template.spec.containers[0].ports[0].containerPort 80 -> 8080\n+ spec.strategy \"RollingUpdate\"",
"unifiedDiff": "--- YAML A\n+++ YAML B\n@@ -4,13 +4,14 @@\n name: web\n labels:\n app: web\n- tier: frontend\n+ env: production\n spec:\n- replicas: 2\n+ replicas: 4\n+ strategy: RollingUpdate\n template:\n spec:\n containers:\n - name: web\n- image: nginx:1.25\n+ image: nginx:1.27\n ports:\n- - containerPort: 80\n+ - containerPort: 8080",
"diffHtml": "<div style=\"font-family:monospace;white-space:pre-wrap\"><div>apiVersion: apps/v1</div><div>kind: Deployment</div><div>metadata:</div><div> name: web</div><div> labels:</div><div> app: web</div><div> <span style=\"color:#b91c1c;background-color:#fee2e2;text-decoration:line-through\">tier</span><span style=\"color:#15803d;background-color:#dcfce7;text-decoration:underline\">env</span>: <span style=\"color:#b91c1c;background-color:#fee2e2;text-decoration:line-through\">frontend</span><span style=\"color:#15803d;background-color:#dcfce7;text-decoration:underline\">production</span></div><div>spec:</div><div><span style=\"color:#b91c1c;background-color:#fee2e2;text-decoration:line-through\"> replicas: 2</span></div><div><span style=\"color:#15803d;background-color:#dcfce7;text-decoration:underline\"> replicas: 4</span></div><div><span style=\"color:#15803d;background-color:#dcfce7;text-decoration:underline\"> strategy: RollingUpdate</span></div><div> template:</div><div> spec:</div><div> containers:</div><div> - name: web</div><div> image: nginx:1.2<span style=\"color:#b91c1c;background-color:#fee2e2;text-decoration:line-through\">5</span><span style=\"color:#15803d;background-color:#dcfce7;text-decoration:underline\">7</span></div><div> ports:</div><div> - containerPort: 80<span style=\"color:#15803d;background-color:#dcfce7;text-decoration:underline\">80</span></div></div>"
},
"credits_used": 5,
"credits_remaining": null
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Response
Tool output
Show child attributes
Show child attributes
The tool's slug, echoing the {slug} in the request path.
Output-contract version for this tool.
Credits this call consumed, after any settlement refund. 0 when metering is disabled.
Credits left in the current monthly allowance, or null when metering is disabled.
Correlation id, also sent as x-request-id.
Was this page helpful?